diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-02-19 19:46:56 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-03-05 15:44:53 -0500 |
commit | 8fc795f703c5138e1a8bfb88c69f52632031aa6a (patch) | |
tree | aed975562fe5557ff552bc0fe45b5d2b6f5e56c9 /fs/nfs/write.c | |
parent | 9467c4fdd66f6810cecef0f1173330f3c6e67d45 (diff) |
NFS: Cleanup - move nfs_write_inode() into fs/nfs/write.c
The sole purpose of nfs_write_inode is to commit unstable writes, so
move it into fs/nfs/write.c, and make nfs_commit_inode static.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 24 |
1 files changed, 23 insertions, 1 deletions
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; |