Lines Matching refs:dentry
24 static int get_name(const struct path *path, char *name, struct dentry *child);
27 static int exportfs_get_name(struct vfsmount *mnt, struct dentry *dir, in exportfs_get_name()
28 char *name, struct dentry *child) in exportfs_get_name()
31 struct path path = {.mnt = mnt, .dentry = dir}; in exportfs_get_name()
42 static struct dentry *
43 find_acceptable_alias(struct dentry *result, in find_acceptable_alias()
44 int (*acceptable)(void *context, struct dentry *dentry), in find_acceptable_alias() argument
47 struct dentry *dentry, *toput = NULL; in find_acceptable_alias() local
55 hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { in find_acceptable_alias()
56 dget(dentry); in find_acceptable_alias()
60 if (dentry != result && acceptable(context, dentry)) { in find_acceptable_alias()
62 return dentry; in find_acceptable_alias()
65 toput = dentry; in find_acceptable_alias()
74 static bool dentry_connected(struct dentry *dentry) in dentry_connected() argument
76 dget(dentry); in dentry_connected()
77 while (dentry->d_flags & DCACHE_DISCONNECTED) { in dentry_connected()
78 struct dentry *parent = dget_parent(dentry); in dentry_connected()
80 dput(dentry); in dentry_connected()
81 if (dentry == parent) { in dentry_connected()
85 dentry = parent; in dentry_connected()
87 dput(dentry); in dentry_connected()
91 static void clear_disconnected(struct dentry *dentry) in clear_disconnected() argument
93 dget(dentry); in clear_disconnected()
94 while (dentry->d_flags & DCACHE_DISCONNECTED) { in clear_disconnected()
95 struct dentry *parent = dget_parent(dentry); in clear_disconnected()
97 WARN_ON_ONCE(IS_ROOT(dentry)); in clear_disconnected()
99 spin_lock(&dentry->d_lock); in clear_disconnected()
100 dentry->d_flags &= ~DCACHE_DISCONNECTED; in clear_disconnected()
101 spin_unlock(&dentry->d_lock); in clear_disconnected()
103 dput(dentry); in clear_disconnected()
104 dentry = parent; in clear_disconnected()
106 dput(dentry); in clear_disconnected()
121 static struct dentry *reconnect_one(struct vfsmount *mnt, in reconnect_one()
122 struct dentry *dentry, char *nbuf) in reconnect_one() argument
124 struct dentry *parent; in reconnect_one()
125 struct dentry *tmp; in reconnect_one()
129 inode_lock(dentry->d_inode); in reconnect_one()
131 parent = mnt->mnt_sb->s_export_op->get_parent(dentry); in reconnect_one()
132 inode_unlock(dentry->d_inode); in reconnect_one()
136 dentry->d_inode->i_ino, PTR_ERR(parent)); in reconnect_one()
141 dentry->d_inode->i_ino, parent->d_inode->i_ino); in reconnect_one()
142 err = exportfs_get_name(mnt, parent, nbuf, dentry); in reconnect_one()
154 if (tmp != dentry) { in reconnect_one()
165 if (IS_ROOT(dentry)) { in reconnect_one()
189 if (!dentry_connected(dentry)) in reconnect_one()
212 reconnect_path(struct vfsmount *mnt, struct dentry *target_dir, char *nbuf) in reconnect_path()
214 struct dentry *dentry, *parent; in reconnect_path() local
216 dentry = dget(target_dir); in reconnect_path()
218 while (dentry->d_flags & DCACHE_DISCONNECTED) { in reconnect_path()
219 BUG_ON(dentry == mnt->mnt_sb->s_root); in reconnect_path()
221 if (IS_ROOT(dentry)) in reconnect_path()
222 parent = reconnect_one(mnt, dentry, nbuf); in reconnect_path()
224 parent = dget_parent(dentry); in reconnect_path()
228 dput(dentry); in reconnect_path()
231 dentry = parent; in reconnect_path()
233 dput(dentry); in reconnect_path()
276 static int get_name(const struct path *path, char *name, struct dentry *child) in get_name()
279 struct inode *dir = path->dentry->d_inode; in get_name()
285 .dentry = child, in get_name()
422 int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len, in exportfs_encode_fh() argument
426 struct dentry *p = NULL; in exportfs_encode_fh()
427 struct inode *inode = dentry->d_inode, *parent = NULL; in exportfs_encode_fh()
430 p = dget_parent(dentry); in exportfs_encode_fh()
445 struct dentry *
448 int (*acceptable)(void *, struct dentry *), in exportfs_decode_fh_raw() argument
452 struct dentry *result, *alias; in exportfs_decode_fh_raw()
499 struct dentry *target_dir, *nresult; in exportfs_decode_fh_raw()
594 struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid, in exportfs_decode_fh()
596 int (*acceptable)(void *, struct dentry *), in exportfs_decode_fh() argument
599 struct dentry *ret; in exportfs_decode_fh()