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

Commit e698b8a4 authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

vfs: document ->d_real()



Add missing documentation for the d_op->d_real() method and d_real()
helper.

Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 2d902671
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,8 @@ prototypes:
	char *(*d_dname)((struct dentry *dentry, char *buffer, int buflen);
	char *(*d_dname)((struct dentry *dentry, char *buffer, int buflen);
	struct vfsmount *(*d_automount)(struct path *path);
	struct vfsmount *(*d_automount)(struct path *path);
	int (*d_manage)(struct dentry *, bool);
	int (*d_manage)(struct dentry *, bool);
	struct dentry *(*d_real)(struct dentry *, const struct inode *,
				 unsigned int);


locking rules:
locking rules:
		rename_lock	->d_lock	may block	rcu-walk
		rename_lock	->d_lock	may block	rcu-walk
@@ -34,6 +36,7 @@ d_iput: no no yes no
d_dname:	no		no		no		no
d_dname:	no		no		no		no
d_automount:	no		no		yes		no
d_automount:	no		no		yes		no
d_manage:	no		no		yes (ref-walk)	maybe
d_manage:	no		no		yes (ref-walk)	maybe
d_real		no		no		yes 		no


--------------------------- inode_operations --------------------------- 
--------------------------- inode_operations --------------------------- 
prototypes:
prototypes:
+20 −0
Original line number Original line Diff line number Diff line
@@ -938,6 +938,8 @@ struct dentry_operations {
	char *(*d_dname)(struct dentry *, char *, int);
	char *(*d_dname)(struct dentry *, char *, int);
	struct vfsmount *(*d_automount)(struct path *);
	struct vfsmount *(*d_automount)(struct path *);
	int (*d_manage)(struct dentry *, bool);
	int (*d_manage)(struct dentry *, bool);
	struct dentry *(*d_real)(struct dentry *, const struct inode *,
				 unsigned int);
};
};


  d_revalidate: called when the VFS needs to revalidate a dentry. This
  d_revalidate: called when the VFS needs to revalidate a dentry. This
@@ -1060,6 +1062,24 @@ struct dentry_operations {
	This function is only used if DCACHE_MANAGE_TRANSIT is set on the
	This function is only used if DCACHE_MANAGE_TRANSIT is set on the
	dentry being transited from.
	dentry being transited from.


  d_real: overlay/union type filesystems implement this method to return one of
	the underlying dentries hidden by the overlay.  It is used in three
	different modes:

	Called from open it may need to copy-up the file depending on the
	supplied open flags.  This mode is selected with a non-zero flags
	argument.  In this mode the d_real method can return an error.

	Called from file_dentry() it returns the real dentry matching the inode
	argument.  The real dentry may be from a lower layer already copied up,
	but still referenced from the file.  This mode is selected with a
	non-NULL inode argument.  This will always succeed.

	With NULL inode and zero flags the topmost real underlying dentry is
	returned.  This will always succeed.

	This method is never called with both non-NULL inode and non-zero flags.

Example :
Example :


static char *pipefs_dname(struct dentry *dent, char *buffer, int buflen)
static char *pipefs_dname(struct dentry *dent, char *buffer, int buflen)
+13 −1
Original line number Original line Diff line number Diff line
@@ -139,7 +139,8 @@ struct dentry_operations {
	char *(*d_dname)(struct dentry *, char *, int);
	char *(*d_dname)(struct dentry *, char *, int);
	struct vfsmount *(*d_automount)(struct path *);
	struct vfsmount *(*d_automount)(struct path *);
	int (*d_manage)(struct dentry *, bool);
	int (*d_manage)(struct dentry *, bool);
	struct dentry *(*d_real)(struct dentry *, const struct inode *, unsigned int);
	struct dentry *(*d_real)(struct dentry *, const struct inode *,
				 unsigned int);
} ____cacheline_aligned;
} ____cacheline_aligned;


/*
/*
@@ -554,6 +555,17 @@ static inline struct dentry *d_backing_dentry(struct dentry *upper)
	return upper;
	return upper;
}
}


/**
 * d_real - Return the real dentry
 * @dentry: the dentry to query
 * @inode: inode to select the dentry from multiple layers (can be NULL)
 * @flags: open flags to control copy-up behavior
 *
 * If dentry is on an union/overlay, then return the underlying, real dentry.
 * Otherwise return the dentry itself.
 *
 * See also: Documentation/filesystems/vfs.txt
 */
static inline struct dentry *d_real(struct dentry *dentry,
static inline struct dentry *d_real(struct dentry *dentry,
				    const struct inode *inode,
				    const struct inode *inode,
				    unsigned int flags)
				    unsigned int flags)