@@ -1162,7 +1162,7 @@ static int nfs4_call_sync_sequence(struct rpc_clnt *clnt,
1162
1162
{
1163
1163
unsigned short task_flags = 0 ;
1164
1164
1165
- if (server -> nfs_client -> cl_minorversion )
1165
+ if (server -> caps & NFS_CAP_MOVEABLE )
1166
1166
task_flags = RPC_TASK_MOVEABLE ;
1167
1167
return nfs4_do_call_sync (clnt , server , msg , args , res , task_flags );
1168
1168
}
@@ -2568,7 +2568,7 @@ static int nfs4_run_open_task(struct nfs4_opendata *data,
2568
2568
};
2569
2569
int status ;
2570
2570
2571
- if (server -> nfs_client -> cl_minorversion )
2571
+ if (nfs_server_capable ( dir , NFS_CAP_MOVEABLE ) )
2572
2572
task_setup_data .flags |= RPC_TASK_MOVEABLE ;
2573
2573
2574
2574
kref_get (& data -> kref );
@@ -3737,7 +3737,7 @@ int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait)
3737
3737
};
3738
3738
int status = - ENOMEM ;
3739
3739
3740
- if (server -> nfs_client -> cl_minorversion )
3740
+ if (nfs_server_capable ( state -> inode , NFS_CAP_MOVEABLE ) )
3741
3741
task_setup_data .flags |= RPC_TASK_MOVEABLE ;
3742
3742
3743
3743
nfs4_state_protect (server -> nfs_client , NFS_SP4_MACH_CRED_CLEANUP ,
@@ -4407,7 +4407,7 @@ static int _nfs4_proc_lookup(struct rpc_clnt *clnt, struct inode *dir,
4407
4407
};
4408
4408
unsigned short task_flags = 0 ;
4409
4409
4410
- if (server -> nfs_client -> cl_minorversion )
4410
+ if (nfs_server_capable ( dir , NFS_CAP_MOVEABLE ) )
4411
4411
task_flags = RPC_TASK_MOVEABLE ;
4412
4412
4413
4413
/* Is this is an attribute revalidation, subject to softreval? */
@@ -6639,10 +6639,13 @@ static int _nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred,
6639
6639
.rpc_client = server -> client ,
6640
6640
.rpc_message = & msg ,
6641
6641
.callback_ops = & nfs4_delegreturn_ops ,
6642
- .flags = RPC_TASK_ASYNC | RPC_TASK_TIMEOUT | RPC_TASK_MOVEABLE ,
6642
+ .flags = RPC_TASK_ASYNC | RPC_TASK_TIMEOUT ,
6643
6643
};
6644
6644
int status = 0 ;
6645
6645
6646
+ if (nfs_server_capable (inode , NFS_CAP_MOVEABLE ))
6647
+ task_setup_data .flags |= RPC_TASK_MOVEABLE ;
6648
+
6646
6649
data = kzalloc (sizeof (* data ), GFP_KERNEL );
6647
6650
if (data == NULL )
6648
6651
return - ENOMEM ;
@@ -6956,10 +6959,8 @@ static struct rpc_task *nfs4_do_unlck(struct file_lock *fl,
6956
6959
.workqueue = nfsiod_workqueue ,
6957
6960
.flags = RPC_TASK_ASYNC ,
6958
6961
};
6959
- struct nfs_client * client =
6960
- NFS_SERVER (lsp -> ls_state -> inode )-> nfs_client ;
6961
6962
6962
- if (client -> cl_minorversion )
6963
+ if (nfs_server_capable ( lsp -> ls_state -> inode , NFS_CAP_MOVEABLE ) )
6963
6964
task_setup_data .flags |= RPC_TASK_MOVEABLE ;
6964
6965
6965
6966
nfs4_state_protect (NFS_SERVER (lsp -> ls_state -> inode )-> nfs_client ,
@@ -7230,9 +7231,8 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f
7230
7231
.flags = RPC_TASK_ASYNC | RPC_TASK_CRED_NOREF ,
7231
7232
};
7232
7233
int ret ;
7233
- struct nfs_client * client = NFS_SERVER (state -> inode )-> nfs_client ;
7234
7234
7235
- if (client -> cl_minorversion )
7235
+ if (nfs_server_capable ( state -> inode , NFS_CAP_MOVEABLE ) )
7236
7236
task_setup_data .flags |= RPC_TASK_MOVEABLE ;
7237
7237
7238
7238
data = nfs4_alloc_lockdata (fl , nfs_file_open_context (fl -> fl_file ),
@@ -10467,7 +10467,8 @@ static const struct nfs4_minor_version_ops nfs_v4_1_minor_ops = {
10467
10467
| NFS_CAP_POSIX_LOCK
10468
10468
| NFS_CAP_STATEID_NFSV41
10469
10469
| NFS_CAP_ATOMIC_OPEN_V1
10470
- | NFS_CAP_LGOPEN ,
10470
+ | NFS_CAP_LGOPEN
10471
+ | NFS_CAP_MOVEABLE ,
10471
10472
.init_client = nfs41_init_client ,
10472
10473
.shutdown_client = nfs41_shutdown_client ,
10473
10474
.match_stateid = nfs41_match_stateid ,
@@ -10502,7 +10503,8 @@ static const struct nfs4_minor_version_ops nfs_v4_2_minor_ops = {
10502
10503
| NFS_CAP_LAYOUTSTATS
10503
10504
| NFS_CAP_CLONE
10504
10505
| NFS_CAP_LAYOUTERROR
10505
- | NFS_CAP_READ_PLUS ,
10506
+ | NFS_CAP_READ_PLUS
10507
+ | NFS_CAP_MOVEABLE ,
10506
10508
.init_client = nfs41_init_client ,
10507
10509
.shutdown_client = nfs41_shutdown_client ,
10508
10510
.match_stateid = nfs41_match_stateid ,
0 commit comments