@@ -755,72 +755,12 @@ filelayout_free_lseg(struct pnfs_layout_segment *lseg)
755755 flo = FILELAYOUT_FROM_HDR (lseg -> pls_layout );
756756 inode = flo -> generic_hdr .plh_inode ;
757757 spin_lock (& inode -> i_lock );
758- flo -> commit_info .nbuckets = 0 ;
759- kfree (flo -> commit_info .buckets );
760- flo -> commit_info .buckets = NULL ;
761758 pnfs_generic_ds_cinfo_release_lseg (& flo -> commit_info , lseg );
762759 spin_unlock (& inode -> i_lock );
763760 }
764761 _filelayout_free_lseg (fl );
765762}
766763
767- static int
768- filelayout_alloc_commit_info (struct pnfs_layout_segment * lseg ,
769- struct nfs_commit_info * cinfo ,
770- gfp_t gfp_flags )
771- {
772- struct nfs4_filelayout_segment * fl = FILELAYOUT_LSEG (lseg );
773- struct pnfs_commit_bucket * buckets ;
774- int size , i ;
775-
776- if (fl -> commit_through_mds )
777- return 0 ;
778-
779- size = (fl -> stripe_type == STRIPE_SPARSE ) ?
780- fl -> dsaddr -> ds_num : fl -> dsaddr -> stripe_count ;
781-
782- if (cinfo -> ds -> nbuckets >= size ) {
783- /* This assumes there is only one IOMODE_RW lseg. What
784- * we really want to do is have a layout_hdr level
785- * dictionary of <multipath_list4, fh> keys, each
786- * associated with a struct list_head, populated by calls
787- * to filelayout_write_pagelist().
788- * */
789- return 0 ;
790- }
791-
792- buckets = kcalloc (size , sizeof (struct pnfs_commit_bucket ),
793- gfp_flags );
794- if (!buckets )
795- return - ENOMEM ;
796- for (i = 0 ; i < size ; i ++ ) {
797- INIT_LIST_HEAD (& buckets [i ].written );
798- INIT_LIST_HEAD (& buckets [i ].committing );
799- /* mark direct verifier as unset */
800- buckets [i ].direct_verf .committed = NFS_INVALID_STABLE_HOW ;
801- }
802-
803- spin_lock (& cinfo -> inode -> i_lock );
804- if (cinfo -> ds -> nbuckets >= size )
805- goto out ;
806- for (i = 0 ; i < cinfo -> ds -> nbuckets ; i ++ ) {
807- list_splice (& cinfo -> ds -> buckets [i ].written ,
808- & buckets [i ].written );
809- list_splice (& cinfo -> ds -> buckets [i ].committing ,
810- & buckets [i ].committing );
811- buckets [i ].direct_verf .committed =
812- cinfo -> ds -> buckets [i ].direct_verf .committed ;
813- buckets [i ].wlseg = cinfo -> ds -> buckets [i ].wlseg ;
814- buckets [i ].clseg = cinfo -> ds -> buckets [i ].clseg ;
815- }
816- swap (cinfo -> ds -> buckets , buckets );
817- cinfo -> ds -> nbuckets = size ;
818- out :
819- spin_unlock (& cinfo -> inode -> i_lock );
820- kfree (buckets );
821- return 0 ;
822- }
823-
824764static struct pnfs_layout_segment *
825765filelayout_alloc_lseg (struct pnfs_layout_hdr * layoutid ,
826766 struct nfs4_layoutget_res * lgr ,
@@ -943,9 +883,6 @@ static void
943883filelayout_pg_init_write (struct nfs_pageio_descriptor * pgio ,
944884 struct nfs_page * req )
945885{
946- struct nfs_commit_info cinfo ;
947- int status ;
948-
949886 pnfs_generic_pg_check_layout (pgio );
950887 if (!pgio -> pg_lseg ) {
951888 pgio -> pg_lseg = fl_pnfs_update_layout (pgio -> pg_inode ,
@@ -964,17 +901,7 @@ filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio,
964901
965902 /* If no lseg, fall back to write through mds */
966903 if (pgio -> pg_lseg == NULL )
967- goto out_mds ;
968- nfs_init_cinfo (& cinfo , pgio -> pg_inode , pgio -> pg_dreq );
969- status = filelayout_alloc_commit_info (pgio -> pg_lseg , & cinfo , GFP_NOFS );
970- if (status < 0 ) {
971- pnfs_put_lseg (pgio -> pg_lseg );
972- pgio -> pg_lseg = NULL ;
973- goto out_mds ;
974- }
975- return ;
976- out_mds :
977- nfs_pageio_reset_write_mds (pgio );
904+ nfs_pageio_reset_write_mds (pgio );
978905}
979906
980907static const struct nfs_pageio_ops filelayout_pg_read_ops = {
0 commit comments