[pnfs] [PATCH 08/10] pnfs_use_rpc allows the common pnfs code to
Dean Hildebrand
seattleplus at gmail.com
Tue Jul 8 17:54:04 EDT 2008
Currently this is needed to determine
that non-rpc layout drivers do not wait
on direct I/O requests using
nfs_direct_wait.
Signed-off-by: Dean Hildebrand <dhildeb at us.ibm.com>
---
fs/nfs/pnfs.c | 2 +-
fs/nfs/pnfs.h | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 8d2ed6f..d0dc2d5 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1401,7 +1401,7 @@ pnfs_set_ds_iosize(struct nfs_server *server)
}
/* Should the full nfs rpc cleanup code be used after io */
-static int pnfs_use_rpc_code(struct pnfs_layoutdriver_type *ld)
+int pnfs_use_rpc_code(struct pnfs_layoutdriver_type *ld)
{
if (ld->ld_policy_ops->use_rpc_code)
return ld->ld_policy_ops->use_rpc_code();
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index ffd7153..2d9ade1 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -77,6 +77,7 @@ void _pnfs_modify_new_write_request(struct nfs_page *req,
void _pnfs_direct_init_io(struct inode *inode, struct nfs_open_context *ctx,
size_t count, loff_t loff, int iswrite,
size_t *rwsize, size_t *remaining);
+int pnfs_use_rpc_code(struct pnfs_layoutdriver_type *ld);
#define PNFS_EXISTS_LDIO_OP(srv, opname) ((srv)->pnfs_curr_ld && \
(srv)->pnfs_curr_ld->ld_io_ops && \
@@ -225,6 +226,14 @@ static inline void pnfs_direct_init_io(struct inode *inode,
return;
}
+static inline int pnfs_use_rpc(struct nfs_server *nfss)
+{
+ if (pnfs_enabled_sb(nfss))
+ return pnfs_use_rpc_code(nfss->pnfs_curr_ld);
+
+ return 1;
+}
+
#else /* CONFIG_PNFS */
static inline int pnfs_try_to_read_data(struct nfs_read_data *data,
@@ -286,6 +295,11 @@ static inline void pnfs_direct_init_io(struct inode *inode,
{
}
+static inline int pnfs_use_rpc(struct nfs_server *nfss)
+{
+ return 1;
+}
+
#endif /* CONFIG_PNFS */
#endif /* FS_NFS_PNFS_H */
--
1.5.3.3
More information about the pNFS
mailing list