Loading fs/nfs/nfs42proc.c +4 −0 Original line number Diff line number Diff line Loading @@ -198,6 +198,10 @@ static void nfs42_layoutstat_release(void *calldata) { struct nfs42_layoutstat_data *data = calldata; struct nfs_server *nfss = NFS_SERVER(data->args.inode); if (nfss->pnfs_curr_ld->cleanup_layoutstats) nfss->pnfs_curr_ld->cleanup_layoutstats(data); pnfs_put_layout_hdr(NFS_I(data->args.inode)->layout); nfs_iput_and_deactive(data->inode); Loading fs/nfs/pnfs.c +49 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include "iostat.h" #include "nfs4trace.h" #include "delegation.h" #include "nfs42.h" #define NFSDBG_FACILITY NFSDBG_PNFS #define PNFS_LAYOUTGET_RETRY_TIMEOUT (120*HZ) Loading Loading @@ -2250,3 +2251,51 @@ struct nfs4_threshold *pnfs_mdsthreshold_alloc(void) } return thp; } int pnfs_report_layoutstat(struct inode *inode) { struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld; struct nfs_server *server = NFS_SERVER(inode); struct nfs42_layoutstat_data *data; struct pnfs_layout_hdr *hdr; int status = 0; if (!pnfs_enabled_sb(server) || !ld->prepare_layoutstats) goto out; spin_lock(&inode->i_lock); if (!NFS_I(inode)->layout) { spin_unlock(&inode->i_lock); goto out; } hdr = NFS_I(inode)->layout; pnfs_get_layout_hdr(hdr); spin_unlock(&inode->i_lock); data = kzalloc(sizeof(*data), GFP_KERNEL); if (!data) { status = -ENOMEM; goto out_put; } data->args.fh = NFS_FH(inode); data->args.inode = inode; nfs4_stateid_copy(&data->args.stateid, &hdr->plh_stateid); status = ld->prepare_layoutstats(&data->args); if (status) goto out_free; status = nfs42_proc_layoutstats_generic(NFS_SERVER(inode), data); out: dprintk("%s returns %d\n", __func__, status); return status; out_free: kfree(data); out_put: pnfs_put_layout_hdr(hdr); goto out; } EXPORT_SYMBOL_GPL(pnfs_report_layoutstat); fs/nfs/pnfs.h +3 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,8 @@ struct pnfs_layoutdriver_type { void (*encode_layoutcommit) (struct pnfs_layout_hdr *lo, struct xdr_stream *xdr, const struct nfs4_layoutcommit_args *args); int (*prepare_layoutstats) (struct nfs42_layoutstat_args *args); void (*cleanup_layoutstats) (struct nfs42_layoutstat_data *data); }; struct pnfs_layout_hdr { Loading Loading @@ -290,6 +292,7 @@ int pnfs_write_done_resend_to_mds(struct nfs_pgio_header *); struct nfs4_threshold *pnfs_mdsthreshold_alloc(void); void pnfs_error_mark_layout_for_return(struct inode *inode, struct pnfs_layout_segment *lseg); int pnfs_report_layoutstat(struct inode *inode); /* nfs4_deviceid_flags */ enum { Loading Loading
fs/nfs/nfs42proc.c +4 −0 Original line number Diff line number Diff line Loading @@ -198,6 +198,10 @@ static void nfs42_layoutstat_release(void *calldata) { struct nfs42_layoutstat_data *data = calldata; struct nfs_server *nfss = NFS_SERVER(data->args.inode); if (nfss->pnfs_curr_ld->cleanup_layoutstats) nfss->pnfs_curr_ld->cleanup_layoutstats(data); pnfs_put_layout_hdr(NFS_I(data->args.inode)->layout); nfs_iput_and_deactive(data->inode); Loading
fs/nfs/pnfs.c +49 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include "iostat.h" #include "nfs4trace.h" #include "delegation.h" #include "nfs42.h" #define NFSDBG_FACILITY NFSDBG_PNFS #define PNFS_LAYOUTGET_RETRY_TIMEOUT (120*HZ) Loading Loading @@ -2250,3 +2251,51 @@ struct nfs4_threshold *pnfs_mdsthreshold_alloc(void) } return thp; } int pnfs_report_layoutstat(struct inode *inode) { struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld; struct nfs_server *server = NFS_SERVER(inode); struct nfs42_layoutstat_data *data; struct pnfs_layout_hdr *hdr; int status = 0; if (!pnfs_enabled_sb(server) || !ld->prepare_layoutstats) goto out; spin_lock(&inode->i_lock); if (!NFS_I(inode)->layout) { spin_unlock(&inode->i_lock); goto out; } hdr = NFS_I(inode)->layout; pnfs_get_layout_hdr(hdr); spin_unlock(&inode->i_lock); data = kzalloc(sizeof(*data), GFP_KERNEL); if (!data) { status = -ENOMEM; goto out_put; } data->args.fh = NFS_FH(inode); data->args.inode = inode; nfs4_stateid_copy(&data->args.stateid, &hdr->plh_stateid); status = ld->prepare_layoutstats(&data->args); if (status) goto out_free; status = nfs42_proc_layoutstats_generic(NFS_SERVER(inode), data); out: dprintk("%s returns %d\n", __func__, status); return status; out_free: kfree(data); out_put: pnfs_put_layout_hdr(hdr); goto out; } EXPORT_SYMBOL_GPL(pnfs_report_layoutstat);
fs/nfs/pnfs.h +3 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,8 @@ struct pnfs_layoutdriver_type { void (*encode_layoutcommit) (struct pnfs_layout_hdr *lo, struct xdr_stream *xdr, const struct nfs4_layoutcommit_args *args); int (*prepare_layoutstats) (struct nfs42_layoutstat_args *args); void (*cleanup_layoutstats) (struct nfs42_layoutstat_data *data); }; struct pnfs_layout_hdr { Loading Loading @@ -290,6 +292,7 @@ int pnfs_write_done_resend_to_mds(struct nfs_pgio_header *); struct nfs4_threshold *pnfs_mdsthreshold_alloc(void); void pnfs_error_mark_layout_for_return(struct inode *inode, struct pnfs_layout_segment *lseg); int pnfs_report_layoutstat(struct inode *inode); /* nfs4_deviceid_flags */ enum { Loading