[pnfs] [PATCH 5/8] pnfs: pnfs_redirty_request
Fred Isaman
iisaman at citi.umich.edu
Thu May 1 09:02:14 EDT 2008
If a request fails to flush and needs to be redirtied, make sure we
retry using straight NFS.
Note that some drivers may prefer to have better control over whether
a retry goes to mds or data server, eventually a policy op will be
needed here.
Signed-off-by: Fred Isaman <iisaman at citi.umich.edu>
---
fs/nfs/pnfs.h | 9 +++++++++
fs/nfs/write.c | 1 +
include/linux/nfs_page.h | 1 +
3 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 696cdf7..edbe85f 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -150,6 +150,11 @@ static inline void pnfs_write_end_cleanup(void *fsdata)
pnfs_free_fsdata(fsdata);
}
+static inline void pnfs_redirty_request(struct nfs_page *req)
+{
+ clear_bit(PG_USE_PNFS, &req->wb_flags);
+}
+
#else /* CONFIG_PNFS */
static inline int pnfs_try_to_read_data(struct nfs_read_data *data,
@@ -185,6 +190,10 @@ static inline void pnfs_write_end_cleanup(void *fsdata)
{
}
+static inline void pnfs_redirty_request(struct nfs_page *req)
+{
+}
+
#endif /* CONFIG_PNFS */
#endif /* FS_NFS_PNFS_H */
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index e3abd97..adb21c0 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -881,6 +881,7 @@ static int nfs_write_rpcsetup(struct nfs_page *req,
*/
static void nfs_redirty_request(struct nfs_page *req)
{
+ pnfs_redirty_request(req);
nfs_mark_request_dirty(req);
nfs_end_page_writeback(req->wb_page);
nfs_clear_page_tag_locked(req);
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index fa769ef..0e36e68 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -30,6 +30,7 @@
#define PG_BUSY 0
#define PG_NEED_COMMIT 1
#define PG_NEED_RESCHED 2
+#define PG_USE_PNFS 3
struct nfs_inode;
struct nfs_page {
--
1.5.3.3
More information about the pNFS
mailing list