Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348034
b: refs/heads/master
c: dfb2ea4
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Dec 26, 2012
1 parent 0a56d20 commit 39758e9
Show file tree
Hide file tree
Showing 2 changed files with 8 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: c876ad7682155958d0c9c27afe9017925c230d64
refs/heads/master: dfb2ea45becb198beeb75350d0b7b7ad9076a38f
13 changes: 7 additions & 6 deletions trunk/fs/proc/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,18 +352,18 @@ int proc_alloc_inum(unsigned int *inum)
if (!ida_pre_get(&proc_inum_ida, GFP_KERNEL))
return -ENOMEM;

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

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

void proc_free_inum(unsigned int inum)
{
spin_lock_bh(&proc_inum_lock);
unsigned long flags;
spin_lock_irqsave(&proc_inum_lock, flags);
ida_remove(&proc_inum_ida, inum - PROC_DYNAMIC_FIRST);
spin_unlock_bh(&proc_inum_lock);
spin_unlock_irqrestore(&proc_inum_lock, flags);
}

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

0 comments on commit 39758e9

Please sign in to comment.