Lines Matching defs:fid

19 #include "fid.h"
21 static inline void __add_fid(struct dentry *dentry, struct p9_fid *fid)
23 hlist_add_head(&fid->dlist, (struct hlist_head *)&dentry->d_fsdata);
28 * v9fs_fid_add - add a fid to a dentry
29 * @dentry: dentry that the fid is being added to
30 * @pfid: fid to add, NULLed out
35 struct p9_fid *fid = *pfid;
38 __add_fid(dentry, fid);
53 * v9fs_fid_find_inode - search for an open fid off of the inode list
54 * @inode: return a fid pointing to a specific inode
56 * @uid: return a fid belonging to the specified user
64 struct p9_fid *fid, *ret = NULL;
70 hlist_for_each_entry(fid, h, ilist) {
71 if (any || uid_eq(fid->uid, uid)) {
72 if (want_writeable && !v9fs_is_writeable(fid->mode)) {
74 fid->mode);
77 p9_fid_get(fid);
78 ret = fid;
87 * v9fs_open_fid_add - add an open fid to an inode
88 * @inode: inode that the fid is being added to
89 * @pfid: fid to add, NULLed out
95 struct p9_fid *fid = *pfid;
98 hlist_add_head(&fid->ilist, (struct hlist_head *)&inode->i_private);
106 * v9fs_fid_find - retrieve a fid that belongs to the specified uid
107 * @dentry: dentry to look for fid in
108 * @uid: return fid that belongs to the specified user
109 * @any: if non-zero, return any fid associated with the dentry
115 struct p9_fid *fid, *ret;
126 hlist_for_each_entry(fid, h, dlist) {
127 if (any || uid_eq(fid->uid, uid)) {
128 ret = fid;
177 struct p9_fid *fid, *root_fid, *old_fid;
181 fid = v9fs_fid_find(dentry, uid, any);
182 if (fid)
183 return fid;
185 * we don't have a matching fid. To do a TWALK we need
186 * parent fid. We need to prevent rename when we want to
191 fid = v9fs_fid_find(ds, uid, any);
192 if (fid) {
193 /* Found the parent fid do a lookup with that */
194 old_fid = fid;
196 fid = p9_client_walk(old_fid, 1, &dentry->d_name.name, 1);
214 fid = p9_client_attach(v9ses->clnt, NULL, uname, uid,
216 if (IS_ERR(fid))
217 return fid;
219 root_fid = p9_fid_get(fid);
220 v9fs_fid_add(dentry->d_sb->s_root, &fid);
234 fid = ERR_PTR(n);
237 fid = root_fid;
246 fid = p9_client_walk(old_fid, l, &wnames[i],
248 /* non-cloning walk will return the same fid */
249 if (fid != old_fid) {
251 old_fid = fid;
253 if (IS_ERR(fid)) {
261 if (!IS_ERR(fid)) {
265 p9_fid_put(fid);
266 fid = ERR_PTR(-ENOENT);
268 __add_fid(dentry, fid);
269 p9_fid_get(fid);
275 return fid;
279 * v9fs_fid_lookup - lookup for a fid, try to walk if not found
280 * @dentry: dentry to look for fid in
282 * Look for a fid in the specified dentry for the current user.
283 * If no fid is found, try to create one walking from a fid from the parent