Lines Matching refs:fhp
135 static __be32 nfsd_set_fh_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp) in nfsd_set_fh_dentry() argument
137 struct knfsd_fh *fh = &fhp->fh_handle; in nfsd_set_fh_dentry()
268 fhp->fh_dentry = dentry; in nfsd_set_fh_dentry()
269 fhp->fh_export = exp; in nfsd_set_fh_dentry()
304 fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, int access) in fh_verify() argument
310 dprintk("nfsd: fh_verify(%s)\n", SVCFH_fmt(fhp)); in fh_verify()
312 if (!fhp->fh_dentry) { in fh_verify()
313 error = nfsd_set_fh_dentry(rqstp, fhp); in fh_verify()
317 dentry = fhp->fh_dentry; in fh_verify()
318 exp = fhp->fh_export; in fh_verify()
391 static void _fh_update(struct svc_fh *fhp, struct svc_export *exp, in _fh_update() argument
396 (fhp->fh_handle.fh_fsid + fhp->fh_handle.fh_size/4 - 1); in _fh_update()
397 int maxsize = (fhp->fh_maxsize - fhp->fh_handle.fh_size)/4; in _fh_update()
400 fhp->fh_handle.fh_fileid_type = in _fh_update()
402 fhp->fh_handle.fh_size += maxsize * 4; in _fh_update()
404 fhp->fh_handle.fh_fileid_type = FILEID_ROOT; in _fh_update()
457 static void set_version_and_fsid_type(struct svc_fh *fhp, struct svc_export *exp, struct svc_fh *re… in set_version_and_fsid_type() argument
490 if (fhp->fh_maxsize >= 64) { in set_version_and_fsid_type()
506 fhp->fh_handle.fh_version = version; in set_version_and_fsid_type()
508 fhp->fh_handle.fh_fsid_type = fsid_type; in set_version_and_fsid_type()
512 fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, in fh_compose() argument
536 set_version_and_fsid_type(fhp, exp, ref_fh); in fh_compose()
538 if (ref_fh == fhp) in fh_compose()
541 if (fhp->fh_locked || fhp->fh_dentry) { in fh_compose()
545 if (fhp->fh_maxsize < NFS_FHSIZE) in fh_compose()
547 fhp->fh_maxsize, in fh_compose()
550 fhp->fh_dentry = dget(dentry); /* our internal copy */ in fh_compose()
551 fhp->fh_export = exp_get(exp); in fh_compose()
553 if (fhp->fh_handle.fh_version == 0xca) { in fh_compose()
555 memset(&fhp->fh_handle.fh_base, 0, NFS_FHSIZE); in fh_compose()
556 fhp->fh_handle.fh_size = NFS_FHSIZE; in fh_compose()
557 fhp->fh_handle.ofh_dcookie = 0xfeebbaca; in fh_compose()
558 fhp->fh_handle.ofh_dev = old_encode_dev(ex_dev); in fh_compose()
559 fhp->fh_handle.ofh_xdev = fhp->fh_handle.ofh_dev; in fh_compose()
560 fhp->fh_handle.ofh_xino = in fh_compose()
562 fhp->fh_handle.ofh_dirino = ino_t_to_u32(parent_ino(dentry)); in fh_compose()
564 _fh_update_old(dentry, exp, &fhp->fh_handle); in fh_compose()
566 fhp->fh_handle.fh_size = in fh_compose()
567 key_len(fhp->fh_handle.fh_fsid_type) + 4; in fh_compose()
568 fhp->fh_handle.fh_auth_type = 0; in fh_compose()
570 mk_fsid(fhp->fh_handle.fh_fsid_type, in fh_compose()
571 fhp->fh_handle.fh_fsid, in fh_compose()
577 _fh_update(fhp, exp, dentry); in fh_compose()
578 if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) { in fh_compose()
579 fh_put(fhp); in fh_compose()
592 fh_update(struct svc_fh *fhp) in fh_update() argument
596 if (!fhp->fh_dentry) in fh_update()
599 dentry = fhp->fh_dentry; in fh_update()
602 if (fhp->fh_handle.fh_version != 1) { in fh_update()
603 _fh_update_old(dentry, fhp->fh_export, &fhp->fh_handle); in fh_update()
605 if (fhp->fh_handle.fh_fileid_type != FILEID_ROOT) in fh_update()
608 _fh_update(fhp, fhp->fh_export, dentry); in fh_update()
609 if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) in fh_update()
626 fh_put(struct svc_fh *fhp) in fh_put() argument
628 struct dentry * dentry = fhp->fh_dentry; in fh_put()
629 struct svc_export * exp = fhp->fh_export; in fh_put()
631 fh_unlock(fhp); in fh_put()
632 fhp->fh_dentry = NULL; in fh_put()
634 fh_clear_wcc(fhp); in fh_put()
636 fh_drop_write(fhp); in fh_put()
639 fhp->fh_export = NULL; in fh_put()
647 char * SVCFH_fmt(struct svc_fh *fhp) in SVCFH_fmt() argument
649 struct knfsd_fh *fh = &fhp->fh_handle; in SVCFH_fmt()
663 enum fsid_source fsid_source(struct svc_fh *fhp) in fsid_source() argument
665 if (fhp->fh_handle.fh_version != 1) in fsid_source()
667 switch(fhp->fh_handle.fh_fsid_type) { in fsid_source()
671 if (exp_sb(fhp->fh_export)->s_type->fs_flags & FS_REQUIRES_DEV) in fsid_source()
675 if (fhp->fh_export->ex_flags & NFSEXP_FSID) in fsid_source()
684 if (fhp->fh_export->ex_flags & NFSEXP_FSID) in fsid_source()
686 if (fhp->fh_export->ex_uuid) in fsid_source()