Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347886
b: refs/heads/master
c: ee29720
h: refs/heads/master
v: v3
  • Loading branch information
Xiaotian Feng authored and Linus Torvalds committed Dec 21, 2012
1 parent 979a7cc commit 6a84558
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 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: c4e18497d8fd92eef2c6e7eadcc1a107ccd115ea
refs/heads/master: ee297209bf0a25c6717b7c063e76795142d32f37
12 changes: 6 additions & 6 deletions trunk/fs/proc/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,18 +359,18 @@ int proc_alloc_inum(unsigned int *inum)
if (!ida_pre_get(&proc_inum_ida, GFP_KERNEL))
return -ENOMEM;

spin_lock(&proc_inum_lock);
spin_lock_bh(&proc_inum_lock);
error = ida_get_new(&proc_inum_ida, &i);
spin_unlock(&proc_inum_lock);
spin_unlock_bh(&proc_inum_lock);
if (error == -EAGAIN)
goto retry;
else if (error)
return error;

if (i > UINT_MAX - PROC_DYNAMIC_FIRST) {
spin_lock(&proc_inum_lock);
spin_lock_bh(&proc_inum_lock);
ida_remove(&proc_inum_ida, i);
spin_unlock(&proc_inum_lock);
spin_unlock_bh(&proc_inum_lock);
return -ENOSPC;
}
*inum = PROC_DYNAMIC_FIRST + i;
Expand All @@ -379,9 +379,9 @@ int proc_alloc_inum(unsigned int *inum)

void proc_free_inum(unsigned int inum)
{
spin_lock(&proc_inum_lock);
spin_lock_bh(&proc_inum_lock);
ida_remove(&proc_inum_ida, inum - PROC_DYNAMIC_FIRST);
spin_unlock(&proc_inum_lock);
spin_unlock_bh(&proc_inum_lock);
}

static void *proc_follow_link(struct dentry *dentry, struct nameidata *nd)
Expand Down

0 comments on commit 6a84558

Please sign in to comment.