Lines Matching refs:fhp

240 nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp,
249 dprintk("nfsd: nfsd_lookup(fh %s, %.*s)\n", SVCFH_fmt(fhp), len,name);
251 dparent = fhp->fh_dentry;
252 exp = exp_get(fhp->fh_export);
294 * @fhp: the file handle of the directory
300 * N.B. After this call _both_ fhp and resfh need an fh_put
311 nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
318 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_EXEC);
321 err = nfsd_lookup_dentry(rqstp, fhp, name, len, &exp, &dentry);
331 err = fh_compose(resfh, exp, dentry, fhp);
354 commit_metadata(struct svc_fh *fhp)
356 struct inode *inode = d_inode(fhp->fh_dentry);
358 if (!EX_ISSYNC(fhp->fh_export))
399 nfsd_get_write_access(struct svc_rqst *rqstp, struct svc_fh *fhp,
402 struct inode *inode = d_inode(fhp->fh_dentry);
407 err = nfsd_permission(rqstp, fhp->fh_export, fhp->fh_dentry,
459 * @fhp: filehandle of target
468 * returned. Caller must release @fhp by calling fh_put in either
472 nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
506 get_write_count = !fhp->fh_dentry;
509 err = fh_verify(rqstp, fhp, ftype, accmode);
513 host_err = fh_want_write(fhp);
518 dentry = fhp->fh_dentry;
534 err = nfsd_get_write_access(rqstp, fhp, iap);
572 host_err = commit_metadata(fhp);
681 __be32 nfsd4_vfs_fallocate(struct svc_rqst *rqstp, struct svc_fh *fhp,
692 error = commit_metadata(fhp);
753 nfsd_access(struct svc_rqst *rqstp, struct svc_fh *fhp, u32 *access, u32 *supported)
761 error = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP);
765 export = fhp->fh_export;
766 dentry = fhp->fh_dentry;
824 * N.B. After this call fhp needs an fh_put
827 __nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
836 path.mnt = fhp->fh_export->ex_path.mnt;
837 path.dentry = fhp->fh_dentry;
880 nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
901 err = fh_verify(rqstp, fhp, type, may_flags);
903 host_err = __nfsd_open(rqstp, fhp, type, may_flags, filp);
906 fh_put(fhp);
917 * @fhp: NFS filehandle of the file to open
924 nfsd_open_verified(struct svc_rqst *rqstp, struct svc_fh *fhp, int may_flags,
927 return __nfsd_open(rqstp, fhp, S_IFREG, may_flags, filp);
983 static __be32 nfsd_finish_read(struct svc_rqst *rqstp, struct svc_fh *fhp,
988 nfsd_stats_io_read_add(fhp->fh_export, host_err);
992 trace_nfsd_read_io_done(rqstp, fhp, offset, *count);
995 trace_nfsd_read_err(rqstp, fhp, offset, host_err);
1003 * @fhp: file handle of file to be read
1012 __be32 nfsd_splice_read(struct svc_rqst *rqstp, struct svc_fh *fhp,
1024 trace_nfsd_read_splice(rqstp, fhp, offset, *count);
1026 return nfsd_finish_read(rqstp, fhp, file, offset, count, eof, host_err);
1032 * @fhp: file handle of file to be read
1045 __be32 nfsd_iter_read(struct svc_rqst *rqstp, struct svc_fh *fhp,
1067 trace_nfsd_read_vector(rqstp, fhp, offset, *count);
1070 return nfsd_finish_read(rqstp, fhp, file, offset, count, eof, host_err);
1111 nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,
1131 trace_nfsd_write_opened(rqstp, fhp, offset, *cnt);
1149 exp = fhp->fh_export;
1187 trace_nfsd_write_io_done(rqstp, fhp, offset, *cnt);
1190 trace_nfsd_write_err(rqstp, fhp, offset, host_err);
1201 * @fhp: file handle of file to be read
1209 * N.B. After this call fhp needs an fh_put
1214 __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp,
1221 trace_nfsd_read_start(rqstp, fhp, offset, *count);
1222 err = nfsd_file_acquire_gc(rqstp, fhp, NFSD_MAY_READ, &nf);
1228 err = nfsd_splice_read(rqstp, fhp, file, offset, count, eof);
1230 err = nfsd_iter_read(rqstp, fhp, file, offset, count, 0, eof);
1233 trace_nfsd_read_done(rqstp, fhp, offset, *count);
1240 * N.B. After this call fhp needs an fh_put
1243 nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
1250 trace_nfsd_write_start(rqstp, fhp, offset, *cnt);
1252 err = nfsd_file_acquire_gc(rqstp, fhp, NFSD_MAY_WRITE, &nf);
1256 err = nfsd_vfs_write(rqstp, fhp, nf, offset, vec,
1260 trace_nfsd_write_done(rqstp, fhp, offset, *cnt);
1267 * @fhp: NFS filehandle
1285 nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,
1301 maxbytes = (u64)fhp->fh_dentry->d_sb->s_maxbytes;
1309 if (EX_ISSYNC(fhp->fh_export)) {
1338 * @fhp: NFS filehandle of parent directory
1345 nfsd_create_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
1379 status = nfserrno(commit_metadata(fhp));
1407 nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp,
1417 dentry = fhp->fh_dentry;
1421 err = nfsd_permission(rqstp, fhp->fh_export, dentry, NFSD_MAY_CREATE);
1480 err = nfsd_create_setattr(rqstp, fhp, resfhp, attrs);
1495 * N.B. Every call to nfsd_create needs an fh_put for _both_ fhp and resfhp
1498 nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
1509 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_NOP);
1513 dentry = fhp->fh_dentry;
1515 host_err = fh_want_write(fhp);
1526 err = fh_compose(resfhp, fhp->fh_export, dchild, fhp);
1534 err = fh_fill_pre_attrs(fhp);
1537 err = nfsd_create_locked(rqstp, fhp, attrs, type, rdev, resfhp);
1538 fh_fill_post_attrs(fhp);
1547 * N.B. After this call fhp needs an fh_put
1550 nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp)
1558 err = fh_verify(rqstp, fhp, S_IFLNK, NFSD_MAY_NOP);
1562 path.mnt = fhp->fh_export->ex_path.mnt;
1563 path.dentry = fhp->fh_dentry;
1585 * @fhp: NFS filehandle of parent directory
1592 * N.B. After this call _both_ fhp and resfhp need an fh_put
1597 nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
1613 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_CREATE);
1617 host_err = fh_want_write(fhp);
1623 dentry = fhp->fh_dentry;
1631 err = fh_fill_pre_attrs(fhp);
1636 cerr = fh_compose(resfhp, fhp->fh_export, dnew, fhp);
1638 nfsd_create_setattr(rqstp, fhp, resfhp, attrs);
1639 fh_fill_post_attrs(fhp);
1643 err = nfserrno(commit_metadata(fhp));
1647 fh_drop_write(fhp);
1884 * N.B. After this call fhp needs an fh_put
1887 nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
1899 err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_REMOVE);
1903 host_err = fh_want_write(fhp);
1907 dentry = fhp->fh_dentry;
1922 err = fh_fill_pre_attrs(fhp);
1946 fh_fill_post_attrs(fhp);
1950 host_err = commit_metadata(fhp);
1955 fh_drop_write(fhp);
2022 static __be32 nfsd_buffered_readdir(struct file *file, struct svc_fh *fhp,
2070 trace_nfsd_dirent(fhp, de->ino, de->name, de->namlen);
2097 nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp,
2109 err = nfsd_open(rqstp, fhp, S_IFDIR, may_flags, &file);
2119 err = nfsd_buffered_readdir(file, fhp, func, cdp, offsetp);
2131 * N.B. After this call fhp needs an fh_put
2134 nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat, int access)
2138 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP | access);
2141 .mnt = fhp->fh_export->ex_path.mnt,
2142 .dentry = fhp->fh_dentry,
2197 nfsd_getxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char *name,
2206 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_READ);
2211 dentry = fhp->fh_dentry;
2270 nfsd_listxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char **bufp,
2279 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_READ);
2283 dentry = fhp->fh_dentry;
2326 * @fhp: NFS filehandle of object with xattr to remove
2335 nfsd_removexattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char *name)
2340 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_WRITE);
2344 ret = fh_want_write(fhp);
2348 inode_lock(fhp->fh_dentry->d_inode);
2349 err = fh_fill_pre_attrs(fhp);
2352 ret = __vfs_removexattr_locked(&nop_mnt_idmap, fhp->fh_dentry,
2355 fh_fill_post_attrs(fhp);
2357 inode_unlock(fhp->fh_dentry->d_inode);
2358 fh_drop_write(fhp);
2364 nfsd_setxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char *name,
2370 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_WRITE);
2374 ret = fh_want_write(fhp);
2377 inode_lock(fhp->fh_dentry->d_inode);
2378 err = fh_fill_pre_attrs(fhp);
2381 ret = __vfs_setxattr_locked(&nop_mnt_idmap, fhp->fh_dentry,
2383 fh_fill_post_attrs(fhp);
2386 inode_unlock(fhp->fh_dentry->d_inode);
2387 fh_drop_write(fhp);