diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-07 11:56:33 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-07 11:56:33 -0500 |
| commit | b4a45f5fe8078bfc10837dbd5b98735058bc4698 (patch) | |
| tree | df6f13a27610a3ec7eb4a661448cd779a8f84c79 /fs/coda/dir.c | |
| parent | 01539ba2a706ab7d35fc0667dff919ade7f87d63 (diff) | |
| parent | b3e19d924b6eaf2ca7d22cba99a517c5171007b6 (diff) | |
Merge branch 'vfs-scale-working' of git://git.kernel.org/pub/scm/linux/kernel/git/npiggin/linux-npiggin
* 'vfs-scale-working' of git://git.kernel.org/pub/scm/linux/kernel/git/npiggin/linux-npiggin: (57 commits)
fs: scale mntget/mntput
fs: rename vfsmount counter helpers
fs: implement faster dentry memcmp
fs: prefetch inode data in dcache lookup
fs: improve scalability of pseudo filesystems
fs: dcache per-inode inode alias locking
fs: dcache per-bucket dcache hash locking
bit_spinlock: add required includes
kernel: add bl_list
xfs: provide simple rcu-walk ACL implementation
btrfs: provide simple rcu-walk ACL implementation
ext2,3,4: provide simple rcu-walk ACL implementation
fs: provide simple rcu-walk generic_check_acl implementation
fs: provide rcu-walk aware permission i_ops
fs: rcu-walk aware d_revalidate method
fs: cache optimise dentry and inode for rcu-walk
fs: dcache reduce branches in lookup path
fs: dcache remove d_mounted
fs: fs_struct use seqlock
fs: rcu-walk for path lookup
...
Diffstat (limited to 'fs/coda/dir.c')
| -rw-r--r-- | fs/coda/dir.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 5d8b35539601..29badd91360f 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
| 19 | #include <linux/string.h> | 19 | #include <linux/string.h> |
| 20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
| 21 | #include <linux/namei.h> | ||
| 21 | 22 | ||
| 22 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
| 23 | 24 | ||
| @@ -47,7 +48,7 @@ static int coda_readdir(struct file *file, void *buf, filldir_t filldir); | |||
| 47 | 48 | ||
| 48 | /* dentry ops */ | 49 | /* dentry ops */ |
| 49 | static int coda_dentry_revalidate(struct dentry *de, struct nameidata *nd); | 50 | static int coda_dentry_revalidate(struct dentry *de, struct nameidata *nd); |
| 50 | static int coda_dentry_delete(struct dentry *); | 51 | static int coda_dentry_delete(const struct dentry *); |
| 51 | 52 | ||
| 52 | /* support routines */ | 53 | /* support routines */ |
| 53 | static int coda_venus_readdir(struct file *coda_file, void *buf, | 54 | static int coda_venus_readdir(struct file *coda_file, void *buf, |
| @@ -125,7 +126,7 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, struc | |||
| 125 | return ERR_PTR(error); | 126 | return ERR_PTR(error); |
| 126 | 127 | ||
| 127 | exit: | 128 | exit: |
| 128 | entry->d_op = &coda_dentry_operations; | 129 | d_set_d_op(entry, &coda_dentry_operations); |
| 129 | 130 | ||
| 130 | if (inode && (type & CODA_NOCACHE)) | 131 | if (inode && (type & CODA_NOCACHE)) |
| 131 | coda_flag_inode(inode, C_VATTR | C_PURGE); | 132 | coda_flag_inode(inode, C_VATTR | C_PURGE); |
| @@ -134,10 +135,13 @@ exit: | |||
| 134 | } | 135 | } |
| 135 | 136 | ||
| 136 | 137 | ||
| 137 | int coda_permission(struct inode *inode, int mask) | 138 | int coda_permission(struct inode *inode, int mask, unsigned int flags) |
| 138 | { | 139 | { |
| 139 | int error; | 140 | int error; |
| 140 | 141 | ||
| 142 | if (flags & IPERM_FLAG_RCU) | ||
| 143 | return -ECHILD; | ||
| 144 | |||
| 141 | mask &= MAY_READ | MAY_WRITE | MAY_EXEC; | 145 | mask &= MAY_READ | MAY_WRITE | MAY_EXEC; |
| 142 | 146 | ||
| 143 | if (!mask) | 147 | if (!mask) |
| @@ -541,9 +545,13 @@ out: | |||
| 541 | /* called when a cache lookup succeeds */ | 545 | /* called when a cache lookup succeeds */ |
| 542 | static int coda_dentry_revalidate(struct dentry *de, struct nameidata *nd) | 546 | static int coda_dentry_revalidate(struct dentry *de, struct nameidata *nd) |
| 543 | { | 547 | { |
| 544 | struct inode *inode = de->d_inode; | 548 | struct inode *inode; |
| 545 | struct coda_inode_info *cii; | 549 | struct coda_inode_info *cii; |
| 546 | 550 | ||
| 551 | if (nd->flags & LOOKUP_RCU) | ||
| 552 | return -ECHILD; | ||
| 553 | |||
| 554 | inode = de->d_inode; | ||
| 547 | if (!inode || coda_isroot(inode)) | 555 | if (!inode || coda_isroot(inode)) |
| 548 | goto out; | 556 | goto out; |
| 549 | if (is_bad_inode(inode)) | 557 | if (is_bad_inode(inode)) |
| @@ -559,7 +567,7 @@ static int coda_dentry_revalidate(struct dentry *de, struct nameidata *nd) | |||
| 559 | if (cii->c_flags & C_FLUSH) | 567 | if (cii->c_flags & C_FLUSH) |
| 560 | coda_flag_inode_children(inode, C_FLUSH); | 568 | coda_flag_inode_children(inode, C_FLUSH); |
| 561 | 569 | ||
| 562 | if (atomic_read(&de->d_count) > 1) | 570 | if (de->d_count > 1) |
| 563 | /* pretend it's valid, but don't change the flags */ | 571 | /* pretend it's valid, but don't change the flags */ |
| 564 | goto out; | 572 | goto out; |
| 565 | 573 | ||
| @@ -577,7 +585,7 @@ out: | |||
| 577 | * This is the callback from dput() when d_count is going to 0. | 585 | * This is the callback from dput() when d_count is going to 0. |
| 578 | * We use this to unhash dentries with bad inodes. | 586 | * We use this to unhash dentries with bad inodes. |
| 579 | */ | 587 | */ |
| 580 | static int coda_dentry_delete(struct dentry * dentry) | 588 | static int coda_dentry_delete(const struct dentry * dentry) |
| 581 | { | 589 | { |
| 582 | int flags; | 590 | int flags; |
| 583 | 591 | ||
