Remove non-file layout code from submit tree
Subsystems (2)
cover Remove non-file layout code from submit tree
Applies to 2.6.34-rc3 pnfs-submit branch on top of the "pNFS generic devce ID cache version 3" patches sent April 26 which includes these patches:
0001-SQUASHME-pnfs_submit-generic-device-ID-cache.patch 0002-SQUASHME-pnfs_submit-fix-multiple-mount-set_pnfs_lay.patch 0003-SQUASHME-pnfs-submit-file-layout-driver-generic-devi.patch
This patch set begins separating non-file layout code from file layout code.
Adjust to using the generic device id cache.
Permanetly remove structure fields and function parameters not used by any layout driver.
The next patch set will restore object and block layout code removed by these patches.
0001-SQUASHME-pnfs_submit-remove-GETDEVICELIST.patch 0002-SQUASHME-pnfs_submit-remove-CB_NOTIFY_DEVICEID.patch 0003-SQUASHME-pnfs_submit-remove-pnfs_mount_type-from-all.patch 0004-SQUASHME-pnfs_submit-remove-get_blocksize-policy-ope.patch 0005-SQUASHME-pnfs_submit-remove-ds_wsize-ds_rsize-ds_wpa.patch 0006-SQUASHME-pnfs_submit-remove-uninitialize_mountpoint.patch 0007-SQUASHME-pnfs_submit-remove-struct-pnfs_mount_type.patch 0008-SQUASHME-pnfs_submit-change-initialize_mountpoint-pa.patch 0009-SQUASHME-pnfs_submit-change-nfs_fsino-layoutclass-na.patch 0010-SQUASHME-pnfs_submit-remove-pnfs_fs_ltype.patch 0011-SQUASHME-pnfs_submit-remove-layout_name.patch
File layout code bug fix and cleanup. 0012-SQUASHME-pnfs_submit-fall-back-to-MDS-on-filelayout_.patch 0013-SQUASHME-pnfs_submit-cleanup-nfs4_pnfs_ds_add.patch
Tested:CONFIG_NFS_V4_1 set
V4.0, V4.1, and pNFS mounts:
Connectathon tests pass.
CONFIG_NFS_V4_1 not set:
Connectathon tests pass.
-->Andy
PATCH 1/13 SQUASHME pnfs_submit: remove GETDEVICELIST
From: Andy Adamson <[email protected]>
The file layout driver does not use GETDEVICELIST
--- fs/nfs/nfs4proc.c | 47 ----------------- fs/nfs/nfs4xdr.c | 126 --------------------------------------------- fs/nfs/pnfs.c | 1 - fs/nfs/pnfs.h | 3 - include/linux/nfs4.h | 1 - include/linux/nfs4_pnfs.h | 2 - include/linux/pnfs_xdr.h | 11 ---- 7 files changed, 0 insertions(+), 191 deletions(-)
fs/nfs/nfs4proc.c +0 -47
@@ -5764,53 +5764,6 @@ out:return status; } -/* -* Retrieve the list of Data Server devices from the MDS. -*/ -static int _nfs4_pnfs_getdevicelist (struct nfs_fh *fh, -struct nfs_server *server, -struct pnfs_devicelist *devlist) -{ -struct nfs4_pnfs_getdevicelist_arg arg = { - .fh = fh, - .layoutclass = server->pnfs_curr_ld->id, - }; -struct nfs4_pnfs_getdevicelist_res res = { - .devlist = devlist, - }; -struct rpc_message msg = { - .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_PNFS_GETDEVICELIST ], - .rpc_argp = &arg, - .rpc_resp = &res, - }; -int status; - -dprintk ("--> %s\n" , __func__); - status =nfs4_call_sync (server, &msg, &arg, &res,0 ); -dprintk ("<-- %s status=%d\n" , __func__, status); -return status; -} - -int nfs4_pnfs_getdevicelist (struct super_block *sb, -struct nfs_fh *fh, -struct pnfs_devicelist *devlist) -{ -struct nfs4_exception exception = { }; -struct nfs_server *server =NFS_SB (sb); -int err; - -do { - err =nfs4_handle_exception (server, -_nfs4_pnfs_getdevicelist (fh, server, devlist), - &exception); - }while (exception.retry); - -dprintk ("nfs4_pnfs_getdevlist: err=%d, num_devs=%u\n" , - err, devlist->num_devs); - -return err; -} -int nfs4_pnfs_getdeviceinfo (struct super_block *sb,struct pnfs_device *pdev) {struct nfs_server *server =NFS_SB (sb);
fs/nfs/nfs4xdr.c +0 -126
168 lines not on this page · raw message
fs/nfs/pnfs.c +0 -1
@@ -2293,7 +2293,6 @@ void pnfs_free_fsdata(struct pnfs_fsdata *fsdata)/* Callback operations for layout drivers. */ struct pnfs_client_operations pnfs_ops = { - .nfs_getdevicelist = nfs4_pnfs_getdevicelist, .nfs_getdeviceinfo = nfs4_pnfs_getdeviceinfo, .nfs_readlist_complete = pnfs_read_done, .nfs_writelist_complete = pnfs_writeback_done,
fs/nfs/pnfs.h +0 -3
@@ -22,9 +22,6 @@#include "iostat.h" /* nfs4proc.c */ -extern int nfs4_pnfs_getdevicelist (struct super_block *sb, -struct nfs_fh *fh, -struct pnfs_devicelist *devlist);extern int nfs4_pnfs_getdeviceinfo (struct super_block *sb,struct pnfs_device *dev);extern int pnfs4_proc_layoutget (struct nfs4_pnfs_layoutget *lgp);
include/linux/nfs4.h +0 -1
@@ -543,7 +543,6 @@ enum {NFSPROC4_CLNT_PNFS_LAYOUTGET ,NFSPROC4_CLNT_PNFS_LAYOUTCOMMIT ,NFSPROC4_CLNT_PNFS_LAYOUTRETURN , -NFSPROC4_CLNT_PNFS_GETDEVICELIST ,NFSPROC4_CLNT_PNFS_GETDEVICEINFO ,NFSPROC4_CLNT_PNFS_WRITE , NFSPROC4_CLNT_PNFS_COMMIT,
include/linux/nfs4_pnfs.h +0 -2
@@ -331,8 +331,6 @@ extern void nfs4_unset_layout_deviceid(struct pnfs_layout_segment *,* E.g., getdeviceinfo, I/O callbacks, etc */ struct pnfs_client_operations { -int (*nfs_getdevicelist) (struct super_block *sb,struct nfs_fh *fh, -struct pnfs_devicelist *devlist);int (*nfs_getdeviceinfo) (struct super_block *sb,struct pnfs_device *dev);
include/linux/pnfs_xdr.h +0 -11
@@ -116,17 +116,6 @@ struct nfs4_pnfs_layoutreturn {int rpc_status; }; -struct nfs4_pnfs_getdevicelist_arg { -const struct nfs_fh *fh; -u32 layoutclass; -struct nfs4_sequence_args seq_args; -}; - -struct nfs4_pnfs_getdevicelist_res { -struct pnfs_devicelist *devlist; -struct nfs4_sequence_res seq_res; -}; -struct nfs4_pnfs_getdeviceinfo_arg {struct pnfs_device *pdev;struct nfs4_sequence_args seq_args;
Signature · 1 line
1.6.6
PATCH 2/13 SQUASHME pnfs_submit: remove CB_NOTIFY_DEVICEID
From: Andy Adamson <[email protected]>
The file layoutdriver submission will not support CB_NOTIFY_DEVICEID
--- fs/nfs/callback_proc.c | 68 -------------------------------- fs/nfs/callback_xdr.c | 96 +-------------------------------------------- include/linux/nfs4_pnfs.h | 1 - 3 files changed, 1 insertions(+), 164 deletions(-)
fs/nfs/callback_proc.c +0 -68
@@ -324,74 +324,6 @@ out:return res; } -/* Remove all devices for each superblock for nfs_client. This may try -* to remove the same device multple times if they are -* shared across superblocks in the layout driver, but the -* layout drive should be able to handle this */ -static __be32 pnfs_devicenotify_client (struct nfs_client *clp, -struct cb_pnfs_devicenotifyargs *args) -{ -struct nfs_server *server; -__be32 res =0 , res2 =0 ; -int i, num_sb =0 ; -struct layoutdriver_io_operations *ops; -uint32_t type; - -dprintk ("%s: --> clp %p\n" , __func__, clp); - -list_for_each_entry (server, &clp->cl_superblocks, client_link) { - ops = server->pnfs_curr_ld->ld_io_ops; - num_sb++; -for (i =0 ; i < args->ndevs; i++) { -struct cb_pnfs_devicenotifyitem *dev = &args->devs[i]; - type = dev->cbd_notify_type; -if (type ==NOTIFY_DEVICEID4_DELETE && -PNFS_EXISTS_LDIO_OP (server, device_delete)) - res = ops->device_delete (server->pnfs_mountid, - &dev->cbd_dev_id); -else if (type ==NOTIFY_DEVICEID4_CHANGE ) -printk (KERN_ERR "%s: NOTIFY_DEVICEID4_CHANGE " -"not supported\n" , __func__); -if (res) - res2 = res; - } - } -dprintk ("%s: exit with status = %d numsb %u\n" , - __func__,ntohl (res2), num_sb); -return res2; -} - -__be32 pnfs_cb_devicenotify (struct cb_pnfs_devicenotifyargs *args, -void *dummy) -{ -struct nfs_client *clp; -__be32 res =0 ; -unsigned int num_client =0 ; - -dprintk ("%s: -->\n" , __func__); - - res =__constant_htonl (NFS4ERR_INVAL ); - clp =nfs_find_client (args->addr,4 ); -if (clp ==NULL ) { -dprintk ("%s: no client for addr %u.%u.%u.%u\n" , - __func__,NIPQUAD (args->addr)); - goto out; - } - -do { -struct nfs_client *prev = clp; - num_client++; - res =pnfs_devicenotify_client (clp, args); - clp =nfs_find_client_next (prev); -nfs_put_client (prev); - }while (clp !=NULL ); - -out: -dprintk ("%s: exit with status = %d numclient %u\n" , - __func__,ntohl (res), num_client); -return res; -} -int nfs41_validate_delegation_stateid (struct nfs_delegation *delegation,const nfs4_stateid *stateid) {if (delegation ==NULL )
fs/nfs/callback_xdr.c +1 -95
124 lines not on this page · raw message
include/linux/nfs4_pnfs.h +0 -1
@@ -183,7 +183,6 @@ struct layoutdriver_io_operations {*/ struct pnfs_mount_type * (*initialize_mountpoint) (struct super_block *,struct nfs_fh *fh);int (*uninitialize_mountpoint) (struct pnfs_mount_type *mountid); -int (*device_delete) (struct pnfs_mount_type *mountid,struct pnfs_deviceid *dev_id); };enum layoutdriver_policy_flags {
Signature · 1 line
1.6.6
PATCH 3/13 SQUASHME pnfs_submit: remove pnfs_mount_type from alloc_layout
From: Andy Adamson <[email protected]>
The pnfs_mount_type parameter is not used by any layout driver alloc_layout function.
--- fs/nfs/nfs4filelayout.c | 2 +- fs/nfs/pnfs.c | 2 +- include/linux/nfs4_pnfs.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
fs/nfs/nfs4filelayout.c +1 -1
@@ -334,7 +334,7 @@ filelayout_write_pagelist(struct pnfs_layout_type *layoutid,* inode from now on. */ static void * -filelayout_alloc_layout (struct pnfs_mount_type *mountid,struct inode *inode) +filelayout_alloc_layout (struct inode *inode) {dprintk ("NFS_FILELAYOUT: allocating layout\n" );return kzalloc (sizeof (struct nfs4_filelayout ),GFP_KERNEL );
fs/nfs/pnfs.c +1 -1
@@ -864,7 +864,7 @@ alloc_init_layout(struct inode *ino) io_ops =NFS_SERVER (ino)->pnfs_curr_ld->ld_io_ops; lo = &NFS_I (ino)->layout; - ld_data = io_ops->alloc_layout (NFS_SERVER (ino)->pnfs_mountid, ino); + ld_data = io_ops->alloc_layout (ino);if (!ld_data) { printk(KERN_ERR "%s: out of memory: io_ops->alloc_layout failed\n",
include/linux/nfs4_pnfs.h +1 -1
@@ -162,7 +162,7 @@ struct layoutdriver_io_operations {/* Layout information. For each inode, alloc_layout is executed once to retrieve an * inode specific layout structure. Each subsequent layoutget operation results in * a set_layout call to set the opaque layout in the layout driver.*/ -void * (*alloc_layout) (struct pnfs_mount_type *mountid,struct inode *inode); +void * (*alloc_layout) (struct inode *inode);void (*free_layout) (void *layoutid);struct pnfs_layout_segment * (*alloc_lseg) (struct pnfs_layout_type *layoutid,struct nfs4_pnfs_layoutget_res *lgr);void (*free_lseg) (struct pnfs_layout_segment *lseg);
Signature · 1 line
1.6.6
PATCH 4/13 SQUASHME pnfs_submit: remove get_blocksize policy operation
From: Andy Adamson <[email protected]>
Not used by the file layout driver
--- fs/nfs/pnfs.c | 41 ++++------------------------------------- include/linux/nfs4_pnfs.h | 6 ------ 2 files changed, 4 insertions(+), 43 deletions(-)
fs/nfs/pnfs.c +4 -37
@@ -1607,46 +1607,13 @@ pnfs_use_write(struct inode *inode, ssize_t count)return 1 ;/* use pNFS I/O */ } -/* Return I/O buffer size for a layout driver -* This value will determine what size reads and writes -* will be gathered into and sent to the data servers. -* blocksize must be a multiple of the page cache size. -*/ -unsigned int -pnfs_getiosize (struct nfs_server *server) -{ -struct pnfs_mount_type *mounttype; -struct pnfs_layoutdriver_type *ld; - - mounttype = server->pnfs_mountid; - ld = server->pnfs_curr_ld; -if (!pnfs_enabled_sb (server) || - !mounttype || - !ld->ld_policy_ops || - !ld->ld_policy_ops->get_blocksize) -return 0 ; - -return ld->ld_policy_ops->get_blocksize (mounttype); -} -void pnfs_set_ds_iosize (struct nfs_server *server) { -unsigned dssize =pnfs_getiosize (server); - -/* Set buffer size for data servers */ -if (dssize >0 ) { - server->ds_rsize = server->ds_wsize = -nfs_block_size (dssize,NULL ); - server->ds_rpages = server->ds_wpages = - (server->ds_rsize +PAGE_CACHE_SIZE -1 ) >> -PAGE_CACHE_SHIFT ; - }else { - server->ds_wsize = server->wsize; - server->ds_rsize = server->rsize; - server->ds_rpages = server->rpages; - server->ds_wpages = server->wpages; - } + server->ds_wsize = server->wsize; + server->ds_rsize = server->rsize; + server->ds_rpages = server->rpages; + server->ds_wpages = server->wpages; } static int
include/linux/nfs4_pnfs.h +0 -6
@@ -214,12 +214,6 @@ struct layoutdriver_policy_operations {int (*do_flush)(struct pnfs_layout_segment *lseg,struct nfs_page *req,struct pnfs_fsdata *fsdata); -/* Retreive the block size of the file system. If gather_across_stripes == 1, -* then the file system will gather requests into the block size. -* TODO: Where will the layout driver get this info? It is hard coded in PVFS2. -*/ -ssize_t (*get_blocksize) (struct pnfs_mount_type *); -/* Read requests under this value are sent to the NFSv4 server */ ssize_t (*get_read_threshold) (struct pnfs_layout_type *,struct inode *);
Signature · 1 line
1.6.6
PATCH 5/13 SQUASHME pnfs_submit: remove ds_wsize, ds_rsize, ds_wpages and ds_rpages
From: Andy Adamson <[email protected]>
No layoutdriver uses ds_wpages or ds_rpages. The file layout driver does not use ds_rsize nor ds_wsize - instead, rsize and wsize are used.
--- fs/nfs/nfs4filelayout.c | 11 ++++++----- fs/nfs/pnfs.c | 24 +++++------------------- fs/nfs/pnfs.h | 6 +++--- fs/nfs/read.c | 2 +- fs/nfs/super.c | 1 - fs/nfs/write.c | 2 +- include/linux/nfs_fs_sb.h | 7 ------- 7 files changed, 16 insertions(+), 37 deletions(-)
fs/nfs/nfs4filelayout.c +6 -5
@@ -407,9 +407,10 @@ filelayout_check_layout(struct pnfs_layout_type *lo, goto out; } -if (fl->stripe_unit % nfss->ds_rsize || fl->stripe_unit % nfss->ds_wsize) { -dprintk ("%s Stripe unit (%u) not aligned with rsize %u wsize %u\n" , - __func__, fl->stripe_unit, nfss->ds_rsize, nfss->ds_wsize); +if (fl->stripe_unit % nfss->rsize || fl->stripe_unit % nfss->wsize) { +dprintk ("%s Stripe unit (%u) not aligned with rsize %u " +"wsize %u\n" , __func__, fl->stripe_unit, nfss->rsize, + nfss->wsize); }/* reference the device */
@@ -740,9 +741,9 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,if (!pgio->pg_iswrite) goto boundary; -if (pgio->pg_bsize !=NFS_SERVER (pgio->pg_inode)->ds_wsize && +if (pgio->pg_bsize !=NFS_SERVER (pgio->pg_inode)->wsize && pgio->pg_count > pgio->pg_threshold) - pgio->pg_bsize =NFS_SERVER (pgio->pg_inode)->ds_wsize; + pgio->pg_bsize =NFS_SERVER (pgio->pg_inode)->wsize; boundary:if (pgio->pg_boundary ==0 )
fs/nfs/pnfs.c +5 -19
@@ -1428,8 +1428,7 @@ void pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, struct inode *inode, struct nfs_open_context *ctx, - struct list_head *pages, - size_t *rsize) + struct list_head *pages) { struct nfs_server *nfss = NFS_SERVER(inode);size_t count =0 ;
@@ -1450,12 +1449,10 @@ pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio,if (count >0 && !below_threshold (inode, count,0 )) { status =pnfs_update_layout (inode, ctx, count, loff,IOMODE_READ ,NULL ); -dprintk ("%s *rsize %Zd virt update returned %d\n" , - __func__, *rsize, status); +dprintk ("%s virt update returned %d\n" , __func__, status);if (status !=0 )return ; - *rsize =NFS_SERVER (inode)->ds_rsize; pgio->pg_boundary =pnfs_getboundary (inode);if (pgio->pg_boundary)pnfs_set_pg_test (inode, pgio);
@@ -1463,8 +1460,7 @@ pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, }void -pnfs_pageio_init_write (struct nfs_pageio_descriptor *pgio,struct inode *inode, -size_t *wsize) +pnfs_pageio_init_write (struct nfs_pageio_descriptor *pgio,struct inode *inode) {struct nfs_server *server =NFS_SERVER (inode);
@@ -1478,7 +1474,6 @@ pnfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, struct inode *inode, pgio->pg_threshold =pnfs_getthreshold (inode,1 ); pgio->pg_boundary =pnfs_getboundary (inode);pnfs_set_pg_test (inode, pgio); - *wsize = server->ds_wsize; }/* Retrieve I/O parameters for O_DIRECT.
@@ -1501,9 +1496,9 @@ _pnfs_direct_init_io(struct inode *inode, struct nfs_open_context *ctx,return ;if (iswrite) - rwsize = nfss->ds_wsize; + rwsize = nfss->wsize;else - rwsize = nfss->ds_rsize; + rwsize = nfss->rsize; boundary =pnfs_getboundary (inode);
@@ -1607,15 +1602,6 @@ pnfs_use_write(struct inode *inode, ssize_t count)return 1 ;/* use pNFS I/O */ } -void -pnfs_set_ds_iosize (struct nfs_server *server) -{ - server->ds_wsize = server->wsize; - server->ds_rsize = server->rsize; - server->ds_rpages = server->rpages; - server->ds_wpages = server->wpages; -} -static int pnfs_call_done (struct pnfs_call_data *pdata,struct rpc_task *task,void *data) {
fs/nfs/pnfs.h +3 -3
@@ -55,11 +55,11 @@ int pnfs_layoutcommit_inode(struct inode *inode, int sync);void pnfs_update_last_write (struct nfs_inode *nfsi,loff_t offset,size_t extent);void pnfs_need_layoutcommit (struct nfs_inode *nfsi,struct nfs_open_context *ctx);unsigned int pnfs_getiosize (struct nfs_server *server); -void pnfs_set_ds_iosize (struct nfs_server *server);enum pnfs_try_status _pnfs_try_to_commit (struct nfs_write_data *,const struct rpc_call_ops *,int ); -void pnfs_pageio_init_read (struct nfs_pageio_descriptor *,struct inode *,struct nfs_open_context *,struct list_head *,size_t *); -void pnfs_pageio_init_write (struct nfs_pageio_descriptor *,struct inode *,size_t *wsize); +void pnfs_pageio_init_read (struct nfs_pageio_descriptor *,struct inode *, +struct nfs_open_context *,struct list_head *); +void pnfs_pageio_init_write (struct nfs_pageio_descriptor *,struct inode *);void pnfs_update_layout_commit (struct inode *,struct list_head *,pgoff_t ,unsigned int );void pnfs_free_fsdata (struct pnfs_fsdata *fsdata);ssize_t pnfs_file_write (struct file *,const char __user *,size_t ,loff_t *);
fs/nfs/read.c +1 -1
@@ -663,7 +663,7 @@ int nfs_readpages(struct file *filp, struct address_space *mapping, goto read_complete;/* all pages were read */ #ifdef CONFIG_NFS_V4_1 -pnfs_pageio_init_read (&pgio, inode, desc.ctx, pages, &rsize); +pnfs_pageio_init_read (&pgio, inode, desc.ctx, pages);#endif /* CONFIG_NFS_V4_1 */ if (rsize <PAGE_CACHE_SIZE )nfs_pageio_init (&pgio, inode, nfs_pagein_multi, rsize,0 );
fs/nfs/super.c +0 -1
@@ -2590,7 +2590,6 @@ static void nfs4_init_pnfs(struct super_block *sb, struct nfs_fh *fh)if (nfs4_has_session (clp) && (clp->cl_exchange_flags &EXCHGID4_FLAG_USE_PNFS_MDS )) {set_pnfs_layoutdriver (sb, fh, server->pnfs_fs_ltype); -pnfs_set_ds_iosize (server); }#endif /* CONFIG_NFS_V4_1 */ }
fs/nfs/write.c +1 -1
@@ -997,7 +997,7 @@ static void nfs_pageio_init_write(struct nfs_pageio_descriptor *pgio,size_t wsize =NFS_SERVER (inode)->wsize;#ifdef CONFIG_NFS_V4_1 -pnfs_pageio_init_write (pgio, inode, &wsize); +pnfs_pageio_init_write (pgio, inode);#endif /* CONFIG_NFS_V4_1 */ if (wsize <PAGE_CACHE_SIZE )
include/linux/nfs_fs_sb.h +0 -7
@@ -167,13 +167,6 @@ struct nfs_server {struct pnfs_layoutdriver_type *pnfs_curr_ld;/* Active layout driver */ struct pnfs_mount_type *pnfs_mountid;/* Mount identifier for layout driver */ -/* Data server values will equal NFS server values if -* no pNFS layout driver exists for the mountpoint -*/ -unsigned int ds_rsize;/* Data server read size */ -unsigned int ds_rpages;/* Data server read size (in pages) */ -unsigned int ds_wsize;/* Data server write size */ -unsigned int ds_wpages;/* Data server write size (in pages) */ #endif /* CONFIG_NFS_V4_1 */ void (*destroy)(struct nfs_server *);
Signature · 1 line
1.6.6
PATCH 6/13 SQUASHME pnfs_submit: remove uninitialize_mountpoint
From: Andy Adamson <[email protected]>
The layoutdriver_io_operations uninitialize_mountpoint function is used to free a layout driver specific device id cache.
The device id cache is now shared and moved to struct nfs_client and can be removed in the generic unmount_pnfs_layoutdriver routine.
--- fs/nfs/nfs4filelayout.c | 18 ------------------ fs/nfs/pnfs.c | 11 +++-------- include/linux/nfs4_pnfs.h | 1 - 3 files changed, 3 insertions(+), 27 deletions(-)
fs/nfs/nfs4filelayout.c +0 -18
@@ -109,23 +109,6 @@ error_ret: ;return NULL ; } -/* Uninitialize a mountpoint by destroying its device list. -*/ -int -filelayout_uninitialize_mountpoint (struct pnfs_mount_type *mountid) -{ -struct filelayout_mount_type *fl_mt =NULL ; - -dprintk ("--> %s\n" , __func__); -if (mountid) { - fl_mt = (struct filelayout_mount_type *)mountid->mountid; -nfs4_put_deviceid_cache (NFS_SB (fl_mt->fl_sb)->nfs_client); -kfree (fl_mt); -kfree (mountid); - } -return 0 ; -} -/* This function is used by the layout driver to calculate the * offset of the file on the dserver based on whether the * layout type is STRIPE_DENSE or STRIPE_SPARSE
@@ -782,7 +765,6 @@ struct layoutdriver_io_operations filelayout_io_operations = { .alloc_lseg = filelayout_alloc_lseg, .free_lseg = filelayout_free_lseg, .initialize_mountpoint = filelayout_initialize_mountpoint, - .uninitialize_mountpoint = filelayout_uninitialize_mountpoint, };struct layoutdriver_policy_operations filelayout_policy_operations = {
fs/nfs/pnfs.c +3 -8
@@ -194,14 +194,9 @@ pnfs_update_last_write(struct nfs_inode *nfsi, loff_t offset, size_t extent)void unmount_pnfs_layoutdriver (struct super_block *sb) { -struct nfs_server *server =NFS_SB (sb); -if (server->pnfs_curr_ld && - server->pnfs_curr_ld->ld_io_ops && - server->pnfs_curr_ld->ld_io_ops->uninitialize_mountpoint) { - server->pnfs_curr_ld->ld_io_ops->uninitialize_mountpoint ( - server->pnfs_mountid); - server->pnfs_mountid =NULL ; - } +if (NFS_SB (sb)->pnfs_curr_ld &&NFS_SB (sb)->nfs_client->cl_devid_cache) +nfs4_put_deviceid_cache (NFS_SB (sb)->nfs_client); +NFS_SB (sb)->pnfs_curr_ld =NULL ; }/*
include/linux/nfs4_pnfs.h +0 -1
@@ -182,7 +182,6 @@ struct layoutdriver_io_operations {/* Registration information for a new mounted file system */ struct pnfs_mount_type * (*initialize_mountpoint) (struct super_block *,struct nfs_fh *fh); -int (*uninitialize_mountpoint) (struct pnfs_mount_type *mountid); };enum layoutdriver_policy_flags {
Signature · 1 line
1.6.6
PATCH 7/13 SQUASHME pnfs_submit: remove struct pnfs_mount_type
From: Andy Adamson <[email protected]>
The pnfs_mount_type structure was used to store per layout type device id caches. It is no longer needed with the generic device id cache in struct nfs_client.
--- fs/nfs/nfs4filelayout.c | 40 +++++++--------------------------------- fs/nfs/pnfs.c | 8 ++------ include/linux/nfs4_pnfs.h | 15 +-------------- include/linux/nfs_fs_sb.h | 2 -- 4 files changed, 10 insertions(+), 55 deletions(-)
fs/nfs/nfs4filelayout.c +7 -33
@@ -68,45 +68,19 @@ struct pnfs_client_operations *pnfs_callback_ops;ssize_t filelayout_get_stripesize (struct pnfs_layout_type *);struct layoutdriver_io_operations filelayout_io_operations; -/* Initialize and return the pnfs_mount_type structure so the -* pNFS_client can refer to the mount point later on -*/ -struct pnfs_mount_type * +int filelayout_initialize_mountpoint (struct super_block *sb,struct nfs_fh *fh) { -struct filelayout_mount_type *fl_mt; -struct pnfs_mount_type *mt; - - fl_mt =kmalloc (sizeof (struct filelayout_mount_type ),GFP_KERNEL ); -if (!fl_mt) - goto error_ret; - - mt =kmalloc (sizeof (struct pnfs_mount_type ),GFP_KERNEL ); -if (!mt) - goto cleanup_fl_mt; - - fl_mt->fl_sb = sb; - mt->mountid = (void *)fl_mt;if (nfs4_alloc_init_deviceid_cache (NFS_SB (sb)->nfs_client, - nfs4_fl_free_deviceid_callback)) - goto cleanup_mt; - + nfs4_fl_free_deviceid_callback)) { +printk (KERN_WARNING "%s: deviceid cache could not be " +"initialized\n" , __func__); +return 0 ; + }dprintk ("%s: deviceid cache has been initialized successfully\n" , __func__); -return mt; - -cleanup_mt: ; -kfree (mt); - -cleanup_fl_mt: ; -kfree (fl_mt); - -error_ret: ; -printk (KERN_WARNING "%s: deviceid cache could not be initialized\n" , - __func__); - -return NULL ; +return 1 ; }/* This function is used by the layout driver to calculate the
fs/nfs/pnfs.c +2 -6
@@ -207,16 +207,14 @@ void set_pnfs_layoutdriver(struct super_block *sb, struct nfs_fh *fh, u32 id) { struct pnfs_module *mod; -struct pnfs_mount_type *mt;struct nfs_server *server =NFS_SB (sb);if (server->pnfs_curr_ld)return ;if (id >0 &&find_pnfs (id, &mod)) { - mt = mod->pnfs_ld_type->ld_io_ops->initialize_mountpoint ( - sb, fh); -if (!mt) { +if (!mod->pnfs_ld_type->ld_io_ops->initialize_mountpoint ( + sb, fh)) {printk (KERN_ERR "%s: Error initializing mount point " "for layout driver %u. " , __func__, id); goto out_err;
@@ -226,7 +224,6 @@ set_pnfs_layoutdriver(struct super_block *sb, struct nfs_fh *fh, u32 id)* and has taken a reference on the nfs_client cl_devid_cache */ server->pnfs_curr_ld = mod->pnfs_ld_type; - server->pnfs_mountid = mt; server->nfs_client->rpc_ops = &pnfs_v4_clientops;dprintk ("%s: pNFS module for %u set\n" , __func__, id);return ;
@@ -236,7 +233,6 @@ set_pnfs_layoutdriver(struct super_block *sb, struct nfs_fh *fh, u32 id) out_err:dprintk ("Using NFSv4 I/O\n" ); server->pnfs_curr_ld =NULL ; - server->pnfs_mountid =NULL ;return ; }
include/linux/nfs4_pnfs.h +1 -14
@@ -30,13 +30,6 @@ struct pnfs_layoutdriver_type {struct layoutdriver_policy_operations *ld_policy_ops; }; -/* Layout driver specific identifier for a mount point. For each mountpoint -* a reference is stored in the nfs_server structure. -*/ -struct pnfs_mount_type { -void *mountid; -}; -struct pnfs_fsdata {int ok_to_use_pnfs;struct pnfs_layout_segment *lseg;
@@ -62,12 +55,6 @@ PNFS_NFS_SERVER(struct pnfs_layout_type *lo)return NFS_SERVER (PNFS_INODE (lo)); } -static inline struct pnfs_mount_type * -PNFS_MOUNTID (struct pnfs_layout_type *lo) -{ -return NFS_SERVER (PNFS_INODE (lo))->pnfs_mountid; -} -static inline void *PNFS_LD_DATA (struct pnfs_layout_type *lo) {
@@ -181,7 +168,7 @@ struct layoutdriver_io_operations {/* Registration information for a new mounted file system */ -struct pnfs_mount_type * (*initialize_mountpoint) (struct super_block *,struct nfs_fh *fh); +int (*initialize_mountpoint) (struct super_block *,struct nfs_fh *fh); };enum layoutdriver_policy_flags {
include/linux/nfs_fs_sb.h +0 -2
@@ -165,8 +165,6 @@ struct nfs_server {#ifdef CONFIG_NFS_V4_1 u32 pnfs_fs_ltype;/* fs_layouttype attr */ struct pnfs_layoutdriver_type *pnfs_curr_ld;/* Active layout driver */ -struct pnfs_mount_type *pnfs_mountid;/* Mount identifier for -layout driver */ #endif /* CONFIG_NFS_V4_1 */ void (*destroy)(struct nfs_server *);
Signature · 1 line
1.6.6
PATCH 8/13 SQUASHME pnfs_submit: change initialize_mountpoint parameters
From: Andy Adamson <[email protected]>
The layoutdriver_io_operation initalize_mountpoint is used to set up the generic device id cache.
The super block and file handle parameters are unused except by the block layout driver which uses them to call GETDEVICELIST.
A getdevicelist call will be added for the block layout driver.
--- fs/nfs/nfs4filelayout.c | 4 ++-- fs/nfs/pnfs.c | 2 +- fs/nfs/pnfs.h | 2 +- include/linux/nfs4_pnfs.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
fs/nfs/nfs4filelayout.c +2 -2
@@ -69,10 +69,10 @@ ssize_t filelayout_get_stripesize(struct pnfs_layout_type *);struct layoutdriver_io_operations filelayout_io_operations;int -filelayout_initialize_mountpoint (struct super_block *sb,struct nfs_fh *fh) +filelayout_initialize_mountpoint (struct nfs_client *clp) { -if (nfs4_alloc_init_deviceid_cache (NFS_SB (sb)->nfs_client, +if (nfs4_alloc_init_deviceid_cache (clp, nfs4_fl_free_deviceid_callback)) {printk (KERN_WARNING "%s: deviceid cache could not be " "initialized\n" , __func__);
fs/nfs/pnfs.c +1 -1
@@ -214,7 +214,7 @@ set_pnfs_layoutdriver(struct super_block *sb, struct nfs_fh *fh, u32 id)if (id >0 &&find_pnfs (id, &mod)) {if (!mod->pnfs_ld_type->ld_io_ops->initialize_mountpoint ( - sb, fh)) { + server->nfs_client)) {printk (KERN_ERR "%s: Error initializing mount point " "for layout driver %u. " , __func__, id); goto out_err;
fs/nfs/pnfs.h +1 -1
@@ -38,7 +38,7 @@ int pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx,int _pnfs_return_layout (struct inode *,struct nfs4_pnfs_layout_segment *,const nfs4_stateid *stateid,/* optional */ enum pnfs_layoutreturn_type ); -void set_pnfs_layoutdriver (struct super_block *sb,struct nfs_fh *fh,u32 id); +void set_pnfs_layoutdriver (struct super_block *,struct nfs_fh *,u32 id);void unmount_pnfs_layoutdriver (struct super_block *sb);int pnfs_use_read (struct inode *inode,ssize_t count);int pnfs_use_ds_io (struct list_head *,struct inode *,int );
include/linux/nfs4_pnfs.h +1 -1
@@ -168,7 +168,7 @@ struct layoutdriver_io_operations {/* Registration information for a new mounted file system */ -int (*initialize_mountpoint) (struct super_block *,struct nfs_fh *fh); +int (*initialize_mountpoint) (struct nfs_client *); };enum layoutdriver_policy_flags {
Signature · 1 line
1.6.6
PATCH 9/13 SQUASHME pnfs_submit: change nfs_fsino layoutclass name
From: Andy Adamson <[email protected]>
--- fs/nfs/client.c | 2 +- fs/nfs/nfs4xdr.c | 2 +- include/linux/nfs_xdr.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
fs/nfs/client.c +1 -1
@@ -903,7 +903,7 @@ static void nfs_server_set_fsinfo(struct nfs_server *server, struct nfs_fsinfo * server->wpages = (server->wsize +PAGE_CACHE_SIZE -1 ) >>PAGE_CACHE_SHIFT ;#ifdef CONFIG_NFS_V4_1 /* Save the layout type for use during init of layout driver */ - server->pnfs_fs_ltype = fsinfo->layoutclass; + server->pnfs_fs_ltype = fsinfo->layouttype;#endif /* CONFIG_NFS_V4_1 */ server->wtmult =nfs_block_bits (fsinfo->wtmult,NULL );
fs/nfs/nfs4xdr.c +1 -1
@@ -4277,7 +4277,7 @@ static int decode_fsinfo(struct xdr_stream *xdr, struct nfs_fsinfo *fsinfo) goto xdr_error; fsinfo->wtpref = fsinfo->wtmax;#if defined(CONFIG_NFS_V4_1 ) - status =decode_attr_pnfstype (xdr, bitmap, &fsinfo->layoutclass); + status =decode_attr_pnfstype (xdr, bitmap, &fsinfo->layouttype);if (status) goto xdr_error;#endif /* CONFIG_NFS_V4_1 */
include/linux/nfs_xdr.h +1 -1
@@ -114,7 +114,7 @@ struct nfs_fsinfo {__u64 maxfilesize;__u32 lease_time;/* in seconds */ #if defined(CONFIG_NFS_V4_1 ) -__u32 layoutclass;/* supported pnfs layout driver */ +__u32 layouttype;/* supported pnfs layout driver */ #endif };
Signature · 1 line
1.6.6
PATCH 10/13 SQUASHME pnfs_submit: remove pnfs_fs_ltype
From: Andy Adamson <[email protected]>
Set the pnfs_curr_ld pointer in nfs_probe_fsinfo. Use the pnfs_curr_ld layout type.
--- fs/nfs/client.c | 20 ++++++++++++++++---- fs/nfs/pnfs.c | 3 +-- fs/nfs/pnfs.h | 2 +- fs/nfs/super.c | 26 ++------------------------ include/linux/nfs_fs_sb.h | 1 - 5 files changed, 20 insertions(+), 32 deletions(-)
fs/nfs/client.c +16 -4
@@ -48,6 +48,7 @@#include "iostat.h" #include "internal.h" #include "fscache.h" +#include "pnfs.h" #define NFSDBG_FACILITY NFSDBG_CLIENT
@@ -869,6 +870,20 @@ error: }/* +* Initialize the pNFS layout driver and setup pNFS related parameters +*/ +static void nfs4_init_pnfs (struct nfs_server *server,struct nfs_fsinfo *fsinfo) +{ +#if defined(CONFIG_NFS_V4_1 ) +struct nfs_client *clp = server->nfs_client; + +if (nfs4_has_session (clp) && + (clp->cl_exchange_flags &EXCHGID4_FLAG_USE_PNFS_MDS )) +set_pnfs_layoutdriver (server, fsinfo->layouttype); +#endif /* CONFIG_NFS_V4_1 */ +} + +/* * Load up the server record from information gained in an fsinfo record */ static void nfs_server_set_fsinfo (struct nfs_server *server,struct nfs_fsinfo *fsinfo)
@@ -901,10 +916,7 @@ static void nfs_server_set_fsinfo(struct nfs_server *server, struct nfs_fsinfo *if (server->wsize >NFS_MAX_FILE_IO_SIZE ) server->wsize =NFS_MAX_FILE_IO_SIZE ; server->wpages = (server->wsize +PAGE_CACHE_SIZE -1 ) >>PAGE_CACHE_SHIFT ; -#ifdef CONFIG_NFS_V4_1 -/* Save the layout type for use during init of layout driver */ - server->pnfs_fs_ltype = fsinfo->layouttype; -#endif /* CONFIG_NFS_V4_1 */ +nfs4_init_pnfs (server, fsinfo); server->wtmult =nfs_block_bits (fsinfo->wtmult,NULL );
fs/nfs/pnfs.c +1 -2
@@ -204,10 +204,9 @@ unmount_pnfs_layoutdriver(struct super_block *sb)* Only one pNFS layout driver is supported. */ void -set_pnfs_layoutdriver (struct super_block *sb,struct nfs_fh *fh,u32 id) +set_pnfs_layoutdriver (struct nfs_server *server,u32 id) {struct pnfs_module *mod; -struct nfs_server *server =NFS_SB (sb);if (server->pnfs_curr_ld)return ;
fs/nfs/pnfs.h +1 -1
@@ -38,7 +38,7 @@ int pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx,int _pnfs_return_layout (struct inode *,struct nfs4_pnfs_layout_segment *,const nfs4_stateid *stateid,/* optional */ enum pnfs_layoutreturn_type ); -void set_pnfs_layoutdriver (struct super_block *,struct nfs_fh *,u32 id); +void set_pnfs_layoutdriver (struct nfs_server *,u32 id);void unmount_pnfs_layoutdriver (struct super_block *sb);int pnfs_use_read (struct inode *inode,ssize_t count);int pnfs_use_ds_io (struct list_head *,struct inode *,int );
fs/nfs/super.c +2 -24
@@ -678,13 +678,13 @@ char *layout_name(u32 layouttype)void show_pnfs (struct seq_file *m,struct nfs_server *server) { -char *name =layout_name (server->pnfs_fs_ltype); +char *name =layout_name (server->pnfs_curr_ld->id);seq_printf (m,",pnfs=" );if (name)seq_printf (m,"%s" , name);else -seq_printf (m,"unknown(%d)" , server->pnfs_fs_ltype); +seq_printf (m,"unknown(%d)" , server->pnfs_curr_ld->id); }#else /* CONFIG_NFS_V4_1 */ void show_pnfs (struct seq_file *m,struct nfs_server *server) {}
@@ -2579,22 +2579,6 @@ out_no_address: }/* -* Initialize the pNFS layout driver and setup pNFS related parameters -*/ -static void nfs4_init_pnfs (struct super_block *sb,struct nfs_fh *fh) -{ -#if defined(CONFIG_NFS_V4_1 ) -struct nfs_server *server =NFS_SB (sb); -struct nfs_client *clp = server->nfs_client; - -if (nfs4_has_session (clp) && - (clp->cl_exchange_flags &EXCHGID4_FLAG_USE_PNFS_MDS )) { -set_pnfs_layoutdriver (sb, fh, server->pnfs_fs_ltype); - } -#endif /* CONFIG_NFS_V4_1 */ -} - -/* * Get the superblock for the NFS4 root partition */ static int nfs4_remote_get_sb(struct file_system_type *fs_type,
@@ -2661,8 +2645,6 @@ static int nfs4_remote_get_sb(struct file_system_type *fs_type,if (error) goto error_splat_root; -nfs4_init_pnfs (s, mntfh); - s->s_flags |=MS_ACTIVE ; mnt->mnt_sb = s; mnt->mnt_root = mntroot;
@@ -2908,8 +2890,6 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,security_sb_clone_mnt_opts (data->sb, s); -nfs4_init_pnfs (s, data->fh); -dprintk ("<-- nfs4_xdev_get_sb() = 0\n" );return 0 ;
@@ -2995,8 +2975,6 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type,security_sb_clone_mnt_opts (data->sb, s); -nfs4_init_pnfs (s, &mntfh); -dprintk ("<-- nfs4_referral_get_sb() = 0\n" );return 0 ;
include/linux/nfs_fs_sb.h +0 -1
@@ -163,7 +163,6 @@ struct nfs_server {#endif #ifdef CONFIG_NFS_V4_1 -u32 pnfs_fs_ltype;/* fs_layouttype attr */ struct pnfs_layoutdriver_type *pnfs_curr_ld;/* Active layout driver */ #endif /* CONFIG_NFS_V4_1 */
Signature · 1 line
1.6.6
PATCH 11/13 SQUASHME pnfs_submit: remove layout_name
From: Andy Adamson <[email protected]>
Use the pnfs_curr_ld name field.
--- fs/nfs/super.c | 22 +++------------------- 1 files changed, 3 insertions(+), 19 deletions(-)
fs/nfs/super.c +3 -19
@@ -662,29 +662,13 @@ void show_sessions(struct seq_file *m, struct nfs_server *server) {}#endif #ifdef CONFIG_NFS_V4_1 -char *layout_name (u32 layouttype) -{ -switch (layouttype) { -case LAYOUT_NFSV4_FILES : -return "files" ; -case LAYOUT_OSD2_OBJECTS : -return "objects" ; -case LAYOUT_BLOCK_VOLUME : -return "blocks" ; -default : -return NULL ; - } -} -void show_pnfs (struct seq_file *m,struct nfs_server *server) { -char *name =layout_name (server->pnfs_curr_ld->id); -seq_printf (m,",pnfs=" ); -if (name) -seq_printf (m,"%s" , name); +if (server->pnfs_curr_ld) +seq_printf (m,"%s" , server->pnfs_curr_ld->name);else -seq_printf (m,"unknown(%d)" , server->pnfs_curr_ld->id); +seq_printf (m,"not configured" ); }#else /* CONFIG_NFS_V4_1 */ void show_pnfs (struct seq_file *m,struct nfs_server *server) {}
Signature · 1 line
1.6.6
PATCH 12/13 SQUASHME pnfs_submit: fall back to MDS on filelayout_commit error
From: Andy Adamson <[email protected]>
--- fs/nfs/nfs4filelayout.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
fs/nfs/nfs4filelayout.c +3 -1
@@ -563,6 +563,7 @@ filelayout_commit(struct pnfs_layout_type *layoutid, int sync,loff_t file_offset, comp_offset;size_t stripesz, cbytes;int status; +enum pnfs_try_status trypnfs =PNFS_ATTEMPTED ;struct nfs4_file_layout_dsaddr *dsaddr;u32 idx1, idx2;
@@ -662,11 +663,12 @@ out: data->pdata.pnfs_error);/* XXX should we send COMMIT to MDS e.g. not free data and return 1 ? */ -return PNFS_ATTEMPTED ; +return trypnfs; err_rewind:/* put remaining pages back onto the original data->pages */ list_add (&data->pages, &head);list_del_init (&head); + trypnfs =PNFS_NOT_ATTEMPTED ; goto out; }
Signature · 1 line
1.6.6
PATCH 13/13 SQUASHME pnfs_submit: cleanup nfs4_pnfs_ds_add
From: Andy Adamson <[email protected]>
Only initialize struct nfs4_pnfs_ds_add when using it.
--- fs/nfs/nfs4filelayoutdev.c | 26 ++++++++++++-------------- 1 files changed, 12 insertions(+), 14 deletions(-)
fs/nfs/nfs4filelayoutdev.c +12 -14
@@ -273,31 +273,29 @@ nfs4_pnfs_ds_add(struct inode *inode, struct nfs4_pnfs_ds **dsp,if (!ds)return ; -/* Initialize ds */ - ds->ds_ip_addr = ip_addr; - ds->ds_port = port; -strncpy (ds->r_addr, r_addr, len); -atomic_set (&ds->ds_count,1 ); -INIT_LIST_HEAD (&ds->ds_node); - ds->ds_clp =NULL ; -spin_lock (&nfs4_ds_cache_lock); tmp_ds =_data_server_lookup (ip_addr, port);if (tmp_ds ==NULL ) { -dprintk ("%s add new data server ip 0x%x\n" , __func__, - ds->ds_ip_addr); + ds->ds_ip_addr = ip_addr; + ds->ds_port = port; +strncpy (ds->r_addr, r_addr, len); +atomic_set (&ds->ds_count,1 ); +INIT_LIST_HEAD (&ds->ds_node); + ds->ds_clp =NULL ;list_add (&ds->ds_node, &nfs4_data_server_cache); *dsp = ds; +dprintk ("%s add new data server ip 0x%x\n" , __func__, + ds->ds_ip_addr); +spin_unlock (&nfs4_ds_cache_lock); }else {atomic_inc (&tmp_ds->ds_count); + *dsp = tmp_ds;dprintk ("%s data server found ip 0x%x, inc'ed ds_count to %d\n" , __func__, tmp_ds->ds_ip_addr,atomic_read (&tmp_ds->ds_count)); - *dsp = tmp_ds; +spin_unlock (&nfs4_ds_cache_lock); +kfree (ds); } -spin_unlock (&nfs4_ds_cache_lock); -if (tmp_ds !=NULL ) -destroy_ds (ds); } static struct nfs4_pnfs_ds *
Signature · 1 line
1.6.6
Re: [PATCH 07/13] SQUASHME pnfs_submit: remove struct pnfs_mount_type
In reply to [email protected]Quoted 6 lines · On 04/29/2010 01:24 AM, [email protected] wrote:
From: Andy Adamson <[email protected]>
The
pnfs_mount_typestructure was used to store per layout type device id caches. It is no longer needed with the generic device id cache in structnfs_client.
Same here NACK
Quoted 157 lines
Signed-off-by Andy Adamson <[email protected]>--- fs/nfs/nfs4filelayout.c | 40 +++++++--------------------------------- fs/nfs/pnfs.c | 8 ++------ include/linux/nfs4_pnfs.h | 15 +-------------- include/linux/nfs_fs_sb.h | 2 -- 4 files changed, 10 insertions(+), 55 deletions(-)fs/nfs/nfs4filelayout.c +7
-33@@ -68,45 +68,19 @@ struct pnfs_client_operations *pnfs_callback_ops;ssize_t filelayout_get_stripesize (struct pnfs_layout_type *);struct layoutdriver_io_operations filelayout_io_operations; -/* Initialize and return the pnfs_mount_type structure so the -* pNFS_client can refer to the mount point later on -*/ -struct pnfs_mount_type * +int filelayout_initialize_mountpoint (struct super_block *sb,struct nfs_fh *fh) { -struct filelayout_mount_type *fl_mt; -struct pnfs_mount_type *mt; - - fl_mt =kmalloc (sizeof (struct filelayout_mount_type ),GFP_KERNEL ); -if (!fl_mt) - goto error_ret; - - mt =kmalloc (sizeof (struct pnfs_mount_type ),GFP_KERNEL ); -if (!mt) - goto cleanup_fl_mt; - - fl_mt->fl_sb = sb; - mt->mountid = (void *)fl_mt;if (nfs4_alloc_init_deviceid_cache (NFS_SB (sb)->nfs_client, - nfs4_fl_free_deviceid_callback)) - goto cleanup_mt; - + nfs4_fl_free_deviceid_callback)) { +printk (KERN_WARNING "%s: deviceid cache could not be " +"initialized\n" , __func__); +return 0 ; + }dprintk ("%s: deviceid cache has been initialized successfully\n" , __func__); -return mt; - -cleanup_mt: ; -kfree (mt); - -cleanup_fl_mt: ; -kfree (fl_mt); - -error_ret: ; -printk (KERN_WARNING "%s: deviceid cache could not be initialized\n" , - __func__); - -return NULL ; +return 1 ; }/* This function is used by the layout driver to calculate the fs/nfs/pnfs.c +2
-6@@ -207,16 +207,14 @@ void set_pnfs_layoutdriver(struct super_block *sb, struct nfs_fh *fh, u32 id) { struct pnfs_module *mod; -struct pnfs_mount_type *mt;struct nfs_server *server =NFS_SB (sb);if (server->pnfs_curr_ld)return ;if (id >0 &&find_pnfs (id, &mod)) { - mt = mod->pnfs_ld_type->ld_io_ops->initialize_mountpoint ( - sb, fh); -if (!mt) { +if (!mod->pnfs_ld_type->ld_io_ops->initialize_mountpoint ( + sb, fh)) {printk (KERN_ERR "%s: Error initializing mount point " "for layout driver %u. " , __func__, id); goto out_err;@@ -226,7 +224,6 @@ set_pnfs_layoutdriver(struct super_block *sb, struct nfs_fh *fh, u32 id)* and has taken a reference on the nfs_client cl_devid_cache */ server->pnfs_curr_ld = mod->pnfs_ld_type; - server->pnfs_mountid = mt; server->nfs_client->rpc_ops = &pnfs_v4_clientops;dprintk ("%s: pNFS module for %u set\n" , __func__, id);return ;@@ -236,7 +233,6 @@ set_pnfs_layoutdriver(struct super_block *sb, struct nfs_fh *fh, u32 id) out_err:dprintk ("Using NFSv4 I/O\n" ); server->pnfs_curr_ld =NULL ; - server->pnfs_mountid =NULL ;return ; }include/linux/nfs4_pnfs.h +1
-14@@ -30,13 +30,6 @@ struct pnfs_layoutdriver_type {struct layoutdriver_policy_operations *ld_policy_ops; }; -/* Layout driver specific identifier for a mount point. For each mountpoint -* a reference is stored in the nfs_server structure. -*/ -struct pnfs_mount_type { -void *mountid; -}; -struct pnfs_fsdata {int ok_to_use_pnfs;struct pnfs_layout_segment *lseg;@@ -62,12 +55,6 @@ PNFS_NFS_SERVER(struct pnfs_layout_type *lo)return NFS_SERVER (PNFS_INODE (lo)); } -static inline struct pnfs_mount_type * -PNFS_MOUNTID (struct pnfs_layout_type *lo) -{ -return NFS_SERVER (PNFS_INODE (lo))->pnfs_mountid; -} -static inline void *PNFS_LD_DATA (struct pnfs_layout_type *lo) {@@ -181,7 +168,7 @@ struct layoutdriver_io_operations {/* Registration information for a new mounted file system */ -struct pnfs_mount_type * (*initialize_mountpoint) (struct super_block *,struct nfs_fh *fh); +int (*initialize_mountpoint) (struct super_block *,struct nfs_fh *fh); };enum layoutdriver_policy_flags {include/linux/nfs_fs_sb.h +0
-2@@ -165,8 +165,6 @@ struct nfs_server {#ifdef CONFIG_NFS_V4_1 u32 pnfs_fs_ltype;/* fs_layouttype attr */ struct pnfs_layoutdriver_type *pnfs_curr_ld;/* Active layout driver */ -struct pnfs_mount_type *pnfs_mountid;/* Mount identifier for -layout driver */ #endif /* CONFIG_NFS_V4_1 */ void (*destroy)(struct nfs_server *);
Boaz Harrosh
NAKRe: [PATCH 06/13] SQUASHME pnfs_submit: remove uninitialize_mountpoint
In reply to [email protected]Quoted 8 lines · On 04/29/2010 01:24 AM, [email protected] wrote:
From: Andy Adamson <[email protected]>
The
layoutdriver_io_operationsuninitialize_mountpointfunction is used to free a layout driver specific device id cache.
The device id cache is now shared and moved to structnfs_clientand can be removed in the genericunmount_pnfs_layoutdriverroutine.Signed-off-by Andy Adamson <[email protected]>
What ? no.
uninitialize_mountpoint is where the mountid private data is deallocated. The one that was allocated at initialize_mountpoint.
Files layout might not currently have any, but we do and it will has well. Any way what kind of API has initialize call and not an uninitialize call Even if it's empty
NACK
Quoted 76 lines
--- fs/nfs/nfs4filelayout.c | 18 ------------------ fs/nfs/pnfs.c | 11 +++-------- include/linux/nfs4_pnfs.h | 1 - 3 files changed, 3 insertions(+), 27 deletions(-)fs/nfs/nfs4filelayout.c +0
-18@@ -109,23 +109,6 @@ error_ret: ;return NULL ; } -/* Uninitialize a mountpoint by destroying its device list. -*/ -int -filelayout_uninitialize_mountpoint (struct pnfs_mount_type *mountid) -{ -struct filelayout_mount_type *fl_mt =NULL ; - -dprintk ("--> %s\n" , __func__); -if (mountid) { - fl_mt = (struct filelayout_mount_type *)mountid->mountid; -nfs4_put_deviceid_cache (NFS_SB (fl_mt->fl_sb)->nfs_client); -kfree (fl_mt); -kfree (mountid); - } -return 0 ; -} -/* This function is used by the layout driver to calculate the * offset of the file on the dserver based on whether the * layout type is STRIPE_DENSE or STRIPE_SPARSE @@ -782,7 +765,6 @@ struct layoutdriver_io_operations filelayout_io_operations = { .alloc_lseg = filelayout_alloc_lseg, .free_lseg = filelayout_free_lseg, .initialize_mountpoint = filelayout_initialize_mountpoint, - .uninitialize_mountpoint = filelayout_uninitialize_mountpoint, };struct layoutdriver_policy_operations filelayout_policy_operations = {fs/nfs/pnfs.c +3
-8@@ -194,14 +194,9 @@ pnfs_update_last_write(struct nfs_inode *nfsi, loff_t offset, size_t extent)void unmount_pnfs_layoutdriver (struct super_block *sb) { -struct nfs_server *server =NFS_SB (sb); -if (server->pnfs_curr_ld && - server->pnfs_curr_ld->ld_io_ops && - server->pnfs_curr_ld->ld_io_ops->uninitialize_mountpoint) { - server->pnfs_curr_ld->ld_io_ops->uninitialize_mountpoint ( - server->pnfs_mountid); - server->pnfs_mountid =NULL ; - } +if (NFS_SB (sb)->pnfs_curr_ld &&NFS_SB (sb)->nfs_client->cl_devid_cache) +nfs4_put_deviceid_cache (NFS_SB (sb)->nfs_client); +NFS_SB (sb)->pnfs_curr_ld =NULL ; }/* include/linux/nfs4_pnfs.h +0
-1@@ -182,7 +182,6 @@ struct layoutdriver_io_operations {/* Registration information for a new mounted file system */ struct pnfs_mount_type * (*initialize_mountpoint) (struct super_block *,struct nfs_fh *fh); -int (*uninitialize_mountpoint) (struct pnfs_mount_type *mountid); };enum layoutdriver_policy_flags {
Re: [PATCH 06/13] SQUASHME pnfs_submit: remove uninitialize_mountpoint
Quoted 12 lines · Boaz Harrosh
Quoted 8 lines · On 04/29/2010 01:24 AM, [email protected] wrote:
From: Andy Adamson <[email protected]>
The
layoutdriver_io_operationsuninitialize_mountpointfunction is used to free a layout driver specific device id cache.
The device id cache is now shared and moved to structnfs_clientand can be removed in the genericunmount_pnfs_layoutdriverroutine.Signed-off-by Andy Adamson <[email protected]>What ? no.
Quoted 9 lines
uninitialize_mountpointis where the mountid private data is deallocated. The one that was allocated atinitialize_mountpoint.Files layout might not currently have any, but we do and it will has well. Any way what kind of API has initialize call and not an uninitialize call Even if it's empty
NACK
You are right that currently it's only device cache things. But I have code in Q that have a page pool cache for RAID5/6 IO, and other initialization I need.
Please keep the initialize and a symmetric uninitialize and keep some private data for each sb. It does not cost any thing. You could get rid of the double indirection though.
Thanks
Boaz
Re: [PATCH 06/13] SQUASHME pnfs_submit: remove uninitialize_mountpoint
Quoted 23 lines · Boaz Harrosh
Quoted 12 lines · Boaz Harrosh
Quoted 8 lines · On 04/29/2010 01:24 AM, [email protected] wrote:
From: Andy Adamson <[email protected]>
The
layoutdriver_io_operationsuninitialize_mountpointfunction is used to free a layout driver specific device id cache.
The device id cache is now shared and moved to structnfs_clientand can be removed in the genericunmount_pnfs_layoutdriverroutine.Signed-off-by Andy Adamson <[email protected]>What ? no.
Quoted 9 lines
uninitialize_mountpointis where the mountid private data is deallocated. The one that was allocated atinitialize_mountpoint.Files layout might not currently have any, but we do and it will has well. Any way what kind of API has initialize call and not an uninitialize call Even if it's empty
NACK
Quoted 6 lines
You are right that currently it's only device cache things. But I have code in Q that have a page pool cache for RAID5/6 IO, and other initialization I need.
Please keep the initialize and a symmetric uninitialize and keep some private data for each sb. It does not cost any thing. You could get rid of the double indirection though.
OK. I'll keep the uninitialize_mountpoint. A private data pointer will be put back in the object layout driver submission. I will provide the patches.
-->Andy
Quoted 3 lines
Thanks
Boaz
Re: [PATCH 06/13] SQUASHME pnfs_submit: remove uninitialize_mountpoint
Quoted 42 lines · Andy Adamson
Quoted 33 lines · Boaz Harrosh
Quoted 18 lines · Boaz Harrosh
Quoted 10 lines · On 04/29/2010 01:24 AM, [email protected] wrote:
From: Andy Adamson <[email protected]>
The
layoutdriver_io_operationsuninitialize_mountpointfunction is used
to free a layout driver specific device id cache.
The device id cache is now shared and moved to structnfs_clientand can be
removed in the genericunmount_pnfs_layoutdriverroutine.Signed-off-by Andy Adamson <[email protected]>What ? no.
uninitialize_mountpointis where the mountid private data is deallocated.
The one that was allocated atinitialize_mountpoint.Quoted 8 lines
Files layout might not currently have any, but we do and it will has well.
Any way what kind of API has initialize call and not an uninitialize call
Even if it's emptyNACK
You are right that currently it's only device cache things. But I have code in
Q that have a page pool cache for RAID5/6 IO, and other initialization I need.Quoted 5 lines
Please keep the initialize and a symmetric uninitialize and keep some private
data for each sb. It does not cost any thing. You could get rid of the double
indirection though.
Quoted 10 lines
OK. I'll keep the
uninitialize_mountpoint. A private data pointer will be put back in the object layout driver submission. I will provide the patches.-->Andy
Quoted 3 lines
Thanks
Boaz
Thanks