[PATCH] cleanup layout_{recall,return}_type declarations
Benny Halevy
bhalevy at ns1.bhalevy.com
Mon May 7 09:12:22 EDT 2007
---
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 fdb1dd8..ad0044d 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 5e1b9ca..a83c472 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1707,7 +1707,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 b2d0d45..8decb39 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -373,7 +373,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 856e39a..e33faa9 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3842,7 +3842,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 */
@@ -4037,7 +4037,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 ffa1a10..3ec71f9 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1312,7 +1312,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 483845f..43c3b02 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -461,10 +461,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 {
@@ -473,11 +480,6 @@ enum pnfs_iomode {
IOMODE_ANY = 3,
};
-enum file_layout_device_type {
- FILE_SIMPLE = 1,
- FILE_COMPLEX = 2
-};
-
#endif /* CONFIG_PNFS */
#endif
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 83b078c..92feae0 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -220,18 +220,13 @@ struct nfs4_client {
u32 cl_session_flags;
};
-#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
--------------050202010001060109000709--
More information about the pNFS
mailing list