diff options
author | Evgeniy Polyakov <zbr@ioremap.net> | 2009-03-27 08:04:19 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-17 14:06:28 -0400 |
commit | f3b8fa701b4bd8ec6d378896ad005f01e8382381 (patch) | |
tree | d330e215ee3cf4202624b731af428a8152821ec2 /drivers | |
parent | 288a9a8955cd28bf6a0f48ec821cf9028e96081b (diff) |
Staging: Pohmelfs: Move parent lock to the place where we really have to send a lookup request to the server.
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/pohmelfs/dir.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/pohmelfs/dir.c b/drivers/staging/pohmelfs/dir.c index 7a41183a32e1..26da75ca1f57 100644 --- a/drivers/staging/pohmelfs/dir.c +++ b/drivers/staging/pohmelfs/dir.c | |||
@@ -389,11 +389,11 @@ static int pohmelfs_readdir(struct file *file, void *dirent, filldir_t filldir) | |||
389 | dprintk("%s: parent: %llu, fpos: %llu, hash: %08lx.\n", | 389 | dprintk("%s: parent: %llu, fpos: %llu, hash: %08lx.\n", |
390 | __func__, pi->ino, (u64)file->f_pos, | 390 | __func__, pi->ino, (u64)file->f_pos, |
391 | (unsigned long)file->private_data); | 391 | (unsigned long)file->private_data); |
392 | 392 | #if 0 | |
393 | err = pohmelfs_data_lock(pi, 0, ~0, POHMELFS_READ_LOCK); | 393 | err = pohmelfs_data_lock(pi, 0, ~0, POHMELFS_READ_LOCK); |
394 | if (err) | 394 | if (err) |
395 | return err; | 395 | return err; |
396 | 396 | #endif | |
397 | err = pohmelfs_sync_remote_dir(pi); | 397 | err = pohmelfs_sync_remote_dir(pi); |
398 | if (err) | 398 | if (err) |
399 | return err; | 399 | return err; |
@@ -513,10 +513,6 @@ struct dentry *pohmelfs_lookup(struct inode *dir, struct dentry *dentry, struct | |||
513 | 513 | ||
514 | need_lock = pohmelfs_need_lock(parent, lock_type); | 514 | need_lock = pohmelfs_need_lock(parent, lock_type); |
515 | 515 | ||
516 | err = pohmelfs_data_lock(parent, 0, ~0, lock_type); | ||
517 | if (err) | ||
518 | goto out; | ||
519 | |||
520 | str.hash = jhash(dentry->d_name.name, dentry->d_name.len, 0); | 516 | str.hash = jhash(dentry->d_name.name, dentry->d_name.len, 0); |
521 | 517 | ||
522 | mutex_lock(&parent->offset_lock); | 518 | mutex_lock(&parent->offset_lock); |
@@ -525,7 +521,7 @@ struct dentry *pohmelfs_lookup(struct inode *dir, struct dentry *dentry, struct | |||
525 | ino = n->ino; | 521 | ino = n->ino; |
526 | mutex_unlock(&parent->offset_lock); | 522 | mutex_unlock(&parent->offset_lock); |
527 | 523 | ||
528 | dprintk("%s: 1 ino: %lu, inode: %p, name: '%s', hash: %x, parent_state: %lx.\n", | 524 | dprintk("%s: start ino: %lu, inode: %p, name: '%s', hash: %x, parent_state: %lx.\n", |
529 | __func__, ino, inode, str.name, str.hash, parent->state); | 525 | __func__, ino, inode, str.name, str.hash, parent->state); |
530 | 526 | ||
531 | if (ino) { | 527 | if (ino) { |
@@ -534,7 +530,7 @@ struct dentry *pohmelfs_lookup(struct inode *dir, struct dentry *dentry, struct | |||
534 | goto out; | 530 | goto out; |
535 | } | 531 | } |
536 | 532 | ||
537 | dprintk("%s: dir: %p, dir_ino: %llu, name: '%s', len: %u, dir_state: %lx, ino: %lu.\n", | 533 | dprintk("%s: no inode dir: %p, dir_ino: %llu, name: '%s', len: %u, dir_state: %lx, ino: %lu.\n", |
538 | __func__, dir, parent->ino, | 534 | __func__, dir, parent->ino, |
539 | str.name, str.len, parent->state, ino); | 535 | str.name, str.len, parent->state, ino); |
540 | 536 | ||
@@ -543,6 +539,10 @@ struct dentry *pohmelfs_lookup(struct inode *dir, struct dentry *dentry, struct | |||
543 | goto out; | 539 | goto out; |
544 | } | 540 | } |
545 | 541 | ||
542 | err = pohmelfs_data_lock(parent, 0, ~0, lock_type); | ||
543 | if (err) | ||
544 | goto out; | ||
545 | |||
546 | err = pohmelfs_lookup_single(parent, &str, ino); | 546 | err = pohmelfs_lookup_single(parent, &str, ino); |
547 | if (err) | 547 | if (err) |
548 | goto out; | 548 | goto out; |