Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155431
b: refs/heads/master
c: b574480
h: refs/heads/master
i:
  155429: 6603a46
  155427: ea9e2be
  155423: 12773e2
v: v3
  • Loading branch information
Theodore Ts'o committed Jun 21, 2009
1 parent 8fb4ab2 commit f2630f2
Show file tree
Hide file tree
Showing 2 changed files with 7 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: 627ad9fd0733f0a31a266ff98a4a933eee710f0b
refs/heads/master: b574480507460b8e31b8d38dd4642219fc3b9a10
11 changes: 6 additions & 5 deletions trunk/fs/jbd2/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2410,6 +2410,7 @@ const char *jbd2_dev_to_name(dev_t device)
int i = hash_32(device, CACHE_SIZE_BITS);
char *ret;
struct block_device *bd;
static struct devname_cache *new_dev;

rcu_read_lock();
if (devcache[i] && devcache[i]->device == device) {
Expand All @@ -2419,20 +2420,20 @@ const char *jbd2_dev_to_name(dev_t device)
}
rcu_read_unlock();

new_dev = kmalloc(sizeof(struct devname_cache), GFP_KERNEL);
if (!new_dev)
return "NODEV-ALLOCFAILURE"; /* Something non-NULL */
spin_lock(&devname_cache_lock);
if (devcache[i]) {
if (devcache[i]->device == device) {
kfree(new_dev);
ret = devcache[i]->devname;
spin_unlock(&devname_cache_lock);
return ret;
}
call_rcu(&devcache[i]->rcu, free_devcache);
}
devcache[i] = kmalloc(sizeof(struct devname_cache), GFP_KERNEL);
if (!devcache[i]) {
spin_unlock(&devname_cache_lock);
return "NODEV-ALLOCFAILURE"; /* Something non-NULL */
}
devcache[i] = new_dev;
devcache[i]->device = device;
bd = bdget(device);
if (bd) {
Expand Down

0 comments on commit f2630f2

Please sign in to comment.