diff options
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index bf672faa4885..dbc801810e75 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1357,6 +1357,21 @@ static void nfs_init_commit(struct nfs_write_data *data, | |||
1357 | nfs_fattr_init(&data->fattr); | 1357 | nfs_fattr_init(&data->fattr); |
1358 | } | 1358 | } |
1359 | 1359 | ||
1360 | static void nfs_retry_commit(struct list_head *page_list) | ||
1361 | { | ||
1362 | struct nfs_page *req; | ||
1363 | |||
1364 | while (!list_empty(page_list)) { | ||
1365 | req = nfs_list_entry(page_list->next); | ||
1366 | nfs_list_remove_request(req); | ||
1367 | nfs_mark_request_commit(req); | ||
1368 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); | ||
1369 | dec_bdi_stat(req->wb_page->mapping->backing_dev_info, | ||
1370 | BDI_RECLAIMABLE); | ||
1371 | nfs_clear_page_tag_locked(req); | ||
1372 | } | ||
1373 | } | ||
1374 | |||
1360 | /* | 1375 | /* |
1361 | * Commit dirty pages | 1376 | * Commit dirty pages |
1362 | */ | 1377 | */ |
@@ -1364,7 +1379,6 @@ static int | |||
1364 | nfs_commit_list(struct inode *inode, struct list_head *head, int how) | 1379 | nfs_commit_list(struct inode *inode, struct list_head *head, int how) |
1365 | { | 1380 | { |
1366 | struct nfs_write_data *data; | 1381 | struct nfs_write_data *data; |
1367 | struct nfs_page *req; | ||
1368 | 1382 | ||
1369 | data = nfs_commitdata_alloc(); | 1383 | data = nfs_commitdata_alloc(); |
1370 | 1384 | ||
@@ -1375,15 +1389,7 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how) | |||
1375 | nfs_init_commit(data, head); | 1389 | nfs_init_commit(data, head); |
1376 | return nfs_initiate_commit(data, NFS_CLIENT(inode), data->mds_ops, how); | 1390 | return nfs_initiate_commit(data, NFS_CLIENT(inode), data->mds_ops, how); |
1377 | out_bad: | 1391 | out_bad: |
1378 | while (!list_empty(head)) { | 1392 | nfs_retry_commit(head); |
1379 | req = nfs_list_entry(head->next); | ||
1380 | nfs_list_remove_request(req); | ||
1381 | nfs_mark_request_commit(req); | ||
1382 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); | ||
1383 | dec_bdi_stat(req->wb_page->mapping->backing_dev_info, | ||
1384 | BDI_RECLAIMABLE); | ||
1385 | nfs_clear_page_tag_locked(req); | ||
1386 | } | ||
1387 | nfs_commit_clear_lock(NFS_I(inode)); | 1393 | nfs_commit_clear_lock(NFS_I(inode)); |
1388 | return -ENOMEM; | 1394 | return -ENOMEM; |
1389 | } | 1395 | } |