Lines Matching defs:fhp

135 static __be32 nfsd_set_fh_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp)
137 struct knfsd_fh *fh = &fhp->fh_handle;
268 fhp->fh_dentry = dentry;
269 fhp->fh_export = exp;
279 * @fhp: filehandle to be verified
287 * called on @fhp when the caller is finished with the filehandle.
304 fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, int access)
310 dprintk("nfsd: fh_verify(%s)\n", SVCFH_fmt(fhp));
312 if (!fhp->fh_dentry) {
313 error = nfsd_set_fh_dentry(rqstp, fhp);
317 dentry = fhp->fh_dentry;
318 exp = fhp->fh_export;
391 static void _fh_update(struct svc_fh *fhp, struct svc_export *exp,
396 (fhp->fh_handle.fh_fsid + fhp->fh_handle.fh_size/4 - 1);
397 int maxsize = (fhp->fh_maxsize - fhp->fh_handle.fh_size)/4;
400 fhp->fh_handle.fh_fileid_type =
402 fhp->fh_handle.fh_size += maxsize * 4;
404 fhp->fh_handle.fh_fileid_type = FILEID_ROOT;
457 static void set_version_and_fsid_type(struct svc_fh *fhp, struct svc_export *exp, struct svc_fh *ref_fh)
490 if (fhp->fh_maxsize >= 64) {
506 fhp->fh_handle.fh_version = version;
508 fhp->fh_handle.fh_fsid_type = fsid_type;
512 fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry,
536 set_version_and_fsid_type(fhp, exp, ref_fh);
538 if (ref_fh == fhp)
541 if (fhp->fh_locked || fhp->fh_dentry) {
545 if (fhp->fh_maxsize < NFS_FHSIZE)
547 fhp->fh_maxsize,
550 fhp->fh_dentry = dget(dentry); /* our internal copy */
551 fhp->fh_export = exp_get(exp);
553 if (fhp->fh_handle.fh_version == 0xca) {
555 memset(&fhp->fh_handle.fh_base, 0, NFS_FHSIZE);
556 fhp->fh_handle.fh_size = NFS_FHSIZE;
557 fhp->fh_handle.ofh_dcookie = 0xfeebbaca;
558 fhp->fh_handle.ofh_dev = old_encode_dev(ex_dev);
559 fhp->fh_handle.ofh_xdev = fhp->fh_handle.ofh_dev;
560 fhp->fh_handle.ofh_xino =
562 fhp->fh_handle.ofh_dirino = ino_t_to_u32(parent_ino(dentry));
564 _fh_update_old(dentry, exp, &fhp->fh_handle);
566 fhp->fh_handle.fh_size =
567 key_len(fhp->fh_handle.fh_fsid_type) + 4;
568 fhp->fh_handle.fh_auth_type = 0;
570 mk_fsid(fhp->fh_handle.fh_fsid_type,
571 fhp->fh_handle.fh_fsid,
577 _fh_update(fhp, exp, dentry);
578 if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) {
579 fh_put(fhp);
592 fh_update(struct svc_fh *fhp)
596 if (!fhp->fh_dentry)
599 dentry = fhp->fh_dentry;
602 if (fhp->fh_handle.fh_version != 1) {
603 _fh_update_old(dentry, fhp->fh_export, &fhp->fh_handle);
605 if (fhp->fh_handle.fh_fileid_type != FILEID_ROOT)
608 _fh_update(fhp, fhp->fh_export, dentry);
609 if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID)
626 fh_put(struct svc_fh *fhp)
628 struct dentry * dentry = fhp->fh_dentry;
629 struct svc_export * exp = fhp->fh_export;
631 fh_unlock(fhp);
632 fhp->fh_dentry = NULL;
635 fhp->fh_pre_saved = 0;
636 fhp->fh_post_saved = 0;
639 fh_drop_write(fhp);
642 fhp->fh_export = NULL;
650 char * SVCFH_fmt(struct svc_fh *fhp)
652 struct knfsd_fh *fh = &fhp->fh_handle;
666 enum fsid_source fsid_source(struct svc_fh *fhp)
668 if (fhp->fh_handle.fh_version != 1)
670 switch(fhp->fh_handle.fh_fsid_type) {
674 if (exp_sb(fhp->fh_export)->s_type->fs_flags & FS_REQUIRES_DEV)
678 if (fhp->fh_export->ex_flags & NFSEXP_FSID)
687 if (fhp->fh_export->ex_flags & NFSEXP_FSID)
689 if (fhp->fh_export->ex_uuid)