NFS: Remove pnfs_generic_transfer_commit_list()

It's pretty much a duplicate of nfs_scan_commit_list() that also
clears the PG_COMMIT_TO_DS flag.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>

+4 -41
+2 -41
fs/nfs/pnfs_nfs.c
··· 88 EXPORT_SYMBOL_GPL(pnfs_generic_clear_request_commit); 89 90 static int 91 - pnfs_generic_transfer_commit_list(struct list_head *src, struct list_head *dst, 92 - struct nfs_commit_info *cinfo, int max) 93 - { 94 - struct nfs_page *req, *tmp; 95 - int ret = 0; 96 - 97 - restart: 98 - list_for_each_entry_safe(req, tmp, src, wb_list) { 99 - kref_get(&req->wb_kref); 100 - if (!nfs_lock_request(req)) { 101 - int status; 102 - 103 - /* Prevent deadlock with nfs_lock_and_join_requests */ 104 - if (!list_empty(dst)) { 105 - nfs_release_request(req); 106 - continue; 107 - } 108 - /* Ensure we make progress to prevent livelock */ 109 - mutex_unlock(&NFS_I(cinfo->inode)->commit_mutex); 110 - status = nfs_wait_on_request(req); 111 - nfs_release_request(req); 112 - mutex_lock(&NFS_I(cinfo->inode)->commit_mutex); 113 - if (status < 0) 114 - break; 115 - goto restart; 116 - } 117 - nfs_request_remove_commit_list(req, cinfo); 118 - clear_bit(PG_COMMIT_TO_DS, &req->wb_flags); 119 - nfs_list_add_request(req, dst); 120 - ret++; 121 - if ((ret == max) && !cinfo->dreq) 122 - break; 123 - cond_resched(); 124 - } 125 - return ret; 126 - } 127 - 128 - static int 129 pnfs_generic_scan_ds_commit_list(struct pnfs_commit_bucket *bucket, 130 struct nfs_commit_info *cinfo, 131 int max) ··· 97 int ret; 98 99 lockdep_assert_held(&NFS_I(cinfo->inode)->commit_mutex); 100 - ret = pnfs_generic_transfer_commit_list(src, dst, cinfo, max); 101 if (ret) { 102 cinfo->ds->nwritten -= ret; 103 cinfo->ds->ncommitting += ret; ··· 142 lockdep_assert_held(&NFS_I(cinfo->inode)->commit_mutex); 143 restart: 144 for (i = 0, b = cinfo->ds->buckets; i < cinfo->ds->nbuckets; i++, b++) { 145 - nwritten = pnfs_generic_transfer_commit_list(&b->written, 146 - dst, cinfo, 0); 147 if (!nwritten) 148 continue; 149 cinfo->ds->nwritten -= nwritten;
··· 88 EXPORT_SYMBOL_GPL(pnfs_generic_clear_request_commit); 89 90 static int 91 pnfs_generic_scan_ds_commit_list(struct pnfs_commit_bucket *bucket, 92 struct nfs_commit_info *cinfo, 93 int max) ··· 135 int ret; 136 137 lockdep_assert_held(&NFS_I(cinfo->inode)->commit_mutex); 138 + ret = nfs_scan_commit_list(src, dst, cinfo, max); 139 if (ret) { 140 cinfo->ds->nwritten -= ret; 141 cinfo->ds->ncommitting += ret; ··· 180 lockdep_assert_held(&NFS_I(cinfo->inode)->commit_mutex); 181 restart: 182 for (i = 0, b = cinfo->ds->buckets; i < cinfo->ds->nbuckets; i++, b++) { 183 + nwritten = nfs_scan_commit_list(&b->written, dst, cinfo, 0); 184 if (!nwritten) 185 continue; 186 cinfo->ds->nwritten -= nwritten;
+2
fs/nfs/write.c
··· 1052 goto restart; 1053 } 1054 nfs_request_remove_commit_list(req, cinfo); 1055 nfs_list_add_request(req, dst); 1056 ret++; 1057 if ((ret == max) && !cinfo->dreq) ··· 1061 } 1062 return ret; 1063 } 1064 1065 /* 1066 * nfs_scan_commit - Scan an inode for commit requests
··· 1052 goto restart; 1053 } 1054 nfs_request_remove_commit_list(req, cinfo); 1055 + clear_bit(PG_COMMIT_TO_DS, &req->wb_flags); 1056 nfs_list_add_request(req, dst); 1057 ret++; 1058 if ((ret == max) && !cinfo->dreq) ··· 1060 } 1061 return ret; 1062 } 1063 + EXPORT_SYMBOL_GPL(nfs_scan_commit_list); 1064 1065 /* 1066 * nfs_scan_commit - Scan an inode for commit requests