summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Buczek <buczek@molgen.mpg.de>2019-07-07 15:26:08 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-07-13 11:48:41 -0400
commit0efb01b2ac07976b350b1899333a961fd51d1fdc (patch)
tree936c6055280f296eeb53f186b6ce0b20eb62914e
parent2eaf426debdce566df9302b218307483903ac534 (diff)
nfs4: Make nfs4_proc_get_lease_time available for nfs4.0
Compile nfs4_proc_get_lease_time, enc_get_lease_time and dec_get_lease_time for nfs4.0. Use nfs4_sequence_done instead of nfs41_sequence_done in nfs4_proc_get_lease_time, Signed-off-by: Donald Buczek <buczek@molgen.mpg.de> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
-rw-r--r--fs/nfs/nfs4_fs.h4
-rw-r--r--fs/nfs/nfs4proc.c6
-rw-r--r--fs/nfs/nfs4xdr.c12
3 files changed, 18 insertions, 4 deletions
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 8a38a254f516..d778dad9a75e 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -312,12 +312,12 @@ extern int nfs4_set_rw_stateid(nfs4_stateid *stateid,
312 const struct nfs_lock_context *l_ctx, 312 const struct nfs_lock_context *l_ctx,
313 fmode_t fmode); 313 fmode_t fmode);
314 314
315extern int nfs4_proc_get_lease_time(struct nfs_client *clp,
316 struct nfs_fsinfo *fsinfo);
315#if defined(CONFIG_NFS_V4_1) 317#if defined(CONFIG_NFS_V4_1)
316extern int nfs41_sequence_done(struct rpc_task *, struct nfs4_sequence_res *); 318extern int nfs41_sequence_done(struct rpc_task *, struct nfs4_sequence_res *);
317extern int nfs4_proc_create_session(struct nfs_client *, const struct cred *); 319extern int nfs4_proc_create_session(struct nfs_client *, const struct cred *);
318extern int nfs4_proc_destroy_session(struct nfs4_session *, const struct cred *); 320extern int nfs4_proc_destroy_session(struct nfs4_session *, const struct cred *);
319extern int nfs4_proc_get_lease_time(struct nfs_client *clp,
320 struct nfs_fsinfo *fsinfo);
321extern int nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, 321extern int nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data,
322 bool sync); 322 bool sync);
323extern int nfs4_detect_session_trunking(struct nfs_client *clp, 323extern int nfs4_detect_session_trunking(struct nfs_client *clp,
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d115d9973efc..ab362636443d 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -8255,6 +8255,8 @@ out:
8255 return ret; 8255 return ret;
8256} 8256}
8257 8257
8258#endif /* CONFIG_NFS_V4_1 */
8259
8258struct nfs4_get_lease_time_data { 8260struct nfs4_get_lease_time_data {
8259 struct nfs4_get_lease_time_args *args; 8261 struct nfs4_get_lease_time_args *args;
8260 struct nfs4_get_lease_time_res *res; 8262 struct nfs4_get_lease_time_res *res;
@@ -8287,7 +8289,7 @@ static void nfs4_get_lease_time_done(struct rpc_task *task, void *calldata)
8287 (struct nfs4_get_lease_time_data *)calldata; 8289 (struct nfs4_get_lease_time_data *)calldata;
8288 8290
8289 dprintk("--> %s\n", __func__); 8291 dprintk("--> %s\n", __func__);
8290 if (!nfs41_sequence_done(task, &data->res->lr_seq_res)) 8292 if (!nfs4_sequence_done(task, &data->res->lr_seq_res))
8291 return; 8293 return;
8292 switch (task->tk_status) { 8294 switch (task->tk_status) {
8293 case -NFS4ERR_DELAY: 8295 case -NFS4ERR_DELAY:
@@ -8345,6 +8347,8 @@ int nfs4_proc_get_lease_time(struct nfs_client *clp, struct nfs_fsinfo *fsinfo)
8345 return status; 8347 return status;
8346} 8348}
8347 8349
8350#ifdef CONFIG_NFS_V4_1
8351
8348/* 8352/*
8349 * Initialize the values to be used by the client in CREATE_SESSION 8353 * Initialize the values to be used by the client in CREATE_SESSION
8350 * If nfs4_init_session set the fore channel request and response sizes, 8354 * If nfs4_init_session set the fore channel request and response sizes,
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 620f8ff5684a..46a8d636d151 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -837,6 +837,7 @@ static int decode_layoutget(struct xdr_stream *xdr, struct rpc_rqst *req,
837#define NFS4_dec_sequence_sz \ 837#define NFS4_dec_sequence_sz \
838 (compound_decode_hdr_maxsz + \ 838 (compound_decode_hdr_maxsz + \
839 decode_sequence_maxsz) 839 decode_sequence_maxsz)
840#endif
840#define NFS4_enc_get_lease_time_sz (compound_encode_hdr_maxsz + \ 841#define NFS4_enc_get_lease_time_sz (compound_encode_hdr_maxsz + \
841 encode_sequence_maxsz + \ 842 encode_sequence_maxsz + \
842 encode_putrootfh_maxsz + \ 843 encode_putrootfh_maxsz + \
@@ -845,6 +846,7 @@ static int decode_layoutget(struct xdr_stream *xdr, struct rpc_rqst *req,
845 decode_sequence_maxsz + \ 846 decode_sequence_maxsz + \
846 decode_putrootfh_maxsz + \ 847 decode_putrootfh_maxsz + \
847 decode_fsinfo_maxsz) 848 decode_fsinfo_maxsz)
849#if defined(CONFIG_NFS_V4_1)
848#define NFS4_enc_reclaim_complete_sz (compound_encode_hdr_maxsz + \ 850#define NFS4_enc_reclaim_complete_sz (compound_encode_hdr_maxsz + \
849 encode_sequence_maxsz + \ 851 encode_sequence_maxsz + \
850 encode_reclaim_complete_maxsz) 852 encode_reclaim_complete_maxsz)
@@ -2957,6 +2959,8 @@ static void nfs4_xdr_enc_sequence(struct rpc_rqst *req, struct xdr_stream *xdr,
2957 encode_nops(&hdr); 2959 encode_nops(&hdr);
2958} 2960}
2959 2961
2962#endif
2963
2960/* 2964/*
2961 * a GET_LEASE_TIME request 2965 * a GET_LEASE_TIME request
2962 */ 2966 */
@@ -2977,6 +2981,8 @@ static void nfs4_xdr_enc_get_lease_time(struct rpc_rqst *req,
2977 encode_nops(&hdr); 2981 encode_nops(&hdr);
2978} 2982}
2979 2983
2984#ifdef CONFIG_NFS_V4_1
2985
2980/* 2986/*
2981 * a RECLAIM_COMPLETE request 2987 * a RECLAIM_COMPLETE request
2982 */ 2988 */
@@ -7122,6 +7128,8 @@ static int nfs4_xdr_dec_sequence(struct rpc_rqst *rqstp,
7122 return status; 7128 return status;
7123} 7129}
7124 7130
7131#endif
7132
7125/* 7133/*
7126 * Decode GET_LEASE_TIME response 7134 * Decode GET_LEASE_TIME response
7127 */ 7135 */
@@ -7143,6 +7151,8 @@ static int nfs4_xdr_dec_get_lease_time(struct rpc_rqst *rqstp,
7143 return status; 7151 return status;
7144} 7152}
7145 7153
7154#ifdef CONFIG_NFS_V4_1
7155
7146/* 7156/*
7147 * Decode RECLAIM_COMPLETE response 7157 * Decode RECLAIM_COMPLETE response
7148 */ 7158 */
@@ -7551,7 +7561,7 @@ const struct rpc_procinfo nfs4_procedures[] = {
7551 PROC41(CREATE_SESSION, enc_create_session, dec_create_session), 7561 PROC41(CREATE_SESSION, enc_create_session, dec_create_session),
7552 PROC41(DESTROY_SESSION, enc_destroy_session, dec_destroy_session), 7562 PROC41(DESTROY_SESSION, enc_destroy_session, dec_destroy_session),
7553 PROC41(SEQUENCE, enc_sequence, dec_sequence), 7563 PROC41(SEQUENCE, enc_sequence, dec_sequence),
7554 PROC41(GET_LEASE_TIME, enc_get_lease_time, dec_get_lease_time), 7564 PROC(GET_LEASE_TIME, enc_get_lease_time, dec_get_lease_time),
7555 PROC41(RECLAIM_COMPLETE,enc_reclaim_complete, dec_reclaim_complete), 7565 PROC41(RECLAIM_COMPLETE,enc_reclaim_complete, dec_reclaim_complete),
7556 PROC41(GETDEVICEINFO, enc_getdeviceinfo, dec_getdeviceinfo), 7566 PROC41(GETDEVICEINFO, enc_getdeviceinfo, dec_getdeviceinfo),
7557 PROC41(LAYOUTGET, enc_layoutget, dec_layoutget), 7567 PROC41(LAYOUTGET, enc_layoutget, dec_layoutget),