Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b728e19 authored by Al Viro's avatar Al Viro
Browse files

stop passing nameidata * to ->d_revalidate()



Just the lookup flags.  Die, bastard, die...

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent fa3c56bb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ be able to use diff(1).

--------------------------- dentry_operations --------------------------
prototypes:
	int (*d_revalidate)(struct dentry *, struct nameidata *);
	int (*d_revalidate)(struct dentry *, unsigned int);
	int (*d_hash)(const struct dentry *, const struct inode *,
			struct qstr *);
	int (*d_compare)(const struct dentry *, const struct inode *,
+5 −0
Original line number Diff line number Diff line
@@ -431,3 +431,8 @@ release it yourself.
	d_alloc_root() is gone, along with a lot of bugs caused by code
misusing it.  Replacement: d_make_root(inode).  The difference is,
d_make_root() drops the reference to inode if dentry allocation fails.  

--
[mandatory]
	The witch is dead!  Well, 1/3 of it, anyway.  ->d_revalidate() does *not*
take struct nameidata anymore; just the flags.
+4 −4
Original line number Diff line number Diff line
@@ -902,7 +902,7 @@ the VFS uses a default. As of kernel 2.6.22, the following members are
defined:

struct dentry_operations {
	int (*d_revalidate)(struct dentry *, struct nameidata *);
	int (*d_revalidate)(struct dentry *, unsigned int);
	int (*d_hash)(const struct dentry *, const struct inode *,
			struct qstr *);
	int (*d_compare)(const struct dentry *, const struct inode *,
@@ -921,11 +921,11 @@ struct dentry_operations {
	dcache. Most filesystems leave this as NULL, because all their
	dentries in the dcache are valid

	d_revalidate may be called in rcu-walk mode (nd->flags & LOOKUP_RCU).
	d_revalidate may be called in rcu-walk mode (flags & LOOKUP_RCU).
	If in rcu-walk mode, the filesystem must revalidate the dentry without
	blocking or storing to the dentry, d_parent and d_inode should not be
	used without care (because they can go NULL), instead nd->inode should
	be used.
	used without care (because they can change and, in d_inode case, even
	become NULL under us).

	If a situation is encountered that rcu-walk cannot handle, return
	-ECHILD and it will be called again in ref-walk mode.
+2 −2
Original line number Diff line number Diff line
@@ -100,13 +100,13 @@ static void v9fs_dentry_release(struct dentry *dentry)
	}
}

static int v9fs_lookup_revalidate(struct dentry *dentry, struct nameidata *nd)
static int v9fs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
{
	struct p9_fid *fid;
	struct inode *inode;
	struct v9fs_inode *v9inode;

	if (nd->flags & LOOKUP_RCU)
	if (flags & LOOKUP_RCU)
		return -ECHILD;

	inode = dentry->d_inode;
+3 −3
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
				 struct nameidata *nd);
static int afs_dir_open(struct inode *inode, struct file *file);
static int afs_readdir(struct file *file, void *dirent, filldir_t filldir);
static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd);
static int afs_d_revalidate(struct dentry *dentry, unsigned int flags);
static int afs_d_delete(const struct dentry *dentry);
static void afs_d_release(struct dentry *dentry);
static int afs_lookup_filldir(void *_cookie, const char *name, int nlen,
@@ -598,7 +598,7 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
 * - NOTE! the hit can be a negative hit too, so we can't assume we have an
 *   inode
 */
static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
{
	struct afs_vnode *vnode, *dir;
	struct afs_fid uninitialized_var(fid);
@@ -607,7 +607,7 @@ static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
	void *dir_version;
	int ret;

	if (nd->flags & LOOKUP_RCU)
	if (flags & LOOKUP_RCU)
		return -ECHILD;

	vnode = AFS_FS_I(dentry->d_inode);
Loading