aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRicardo Labiaga <Ricardo.Labiaga@netapp.com>2010-10-12 19:30:06 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-10-24 18:00:04 -0400
commit55b6e7742d5b25182edf410369379b9727b2e5bc (patch)
tree7dbe87bdf772c4ec1896a8620c97b536cbcf73c6 /fs
parent6b96724e507fecc3e6440e86426fe4f44359ed66 (diff)
Ask for time_delta during fsinfo probe
Used by the client to determine if the server has a granular enough time stamp. Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4proc.c2
-rw-r--r--fs/nfs/nfs4xdr.c21
2 files changed, 22 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f5ab216e8870..e87fe612ca18 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -129,7 +129,7 @@ const u32 nfs4_fsinfo_bitmap[2] = { FATTR4_WORD0_MAXFILESIZE
129 | FATTR4_WORD0_MAXREAD 129 | FATTR4_WORD0_MAXREAD
130 | FATTR4_WORD0_MAXWRITE 130 | FATTR4_WORD0_MAXWRITE
131 | FATTR4_WORD0_LEASE_TIME, 131 | FATTR4_WORD0_LEASE_TIME,
132 0 132 FATTR4_WORD1_TIME_DELTA
133}; 133};
134 134
135const u32 nfs4_fs_locations_bitmap[2] = { 135const u32 nfs4_fs_locations_bitmap[2] = {
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 1e5d68e36e07..7131c761d85c 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -3582,6 +3582,24 @@ static int decode_attr_time_metadata(struct xdr_stream *xdr, uint32_t *bitmap, s
3582 return status; 3582 return status;
3583} 3583}
3584 3584
3585static int decode_attr_time_delta(struct xdr_stream *xdr, uint32_t *bitmap,
3586 struct timespec *time)
3587{
3588 int status = 0;
3589
3590 time->tv_sec = 0;
3591 time->tv_nsec = 0;
3592 if (unlikely(bitmap[1] & (FATTR4_WORD1_TIME_DELTA - 1U)))
3593 return -EIO;
3594 if (likely(bitmap[1] & FATTR4_WORD1_TIME_DELTA)) {
3595 status = decode_attr_time(xdr, time);
3596 bitmap[1] &= ~FATTR4_WORD1_TIME_DELTA;
3597 }
3598 dprintk("%s: time_delta=%ld %ld\n", __func__, (long)time->tv_sec,
3599 (long)time->tv_nsec);
3600 return status;
3601}
3602
3585static int decode_attr_time_modify(struct xdr_stream *xdr, uint32_t *bitmap, struct timespec *time) 3603static int decode_attr_time_modify(struct xdr_stream *xdr, uint32_t *bitmap, struct timespec *time)
3586{ 3604{
3587 int status = 0; 3605 int status = 0;
@@ -3982,6 +4000,9 @@ static int decode_fsinfo(struct xdr_stream *xdr, struct nfs_fsinfo *fsinfo)
3982 if ((status = decode_attr_maxwrite(xdr, bitmap, &fsinfo->wtmax)) != 0) 4000 if ((status = decode_attr_maxwrite(xdr, bitmap, &fsinfo->wtmax)) != 0)
3983 goto xdr_error; 4001 goto xdr_error;
3984 fsinfo->wtpref = fsinfo->wtmax; 4002 fsinfo->wtpref = fsinfo->wtmax;
4003 status = decode_attr_time_delta(xdr, bitmap, &fsinfo->time_delta);
4004 if (status != 0)
4005 goto xdr_error;
3985 4006
3986 status = verify_attr_len(xdr, savep, attrlen); 4007 status = verify_attr_len(xdr, savep, attrlen);
3987xdr_error: 4008xdr_error: