Lines Matching refs:fid

20 #include "fid.h"
23 * v9fs_fid_add - add a fid to a dentry
24 * @dentry: dentry that the fid is being added to
25 * @fid: fid to add
29 static inline void __add_fid(struct dentry *dentry, struct p9_fid *fid)
31 hlist_add_head(&fid->dlist, (struct hlist_head *)&dentry->d_fsdata);
34 void v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)
37 __add_fid(dentry, fid);
42 * v9fs_fid_find - retrieve a fid that belongs to the specified uid
43 * @dentry: dentry to look for fid in
44 * @uid: return fid that belongs to the specified user
45 * @any: if non-zero, return any fid associated with the dentry
51 struct p9_fid *fid, *ret;
61 hlist_for_each_entry(fid, h, dlist) {
62 if (any || uid_eq(fid->uid, uid)) {
63 ret = fid;
108 struct p9_fid *fid, *old_fid = NULL;
112 fid = v9fs_fid_find(dentry, uid, any);
113 if (fid)
114 return fid;
116 * we don't have a matching fid. To do a TWALK we need
117 * parent fid. We need to prevent rename when we want to
122 fid = v9fs_fid_find(ds, uid, any);
123 if (fid) {
124 /* Found the parent fid do a lookup with that */
125 fid = p9_client_walk(fid, 1, &dentry->d_name.name, 1);
131 fid = v9fs_fid_find(dentry->d_sb->s_root, uid, any);
132 if (!fid) {
142 fid = p9_client_attach(v9ses->clnt, NULL, uname, uid,
144 if (IS_ERR(fid))
145 return fid;
147 v9fs_fid_add(dentry->d_sb->s_root, fid);
151 return fid;
160 fid = ERR_PTR(n);
171 fid = p9_client_walk(fid, l, &wnames[i], clone);
172 if (IS_ERR(fid)) {
175 * If we fail, clunk fid which are mapping
184 old_fid = fid;
190 if (!IS_ERR(fid)) {
194 p9_client_clunk(fid);
195 fid = ERR_PTR(-ENOENT);
197 __add_fid(dentry, fid);
203 return fid;
207 * v9fs_fid_lookup - lookup for a fid, try to walk if not found
208 * @dentry: dentry to look for fid in
210 * Look for a fid in the specified dentry for the current user.
211 * If no fid is found, try to create one walking from a fid from the parent
248 struct p9_fid *fid;
250 fid = clone_fid(v9fs_fid_lookup_with_uid(dentry, GLOBAL_ROOT_UID, 0));
251 if (IS_ERR(fid))
254 * writeback fid will only be used to write back the
255 * dirty pages. We always request for the open fid in read-write
259 err = p9_client_open(fid, O_RDWR);
261 p9_client_clunk(fid);
262 fid = ERR_PTR(err);
266 return fid;