Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107271
b: refs/heads/master
c: 7ee7c12
h: refs/heads/master
i:
  107269: 11a99bf
  107267: 4aeebe2
  107263: 774d78c
v: v3
  • Loading branch information
Alexey Dobriyan authored and Al Viro committed Aug 1, 2008
1 parent 70c2b46 commit 1836e7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9a18540915faaaadd7f71c16fa877a0c19675923
refs/heads/master: 7ee7c12b7121cd49d528de219e4ffd5459657998
16 changes: 8 additions & 8 deletions trunk/fs/devpts/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#define DEVPTS_DEFAULT_MODE 0600

extern int pty_limit; /* Config limit on Unix98 ptys */
static DEFINE_IDR(allocated_ptys);
static DEFINE_IDA(allocated_ptys);
static DEFINE_MUTEX(allocated_ptys_lock);

static struct vfsmount *devpts_mnt;
Expand Down Expand Up @@ -180,24 +180,24 @@ static struct dentry *get_node(int num)
int devpts_new_index(void)
{
int index;
int idr_ret;
int ida_ret;

retry:
if (!idr_pre_get(&allocated_ptys, GFP_KERNEL)) {
if (!ida_pre_get(&allocated_ptys, GFP_KERNEL)) {
return -ENOMEM;
}

mutex_lock(&allocated_ptys_lock);
idr_ret = idr_get_new(&allocated_ptys, NULL, &index);
if (idr_ret < 0) {
ida_ret = ida_get_new(&allocated_ptys, &index);
if (ida_ret < 0) {
mutex_unlock(&allocated_ptys_lock);
if (idr_ret == -EAGAIN)
if (ida_ret == -EAGAIN)
goto retry;
return -EIO;
}

if (index >= pty_limit) {
idr_remove(&allocated_ptys, index);
ida_remove(&allocated_ptys, index);
mutex_unlock(&allocated_ptys_lock);
return -EIO;
}
Expand All @@ -208,7 +208,7 @@ int devpts_new_index(void)
void devpts_kill_index(int idx)
{
mutex_lock(&allocated_ptys_lock);
idr_remove(&allocated_ptys, idx);
ida_remove(&allocated_ptys, idx);
mutex_unlock(&allocated_ptys_lock);
}

Expand Down

0 comments on commit 1836e7c

Please sign in to comment.