aboutsummaryrefslogtreecommitdiffstats
path: root/fs/coda/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/coda/dir.c')
-rw-r--r--fs/coda/dir.c20
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 */
49static int coda_dentry_revalidate(struct dentry *de, struct nameidata *nd); 50static int coda_dentry_revalidate(struct dentry *de, struct nameidata *nd);
50static int coda_dentry_delete(struct dentry *); 51static int coda_dentry_delete(const struct dentry *);
51 52
52/* support routines */ 53/* support routines */
53static int coda_venus_readdir(struct file *coda_file, void *buf, 54static 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
127exit: 128exit:
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
137int coda_permission(struct inode *inode, int mask) 138int 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 */
542static int coda_dentry_revalidate(struct dentry *de, struct nameidata *nd) 546static 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 */
580static int coda_dentry_delete(struct dentry * dentry) 588static int coda_dentry_delete(const struct dentry * dentry)
581{ 589{
582 int flags; 590 int flags;
583 591