[pnfs] [PATCH 2/9] cleanup layout_{recall, return}_type declarations

Benny Halevy bhalevy at panasas.com
Sun May 27 05:27:23 EDT 2007


Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
 fs/nfs/callback.h          |    6 ------
 fs/nfs/nfs4xdr.c           |    2 +-
 fs/nfs/pnfs.c              |    2 +-
 fs/nfsd/nfs4state.c        |    4 ++--
 fs/nfsd/nfs4xdr.c          |    2 +-
 include/linux/nfs4.h       |   18 ++++++++++--------
 include/linux/nfs4_pnfs.h  |    5 +++++
 include/linux/nfsd/state.h |    9 ++-------
 8 files changed, 22 insertions(+), 26 deletions(-)

diff --git a/fs/nfs/callback.h b/fs/nfs/callback.h
index 8846839..aedc094 100644
--- a/fs/nfs/callback.h
+++ b/fs/nfs/callback.h
@@ -60,12 +60,6 @@ struct cb_recallargs {
 	uint32_t truncate;
 };
 
-enum layout_recall_type {
-	RECALL_FILE = 1,
-	RECALL_FSID = 2,
-	RECALL_ALL  = 3
-};
-
 struct cb_pnfs_layoutrecallargs {
 	struct sockaddr_in	*cbl_addr;
 	struct nfs_fh		cbl_fh;
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index a75e815..5da7771 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1697,7 +1697,7 @@ static int encode_pnfs_layoutreturn(struct xdr_stream *xdr, const struct nfs4_pn
         WRITE32(args->layout_type);
         WRITE32(args->iomode);
         WRITE32(args->return_type);
-        if (args->return_type == LAYOUTRETURN_FILE)
+	if (args->return_type == RETURN_FILE)
         {
 		RESERVE_SPACE(16);
                 WRITE64(args->offset);
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 773ec96..45899b3 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -374,7 +374,7 @@ pnfs_return_layout(struct inode* ino)
 	arg.reclaim = 0;
 	arg.layout_type = server->pnfs_curr_ld->id;
 	arg.iomode = IOMODE_ANY /* for now */;
-	arg.return_type = LAYOUTRETURN_FILE;
+	arg.return_type = RETURN_FILE;
 	arg.offset = 0;
 	arg.length = ~0;
 	arg.inode = ino;
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 7fa9399..ddd1bc7 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3914,7 +3914,7 @@ free_nfs4_layout(struct kref *kref)
 	lr.lr_reclaim = 0;
 	lr.lr_layout_type = lp->lo_layout_type;
 	lr.lr_iomode = lp->lo_iomode;
-	lr.lr_return_type = LAYOUTRETURN_FILE;
+	lr.lr_return_type = RETURN_FILE;
 	lr.lr_offset = lp->lo_offset;
 	lr.lr_length = lp->lo_length;
 	lr.lr_flags = 0; /* last return */
@@ -4109,7 +4109,7 @@ int nfs4_pnfs_get_layout(struct super_block *sb, struct svc_fh *current_fh,
 		lr.lr_reclaim = 0;
 		lr.lr_layout_type = lgp->lg_type;
 		lr.lr_iomode = lgp->lg_iomode;
-		lr.lr_return_type = LAYOUTRETURN_FILE;
+		lr.lr_return_type = RETURN_FILE;
 		lr.lr_offset = lgp->lg_offset;
 		lr.lr_length = lgp->lg_length;
 		lr.lr_flags = lgp->lg_flags;
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index deb1fb8..845c3a3 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1297,7 +1297,7 @@ nfsd4_decode_layoutreturn(struct nfsd4_compoundargs *argp, struct nfsd4_pnfs_lay
 	READ32(lrp->lr_layout_type);
 	READ32(lrp->lr_iomode);
 	READ32(lrp->lr_return_type);
-	if (lrp->lr_return_type == LAYOUTRETURN_FILE)
+	if (lrp->lr_return_type == RETURN_FILE)
 	{
 		READ64(lrp->lr_offset);
 		READ64(lrp->lr_length);
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 54ec6fd..eac1f3e 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -462,10 +462,17 @@ enum pnfs_layouttype {
 	LAYOUT_PVFS2        = 4
 };
 
+/* FIXME: should recall and return types be combined? */
+enum pnfs_layoutrecall_type {
+	RECALL_FILE = 1,
+	RECALL_FSID = 2,
+	RECALL_ALL  = 3
+};
+
 enum pnfs_layoutreturn_type {
-	LAYOUTRETURN_FILE = 1,
-	LAYOUTRETURN_FSID = 2,
-	LAYOUTRETURN_ALL = 3,
+	RETURN_FILE = 1,
+	RETURN_FSID = 2,
+	RETURN_ALL  = 3
 };
 
 enum pnfs_iomode {
@@ -474,11 +481,6 @@ enum pnfs_iomode {
 	IOMODE_ANY = 3,
 };
 
-enum file_layout_device_type {
-	FILE_SIMPLE  = 1,
-	FILE_COMPLEX = 2
-};
-
 #endif /* CONFIG_PNFS */
 
 /* Create Session Flags */
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index 16eb1f7..74d25fd 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -170,4 +170,9 @@ void pnfs_unregister_layoutdriver(struct pnfs_layoutdriver_type *);
 #define NFS4_PNFS_MAX_LAYOUTS 4
 #define NFS4_PNFS_PRIVATE_LAYOUT 0x80000000
 
+enum file_layout_device_type {
+	FILE_SIMPLE  = 1,
+	FILE_COMPLEX = 2
+};
+
 #endif /* LINUX_NFS4_PNFS_H */
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 9451880..78adcfc 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -230,18 +230,13 @@ struct nfs4_client {
 #endif
 };
 
-#ifdef CONFIG_PNFS
-enum layout_recall_type {
-	RECALL_FILE = 1,
-	RECALL_FSID = 2,
-	RECALL_ALL  = 3
-};
-
 struct nfs4_fsid {
 	u64	major;
 	u64 	minor;
 };
 
+#ifdef CONFIG_PNFS
+
 struct nfs4_cb_layout {
 	struct super_block	*cbl_sb;
 	struct nfs4_client	*cbl_client;
-- 
1.5.1



More information about the pNFS mailing list