[pnfs] [PATCH] add back fsid for export op cb_layout_recall
Benny Halevy
bhalevy at panasas.com
Mon Jun 4 13:51:47 EDT 2007
Marc, I understand you need a way to recall by fsid with passing
an inode to nfsd_layout_recall_cb. Can we please retain the two methods
so that if an inode is passed in for RECALL_FSID we get the fsid from it?
Benny
Marc Eshel wrote:
> From: Marc Eshel <eshel at almaden.ibm.com>
>
>
> ---
>
> fs/nfsd/nfs4callback.c | 2 +-
> fs/nfsd/nfs4state.c | 6 +++---
> include/linux/nfsd/nfsd4_pnfs.h | 1 +
> include/linux/nfsd/state.h | 1 +
> 4 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> index 2e8e46e..7834be6 100644
> --- a/fs/nfsd/nfs4callback.c
> +++ b/fs/nfsd/nfs4callback.c
> @@ -322,7 +322,7 @@ encode_cb_layout(struct xdr_stream *xdr,
> WRITE32(clr->cb.cbl_layoutchanged);
> WRITE32(clr->cb.cbl_recall_type);
> if (unlikely(clr->cb.cbl_recall_type == RECALL_FSID)) {
> - struct nfs4_fsid fsid = clr->clr_file->fi_fsid;
> + struct nfs4_fsid fsid = clr->cb.cbl_fsid;
> WRITE64(fsid.major);
> WRITE64(fsid.minor);
> dprintk("%s: type %d iomode %d changed %d recall_type %d fsid 0x%llx-0x%llx\n",
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index c354a58..53212f1 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -4358,7 +4358,7 @@ recall_return_partial_match(struct nfs4_
> /* fsid matches? */
> if (clr->cb.cbl_recall_type == RECALL_FSID ||
> lrp->lr_return_type == RETURN_FSID)
> - return same_fsid(&clr->clr_file->fi_fsid, current_fh);
> + return same_fsid(&clr->cb.cbl_fsid, current_fh);
>
> /* file matches, range overlapping? */
> return clr->clr_file == fp &&
> @@ -4501,7 +4501,7 @@ cl_has_fsid_layout(struct nfs4_client *c
>
> /* note: minor version unused */
> list_for_each_entry(lp, &clp->cl_layouts, lo_perclnt)
> - if (lp->lo_file->fi_fsid.major == clr->clr_file->fi_fsid.major)
> + if (lp->lo_file->fi_fsid.major == clr->cb.cbl_fsid.major)
> return 1;
>
> return 0;
> @@ -4620,7 +4620,7 @@ int nfsd_layout_recall_cb(struct inode *
> BUG_ON(cbl->cbl_recall_type != RECALL_FILE &&
> cbl->cbl_recall_type != RECALL_FSID &&
> cbl->cbl_recall_type != RECALL_ALL);
> - BUG_ON(cbl->cbl_recall_type != RECALL_ALL && !inode);
> + BUG_ON(cbl->cbl_recall_type == RECALL_FILE && !inode);
>
> clr = alloc_init_layoutrecall(NULL);
> if (!clr)
> diff --git a/include/linux/nfsd/nfsd4_pnfs.h b/include/linux/nfsd/nfsd4_pnfs.h
> index fe2f375..e051916 100644
> --- a/include/linux/nfsd/nfsd4_pnfs.h
> +++ b/include/linux/nfsd/nfsd4_pnfs.h
> @@ -118,6 +118,7 @@ struct nfsd4_pnfs_cb_layout {
> u32 cbl_recall_type; /* request */
> struct nfsd4_layout_seg cbl_seg; /* request */
> u32 cbl_layoutchanged; /* request */
> + struct nfs4_fsid cbl_fsid;
> };
>
> #endif /* _LINUX_NFSD_NFSD4_PNFS_H */
> diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
> index 7ed3863..953c1d2 100644
> --- a/include/linux/nfsd/state.h
> +++ b/include/linux/nfsd/state.h
> @@ -269,6 +269,7 @@ struct nfs4_layoutrecall {
> struct nfs4_file *clr_file;
> int clr_status;
> struct timespec clr_time; /* last activity */
> + struct nfs4_fsid cbr_fsid;
> };
>
> #endif /* CONFIG_PNFS */
> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
More information about the pNFS
mailing list