From: Matthew Treinish <treinish@linux.vnet.ibm.com>
To: linux-nfs@vger.kernel.org
Cc: treinish@linux.vnet.ibm.com
Subject: [PATCH/RFC 2/7] Added support for FH_EXPIRE_TYPE attribute.
Date: Fri, 11 Nov 2011 18:04:27 -0500 [thread overview]
Message-ID: <1321052673-22171-3-git-send-email-treinish@linux.vnet.ibm.com> (raw)
In-Reply-To: <1321052673-22171-1-git-send-email-treinish@linux.vnet.ibm.com>
FH_EXPIRE_TYPE is used by the client to determine
what type of filehandle the server is providing for a
particular filesystem.
I added the bitmask to fsinfo since the bitmask is
set per filesystem.
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
---
fs/nfs/client.c | 2 ++
fs/nfs/nfs4proc.c | 3 ++-
fs/nfs/nfs4xdr.c | 27 +++++++++++++++++++++++++++
include/linux/nfs_fs_sb.h | 1 +
include/linux/nfs_xdr.h | 1 +
5 files changed, 33 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 873bf00..44dedfe 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -957,6 +957,8 @@ static void nfs_server_set_fsinfo(struct nfs_server *server,
server->time_delta = fsinfo->time_delta;
+ server->fhexpiretype = fsinfo->fhexpiretype;
+
/* We're airborne Set socket buffersize */
rpc_setbufsize(server->client, server->wsize + 100, server->rsize + 100);
}
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index b60fddf..86c273e 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -140,7 +140,8 @@ const u32 nfs4_pathconf_bitmap[2] = {
const u32 nfs4_fsinfo_bitmap[3] = { FATTR4_WORD0_MAXFILESIZE
| FATTR4_WORD0_MAXREAD
| FATTR4_WORD0_MAXWRITE
- | FATTR4_WORD0_LEASE_TIME,
+ | FATTR4_WORD0_LEASE_TIME
+ | FATTR4_WORD0_FH_EXPIRE_TYPE,
FATTR4_WORD1_TIME_DELTA
| FATTR4_WORD1_FS_LAYOUT_TYPES,
FATTR4_WORD2_LAYOUT_BLKSIZE
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index e6161b2..4d775e2 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -4508,6 +4508,30 @@ static int decode_attr_layout_blksize(struct xdr_stream *xdr, uint32_t *bitmap,
return 0;
}
+/*
+ * The VFH expire type bitmask
+ */
+
+static int decode_attr_fh_expire_type(struct xdr_stream *xdr, uint32_t *bitmap,
+ uint32_t *res)
+{
+ __be32 *p;
+
+ dprintk("%s: bitmap %x\n", __func__, bitmap[0]);
+ *res = 0;
+ if (bitmap[0] & FATTR4_WORD0_FH_EXPIRE_TYPE) {
+ p = xdr_inline_decode(xdr, 4);
+ if (unlikely(!p)) {
+ print_overflow_msg(__func__, xdr);
+ return -EIO;
+ }
+ *res = be32_to_cpup(p);
+ bitmap[0] &= ~FATTR4_WORD0_FH_EXPIRE_TYPE;
+ }
+ return 0;
+
+}
+
static int decode_fsinfo(struct xdr_stream *xdr, struct nfs_fsinfo *fsinfo)
{
__be32 *savep;
@@ -4523,6 +4547,9 @@ static int decode_fsinfo(struct xdr_stream *xdr, struct nfs_fsinfo *fsinfo)
fsinfo->rtmult = fsinfo->wtmult = 512; /* ??? */
+ if ((status = decode_attr_fh_expire_type(xdr, bitmap, &fsinfo->fhexpiretype)) != 0)
+ goto xdr_error;
+
if ((status = decode_attr_lease_time(xdr, bitmap, &fsinfo->lease_time)) != 0)
goto xdr_error;
if ((status = decode_attr_maxfilesize(xdr, bitmap, &fsinfo->maxfilesize)) != 0)
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index b5479df..706c92b 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -112,6 +112,7 @@ struct nfs_server {
unsigned int dtsize; /* readdir size */
unsigned short port; /* "port=" setting */
unsigned int bsize; /* server block size */
+ unsigned int fhexpiretype; /* VFH attributes */
unsigned int acregmin; /* attr cache timeouts */
unsigned int acregmax;
unsigned int acdirmin;
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index c74595b..72ba66b 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -123,6 +123,7 @@ struct nfs_fsinfo {
__u32 lease_time; /* in seconds */
__u32 layouttype; /* supported pnfs layout driver */
__u32 blksize; /* preferred pnfs io block size */
+ __u32 fhexpiretype; /* VFH attributes */
};
struct nfs_fsstat {
--
1.7.4.4
next prev parent reply other threads:[~2011-11-11 23:05 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-11 23:04 [PATCH/RFC 0/7] Volatile Filehandle Client-side Support Matthew Treinish
2011-11-11 23:04 ` [PATCH/RFC 1/7] New mount option for volatile filehandle recovery Matthew Treinish
2011-11-12 0:19 ` Trond Myklebust
2011-11-12 3:35 ` Malahal Naineni
2011-11-11 23:04 ` Matthew Treinish [this message]
2011-11-11 23:04 ` [PATCH/RFC 3/7] Add VFS objects from nfs4_proc calls into nfs4_exception Matthew Treinish
2011-11-11 23:04 ` [PATCH/RFC 4/7] Save root file handle in nfs_server Matthew Treinish
2011-11-11 23:04 ` [PATCH/RFC 5/7] Added VFH FHEXPIRED recovery functions Matthew Treinish
2011-11-12 0:27 ` Trond Myklebust
2011-11-12 3:45 ` Malahal Naineni
2011-11-12 17:16 ` Trond Myklebust
2011-11-14 21:12 ` Matthew Treinish
2011-11-11 23:04 ` [PATCH/RFC 6/7] Perform recovery on both inodes for rename Matthew Treinish
2011-11-11 23:04 ` [PATCH/RFC 7/7] Added error handling for NFS4ERR_FHEXPIRED Matthew Treinish
2011-11-11 23:04 ` [PATCH/RFC] Hard code testing on server <ONLY FOR TESTING> Matthew Treinish
2011-11-12 0:13 ` [PATCH/RFC 0/7] Volatile Filehandle Client-side Support Trond Myklebust
2011-11-12 14:49 ` Christoph Hellwig
2011-11-13 3:54 ` NeilBrown
2011-11-13 13:45 ` Tigran Mkrtchyan
2011-11-13 16:36 ` J. Bruce Fields
2011-11-13 21:07 ` NeilBrown
2011-11-14 0:42 ` J. Bruce Fields
2011-11-14 1:26 ` NeilBrown
2011-11-14 17:27 ` Trond Myklebust
2011-11-15 6:33 ` Trond Myklebust
2012-01-13 17:09 ` Malahal Naineni
2012-01-14 1:38 ` J. Bruce Fields
2012-01-16 16:52 ` Malahal Naineni
2012-01-17 15:18 ` J. Bruce Fields
2012-01-17 17:22 ` Malahal Naineni
2012-01-17 18:47 ` J. Bruce Fields
2012-01-17 19:43 ` Malahal Naineni
2011-11-14 16:29 ` Trond Myklebust
2011-11-13 16:42 ` J. Bruce Fields
2011-11-13 16:45 ` J. Bruce Fields
2011-11-13 18:25 ` Matthew Treinish
2011-11-13 18:06 ` Matthew Treinish
2011-11-14 9:09 ` Tigran Mkrtchyan
2011-11-14 21:47 ` Matthew Treinish
2011-11-15 6:49 ` Trond Myklebust
2011-11-15 22:38 ` Matthew Treinish
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1321052673-22171-3-git-send-email-treinish@linux.vnet.ibm.com \
--to=treinish@linux.vnet.ibm.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox