Lines Matching refs:fhp

153 static __be32 nfsd_set_fh_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp)
155 struct knfsd_fh *fh = &fhp->fh_handle;
214 trace_nfsd_set_fh_dentry_badexport(rqstp, fhp, PTR_ERR(exp));
275 trace_nfsd_set_fh_dentry_badhandle(rqstp, fhp,
292 fhp->fh_dentry = dentry;
293 fhp->fh_export = exp;
303 * @fhp: filehandle to be verified
311 * called on @fhp when the caller is finished with the filehandle.
328 fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, int access)
334 dprintk("nfsd: fh_verify(%s)\n", SVCFH_fmt(fhp));
336 if (!fhp->fh_dentry) {
337 error = nfsd_set_fh_dentry(rqstp, fhp);
341 dentry = fhp->fh_dentry;
342 exp = fhp->fh_export;
415 static void _fh_update(struct svc_fh *fhp, struct svc_export *exp,
420 (fhp->fh_handle.fh_fsid + fhp->fh_handle.fh_size/4 - 1);
421 int maxsize = (fhp->fh_maxsize - fhp->fh_handle.fh_size)/4;
424 fhp->fh_handle.fh_fileid_type =
426 fhp->fh_handle.fh_size += maxsize * 4;
428 fhp->fh_handle.fh_fileid_type = FILEID_ROOT;
481 static void set_version_and_fsid_type(struct svc_fh *fhp, struct svc_export *exp, struct svc_fh *ref_fh)
514 if (fhp->fh_maxsize >= 64) {
530 fhp->fh_handle.fh_version = version;
532 fhp->fh_handle.fh_fsid_type = fsid_type;
536 fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry,
560 set_version_and_fsid_type(fhp, exp, ref_fh);
562 if (ref_fh == fhp)
565 if (fhp->fh_locked || fhp->fh_dentry) {
569 if (fhp->fh_maxsize < NFS_FHSIZE)
571 fhp->fh_maxsize,
574 fhp->fh_dentry = dget(dentry); /* our internal copy */
575 fhp->fh_export = exp_get(exp);
577 if (fhp->fh_handle.fh_version == 0xca) {
579 memset(&fhp->fh_handle.fh_base, 0, NFS_FHSIZE);
580 fhp->fh_handle.fh_size = NFS_FHSIZE;
581 fhp->fh_handle.ofh_dcookie = 0xfeebbaca;
582 fhp->fh_handle.ofh_dev = old_encode_dev(ex_dev);
583 fhp->fh_handle.ofh_xdev = fhp->fh_handle.ofh_dev;
584 fhp->fh_handle.ofh_xino =
586 fhp->fh_handle.ofh_dirino = ino_t_to_u32(parent_ino(dentry));
588 _fh_update_old(dentry, exp, &fhp->fh_handle);
590 fhp->fh_handle.fh_size =
591 key_len(fhp->fh_handle.fh_fsid_type) + 4;
592 fhp->fh_handle.fh_auth_type = 0;
594 mk_fsid(fhp->fh_handle.fh_fsid_type,
595 fhp->fh_handle.fh_fsid,
601 _fh_update(fhp, exp, dentry);
602 if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) {
603 fh_put(fhp);
616 fh_update(struct svc_fh *fhp)
620 if (!fhp->fh_dentry)
623 dentry = fhp->fh_dentry;
626 if (fhp->fh_handle.fh_version != 1) {
627 _fh_update_old(dentry, fhp->fh_export, &fhp->fh_handle);
629 if (fhp->fh_handle.fh_fileid_type != FILEID_ROOT)
632 _fh_update(fhp, fhp->fh_export, dentry);
633 if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID)
650 fh_put(struct svc_fh *fhp)
652 struct dentry * dentry = fhp->fh_dentry;
653 struct svc_export * exp = fhp->fh_export;
655 fh_unlock(fhp);
656 fhp->fh_dentry = NULL;
658 fh_clear_wcc(fhp);
660 fh_drop_write(fhp);
663 fhp->fh_export = NULL;
671 char * SVCFH_fmt(struct svc_fh *fhp)
673 struct knfsd_fh *fh = &fhp->fh_handle;
687 enum fsid_source fsid_source(struct svc_fh *fhp)
689 if (fhp->fh_handle.fh_version != 1)
691 switch(fhp->fh_handle.fh_fsid_type) {
695 if (exp_sb(fhp->fh_export)->s_type->fs_flags & FS_REQUIRES_DEV)
699 if (fhp->fh_export->ex_flags & NFSEXP_FSID)
708 if (fhp->fh_export->ex_flags & NFSEXP_FSID)
710 if (fhp->fh_export->ex_uuid)