diff options
-rw-r--r-- | fs/nfs/inode.c | 12 | ||||
-rw-r--r-- | fs/nfs/write.c | 24 | ||||
-rw-r--r-- | include/linux/nfs_fs.h | 7 |
3 files changed, 23 insertions, 20 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 7f9ecc46f3fb..89e98312599d 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -97,18 +97,6 @@ u64 nfs_compat_user_ino64(u64 fileid) | |||
97 | return ino; | 97 | return ino; |
98 | } | 98 | } |
99 | 99 | ||
100 | int nfs_write_inode(struct inode *inode, struct writeback_control *wbc) | ||
101 | { | ||
102 | int ret; | ||
103 | |||
104 | ret = nfs_commit_inode(inode, | ||
105 | wbc->sync_mode == WB_SYNC_ALL ? FLUSH_SYNC : 0); | ||
106 | if (ret >= 0) | ||
107 | return 0; | ||
108 | __mark_inode_dirty(inode, I_DIRTY_DATASYNC); | ||
109 | return ret; | ||
110 | } | ||
111 | |||
112 | void nfs_clear_inode(struct inode *inode) | 100 | void nfs_clear_inode(struct inode *inode) |
113 | { | 101 | { |
114 | /* | 102 | /* |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index d63d964a0392..09e97097baaa 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1391,7 +1391,7 @@ static const struct rpc_call_ops nfs_commit_ops = { | |||
1391 | .rpc_release = nfs_commit_release, | 1391 | .rpc_release = nfs_commit_release, |
1392 | }; | 1392 | }; |
1393 | 1393 | ||
1394 | int nfs_commit_inode(struct inode *inode, int how) | 1394 | static int nfs_commit_inode(struct inode *inode, int how) |
1395 | { | 1395 | { |
1396 | LIST_HEAD(head); | 1396 | LIST_HEAD(head); |
1397 | int res; | 1397 | int res; |
@@ -1406,13 +1406,35 @@ int nfs_commit_inode(struct inode *inode, int how) | |||
1406 | } | 1406 | } |
1407 | return res; | 1407 | return res; |
1408 | } | 1408 | } |
1409 | |||
1410 | static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_control *wbc) | ||
1411 | { | ||
1412 | int ret; | ||
1413 | |||
1414 | ret = nfs_commit_inode(inode, | ||
1415 | wbc->sync_mode == WB_SYNC_ALL ? FLUSH_SYNC : 0); | ||
1416 | if (ret >= 0) | ||
1417 | return 0; | ||
1418 | __mark_inode_dirty(inode, I_DIRTY_DATASYNC); | ||
1419 | return ret; | ||
1420 | } | ||
1409 | #else | 1421 | #else |
1410 | static inline int nfs_commit_list(struct inode *inode, struct list_head *head, int how) | 1422 | static inline int nfs_commit_list(struct inode *inode, struct list_head *head, int how) |
1411 | { | 1423 | { |
1412 | return 0; | 1424 | return 0; |
1413 | } | 1425 | } |
1426 | |||
1427 | static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_control *wbc) | ||
1428 | { | ||
1429 | return 0; | ||
1430 | } | ||
1414 | #endif | 1431 | #endif |
1415 | 1432 | ||
1433 | int nfs_write_inode(struct inode *inode, struct writeback_control *wbc) | ||
1434 | { | ||
1435 | return nfs_commit_unstable_pages(inode, wbc); | ||
1436 | } | ||
1437 | |||
1416 | long nfs_sync_mapping_wait(struct address_space *mapping, struct writeback_control *wbc, int how) | 1438 | long nfs_sync_mapping_wait(struct address_space *mapping, struct writeback_control *wbc, int how) |
1417 | { | 1439 | { |
1418 | struct inode *inode = mapping->host; | 1440 | struct inode *inode = mapping->host; |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index d09db1bc9083..384ea3ef2863 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -483,15 +483,8 @@ extern int nfs_wb_nocommit(struct inode *inode); | |||
483 | extern int nfs_wb_page(struct inode *inode, struct page* page); | 483 | extern int nfs_wb_page(struct inode *inode, struct page* page); |
484 | extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); | 484 | extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); |
485 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 485 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
486 | extern int nfs_commit_inode(struct inode *, int); | ||
487 | extern struct nfs_write_data *nfs_commitdata_alloc(void); | 486 | extern struct nfs_write_data *nfs_commitdata_alloc(void); |
488 | extern void nfs_commit_free(struct nfs_write_data *wdata); | 487 | extern void nfs_commit_free(struct nfs_write_data *wdata); |
489 | #else | ||
490 | static inline int | ||
491 | nfs_commit_inode(struct inode *inode, int how) | ||
492 | { | ||
493 | return 0; | ||
494 | } | ||
495 | #endif | 488 | #endif |
496 | 489 | ||
497 | static inline int | 490 | static inline int |