Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117474
b: refs/heads/master
c: ad76cbc
h: refs/heads/master
v: v3
  • Loading branch information
Alexey Dobriyan authored and Al Viro committed Oct 23, 2008
1 parent 3891503 commit a7c5a49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 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: 6de24f0ed08054b2a202902e4d63beff27654db8
refs/heads/master: ad76cbc63b9db7c98da49af3182a783ca1c80a5d
10 changes: 5 additions & 5 deletions trunk/fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ void emergency_remount(void)
* filesystems which don't use real block-devices. -- jrs
*/

static DEFINE_IDR(unnamed_dev_idr);
static DEFINE_IDA(unnamed_dev_ida);
static DEFINE_SPINLOCK(unnamed_dev_lock);/* protects the above */

int set_anon_super(struct super_block *s, void *data)
Expand All @@ -691,10 +691,10 @@ int set_anon_super(struct super_block *s, void *data)
int error;

retry:
if (idr_pre_get(&unnamed_dev_idr, GFP_ATOMIC) == 0)
if (ida_pre_get(&unnamed_dev_ida, GFP_ATOMIC) == 0)
return -ENOMEM;
spin_lock(&unnamed_dev_lock);
error = idr_get_new(&unnamed_dev_idr, NULL, &dev);
error = ida_get_new(&unnamed_dev_ida, &dev);
spin_unlock(&unnamed_dev_lock);
if (error == -EAGAIN)
/* We raced and lost with another CPU. */
Expand All @@ -704,7 +704,7 @@ int set_anon_super(struct super_block *s, void *data)

if ((dev & MAX_ID_MASK) == (1 << MINORBITS)) {
spin_lock(&unnamed_dev_lock);
idr_remove(&unnamed_dev_idr, dev);
ida_remove(&unnamed_dev_ida, dev);
spin_unlock(&unnamed_dev_lock);
return -EMFILE;
}
Expand All @@ -720,7 +720,7 @@ void kill_anon_super(struct super_block *sb)

generic_shutdown_super(sb);
spin_lock(&unnamed_dev_lock);
idr_remove(&unnamed_dev_idr, slot);
ida_remove(&unnamed_dev_ida, slot);
spin_unlock(&unnamed_dev_lock);
}

Expand Down

0 comments on commit a7c5a49

Please sign in to comment.