Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4

Compiling the NFSv4 module without any minorversion support doesn't make
much sense, so this patch sets NFS v4.1 as the default, always enabled
NFS version allowing us to replace all the CONFIG_NFS_V4_1s scattered
throughout the code with CONFIG_NFS_V4.

Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>

+35 -368
+9 -18
fs/nfs/Kconfig
··· 78 78 tristate "NFS client support for NFS version 4" 79 79 depends on NFS_FS 80 80 select KEYS 81 + select SUNRPC_BACKCHANNEL 81 82 help 82 - This option enables support for version 4 of the NFS protocol 83 - (RFC 3530) in the kernel's NFS client. 83 + This option enables support for version 4.1 of the NFS protocol 84 + (RFC 5661) in the kernel's NFS client. 84 85 85 86 To mount NFS servers using NFSv4, you also need to install user 86 87 space programs which can be found in the Linux nfs-utils package, ··· 106 105 107 106 If unsure, say N. 108 107 109 - config NFS_V4_1 110 - bool "NFS client support for NFSv4.1" 111 - depends on NFS_V4 112 - select SUNRPC_BACKCHANNEL 113 - help 114 - This option enables support for minor version 1 of the NFSv4 protocol 115 - (RFC 5661) in the kernel's NFS client. 116 - 117 - If unsure, say N. 118 - 119 108 config NFS_V4_2 120 109 bool "NFS client support for NFSv4.2" 121 - depends on NFS_V4_1 110 + depends on NFS_V4 122 111 help 123 112 This option enables support for minor version 2 of the NFSv4 protocol 124 113 in the kernel's NFS client. ··· 117 126 118 127 config PNFS_FILE_LAYOUT 119 128 tristate 120 - depends on NFS_V4_1 129 + depends on NFS_V4 121 130 default NFS_V4 122 131 123 132 config PNFS_BLOCK 124 133 tristate 125 - depends on NFS_V4_1 && BLK_DEV_DM 134 + depends on NFS_V4 && BLK_DEV_DM 126 135 default NFS_V4 127 136 128 137 config PNFS_FLEXFILE_LAYOUT 129 138 tristate 130 - depends on NFS_V4_1 139 + depends on NFS_V4 131 140 default NFS_V4 132 141 133 142 config NFS_V4_1_IMPLEMENTATION_ID_DOMAIN 134 143 string "NFSv4.1 Implementation ID Domain" 135 - depends on NFS_V4_1 144 + depends on NFS_V4 136 145 default "kernel.org" 137 146 help 138 147 This option defines the domain portion of the implementation ID that ··· 144 153 145 154 config NFS_V4_1_MIGRATION 146 155 bool "NFSv4.1 client support for migration" 147 - depends on NFS_V4_1 156 + depends on NFS_V4 148 157 default n 149 158 help 150 159 This option makes the NFS client advertise to NFSv4.1 servers that
+1 -2
fs/nfs/Makefile
··· 27 27 nfsv4-y := nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o nfs4super.o nfs4file.o \ 28 28 delegation.o nfs4idmap.o callback.o callback_xdr.o callback_proc.o \ 29 29 nfs4namespace.o nfs4getroot.o nfs4client.o nfs4session.o \ 30 - dns_resolve.o nfs4trace.o 30 + dns_resolve.o nfs4trace.o pnfs.o pnfs_dev.o pnfs_nfs.o 31 31 nfsv4-$(CONFIG_NFS_USE_LEGACY_DNS) += cache_lib.o 32 32 nfsv4-$(CONFIG_SYSCTL) += nfs4sysctl.o 33 33 nfsv4-$(CONFIG_NFS_V4_0) += nfs40client.o nfs40proc.o 34 - nfsv4-$(CONFIG_NFS_V4_1) += pnfs.o pnfs_dev.o pnfs_nfs.o 35 34 nfsv4-$(CONFIG_NFS_V4_2) += nfs42proc.o nfs42xattr.o 36 35 37 36 obj-$(CONFIG_PNFS_FILE_LAYOUT) += filelayout/
+1 -12
fs/nfs/callback.c
··· 87 87 return 0; 88 88 } 89 89 90 - #if defined(CONFIG_NFS_V4_1) 91 90 static inline void nfs_callback_bc_serv(u32 minorversion, struct rpc_xprt *xprt, 92 91 struct svc_serv *serv) 93 92 { ··· 97 98 */ 98 99 xprt->bc_serv = serv; 99 100 } 100 - #else 101 - static inline void nfs_callback_bc_serv(u32 minorversion, struct rpc_xprt *xprt, 102 - struct svc_serv *serv) 103 - { 104 - } 105 - #endif /* CONFIG_NFS_V4_1 */ 106 101 107 102 static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt, 108 103 struct svc_serv *serv) ··· 150 157 } 151 158 152 159 ret = 0; 153 - if (!IS_ENABLED(CONFIG_NFS_V4_1) || minorversion == 0) 160 + if (minorversion == 0) 154 161 ret = nfs4_callback_up_net(serv, net); 155 162 else if (xprt->ops->bc_setup) 156 163 set_bc_enabled(serv); ··· 191 198 cb_info->users); 192 199 193 200 threadfn = nfs4_callback_svc; 194 - #if !defined(CONFIG_NFS_V4_1) 195 - if (minorversion) 196 - return ERR_PTR(-ENOTSUPP); 197 - #endif 198 201 serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE, 199 202 threadfn); 200 203 if (!serv) {
-3
fs/nfs/callback.h
··· 65 65 uint32_t truncate; 66 66 }; 67 67 68 - #if defined(CONFIG_NFS_V4_1) 69 - 70 68 struct referring_call { 71 69 uint32_t rc_sequenceid; 72 70 uint32_t rc_slotid; ··· 166 168 167 169 extern __be32 nfs4_callback_notify_lock(void *argp, void *resp, 168 170 struct cb_process_state *cps); 169 - #endif /* CONFIG_NFS_V4_1 */ 170 171 #ifdef CONFIG_NFS_V4_2 171 172 struct cb_offloadargs { 172 173 struct nfs_fh coa_fh;
-3
fs/nfs/callback_proc.c
··· 126 126 return res; 127 127 } 128 128 129 - #if defined(CONFIG_NFS_V4_1) 130 - 131 129 /* 132 130 * Lookup a layout inode by stateid 133 131 * ··· 696 698 697 699 return htonl(NFS4_OK); 698 700 } 699 - #endif /* CONFIG_NFS_V4_1 */ 700 701 #ifdef CONFIG_NFS_V4_2 701 702 static void nfs4_copy_cb_args(struct nfs4_copy_state *cp_state, 702 703 struct cb_offloadargs *args)
-21
fs/nfs/callback_xdr.c
··· 30 30 (2 + 2 + 3 + 3 + 3 + 3 + 3) * 4) 31 31 #define CB_OP_RECALL_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ) 32 32 33 - #if defined(CONFIG_NFS_V4_1) 34 33 #define CB_OP_LAYOUTRECALL_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ) 35 34 #define CB_OP_DEVICENOTIFY_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ) 36 35 #define CB_OP_SEQUENCE_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ + \ ··· 38 39 #define CB_OP_RECALLANY_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ) 39 40 #define CB_OP_RECALLSLOT_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ) 40 41 #define CB_OP_NOTIFY_LOCK_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ) 41 - #endif /* CONFIG_NFS_V4_1 */ 42 42 #ifdef CONFIG_NFS_V4_2 43 43 #define CB_OP_OFFLOAD_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ) 44 44 #endif /* CONFIG_NFS_V4_2 */ ··· 203 205 return decode_fh(xdr, &args->fh); 204 206 } 205 207 206 - #if defined(CONFIG_NFS_V4_1) 207 208 static __be32 decode_layout_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) 208 209 { 209 210 stateid->type = NFS4_LAYOUT_STATEID_TYPE; ··· 518 521 return decode_lockowner(xdr, args); 519 522 } 520 523 521 - #endif /* CONFIG_NFS_V4_1 */ 522 524 #ifdef CONFIG_NFS_V4_2 523 525 static __be32 decode_write_response(struct xdr_stream *xdr, 524 526 struct cb_offloadargs *args) ··· 743 747 return status; 744 748 } 745 749 746 - #if defined(CONFIG_NFS_V4_1) 747 - 748 750 static __be32 encode_sessionid(struct xdr_stream *xdr, 749 751 const struct nfs4_sessionid *sid) 750 752 { ··· 839 845 cps->slot = NULL; 840 846 } 841 847 } 842 - 843 - #else /* CONFIG_NFS_V4_1 */ 844 - 845 - static __be32 846 - preprocess_nfs41_op(int nop, unsigned int op_nr, struct callback_op **op) 847 - { 848 - return htonl(NFS4ERR_MINOR_VERS_MISMATCH); 849 - } 850 - 851 - static void nfs4_cb_free_slot(struct cb_process_state *cps) 852 - { 853 - } 854 - #endif /* CONFIG_NFS_V4_1 */ 855 848 856 849 #ifdef CONFIG_NFS_V4_2 857 850 static __be32 ··· 1032 1051 .decode_args = decode_recall_args, 1033 1052 .res_maxsize = CB_OP_RECALL_RES_MAXSZ, 1034 1053 }, 1035 - #if defined(CONFIG_NFS_V4_1) 1036 1054 [OP_CB_LAYOUTRECALL] = { 1037 1055 .process_op = nfs4_callback_layoutrecall, 1038 1056 .decode_args = decode_layoutrecall_args, ··· 1063 1083 .decode_args = decode_notify_lock_args, 1064 1084 .res_maxsize = CB_OP_NOTIFY_LOCK_RES_MAXSZ, 1065 1085 }, 1066 - #endif /* CONFIG_NFS_V4_1 */ 1067 1086 #ifdef CONFIG_NFS_V4_2 1068 1087 [OP_CB_OFFLOAD] = { 1069 1088 .process_op = nfs4_callback_offload,
+3 -5
fs/nfs/client.c
··· 1266 1266 INIT_LIST_HEAD(&nn->nfs_volume_list); 1267 1267 #if IS_ENABLED(CONFIG_NFS_V4) 1268 1268 idr_init(&nn->cb_ident_idr); 1269 - #endif 1270 - #if IS_ENABLED(CONFIG_NFS_V4_1) 1271 1269 INIT_LIST_HEAD(&nn->nfs4_data_server_cache); 1272 1270 spin_lock_init(&nn->nfs4_data_server_lock); 1273 - #endif 1271 + #endif /* CONFIG_NFS_V4 */ 1274 1272 spin_lock_init(&nn->nfs_client_lock); 1275 1273 nn->boot_time = ktime_get_real(); 1276 1274 memset(&nn->rpcstats, 0, sizeof(nn->rpcstats)); ··· 1285 1287 nfs_cleanup_cb_ident_idr(net); 1286 1288 WARN_ON_ONCE(!list_empty(&nn->nfs_client_list)); 1287 1289 WARN_ON_ONCE(!list_empty(&nn->nfs_volume_list)); 1288 - #if IS_ENABLED(CONFIG_NFS_V4_1) 1290 + #if IS_ENABLED(CONFIG_NFS_V4) 1289 1291 WARN_ON_ONCE(!list_empty(&nn->nfs4_data_server_cache)); 1290 - #endif 1292 + #endif /* CONFIG_NFS_V4 */ 1291 1293 } 1292 1294 1293 1295 #ifdef CONFIG_PROC_FS
+4 -8
fs/nfs/internal.h
··· 334 334 #if IS_ENABLED(CONFIG_NFS_V4) 335 335 extern int nfs4_decode_dirent(struct xdr_stream *, 336 336 struct nfs_entry *, bool); 337 - #endif 338 - #ifdef CONFIG_NFS_V4_1 339 337 extern const u32 nfs41_maxread_overhead; 340 338 extern const u32 nfs41_maxwrite_overhead; 341 339 extern const u32 nfs41_maxgetdevinfo_overhead; 342 - #endif 343 340 344 341 /* nfs4proc.c */ 345 - #if IS_ENABLED(CONFIG_NFS_V4) 346 342 extern const struct rpc_procinfo nfs4_procedures[]; 347 - #endif 343 + #endif /* CONFIG_NFS_V4 */ 348 344 349 345 #ifdef CONFIG_NFS_V4_SECURITY_LABEL 350 346 extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); ··· 635 639 int nfs_filemap_write_and_wait_range(struct address_space *mapping, 636 640 loff_t lstart, loff_t lend); 637 641 638 - #ifdef CONFIG_NFS_V4_1 642 + #ifdef CONFIG_NFS_V4 639 643 static inline void 640 644 pnfs_bucket_clear_pnfs_ds_commit_verifiers(struct pnfs_commit_bucket *buckets, 641 645 unsigned int nbuckets) ··· 656 660 array->nbuckets); 657 661 rcu_read_unlock(); 658 662 } 659 - #else 663 + #else /* CONFIG_NFS_V4 */ 660 664 static inline 661 665 void nfs_clear_pnfs_ds_commit_verifiers(struct pnfs_ds_commit_info *cinfo) 662 666 { 663 667 } 664 - #endif 668 + #endif /* CONFIG_NFS_V4 */ 665 669 666 670 #ifdef CONFIG_MIGRATION 667 671 int nfs_migrate_folio(struct address_space *, struct folio *dst,
+1 -3
fs/nfs/netns.h
··· 31 31 unsigned short nfs_callback_tcpport; 32 32 unsigned short nfs_callback_tcpport6; 33 33 int cb_users[NFS4_MAX_MINOR_VERSION + 1]; 34 - #endif /* CONFIG_NFS_V4 */ 35 - #if IS_ENABLED(CONFIG_NFS_V4_1) 36 34 struct list_head nfs4_data_server_cache; 37 35 spinlock_t nfs4_data_server_lock; 38 - #endif /* CONFIG_NFS_V4_1 */ 36 + #endif /* CONFIG_NFS_V4 */ 39 37 struct nfs_netns_client *nfs_client; 40 38 spinlock_t nfs_client_lock; 41 39 ktime_t boot_time;
+1 -35
fs/nfs/nfs4_fs.h
··· 18 18 19 19 #if defined(CONFIG_NFS_V4_2) 20 20 #define NFS4_MAX_MINOR_VERSION 2 21 - #elif defined(CONFIG_NFS_V4_1) 22 - #define NFS4_MAX_MINOR_VERSION 1 23 21 #else 24 - #define NFS4_MAX_MINOR_VERSION 0 22 + #define NFS4_MAX_MINOR_VERSION 1 25 23 #endif 26 24 27 25 #if IS_ENABLED(CONFIG_NFS_V4) ··· 381 383 extern int nfs4_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle, 382 384 struct nfs_fattr *fattr); 383 385 384 - #if defined(CONFIG_NFS_V4_1) 385 386 extern int nfs41_sequence_done(struct rpc_task *, struct nfs4_sequence_res *); 386 387 extern int nfs4_proc_create_session(struct nfs_client *, const struct cred *); 387 388 extern int nfs4_proc_destroy_session(struct nfs4_session *, const struct cred *); ··· 458 461 !test_bit(NFS_SP4_MACH_CRED_COMMIT, &clp->cl_sp4_flags)) 459 462 hdr->args.stable = NFS_FILE_SYNC; 460 463 } 461 - #else /* CONFIG_NFS_v4_1 */ 462 - static inline bool 463 - is_ds_only_client(struct nfs_client *clp) 464 - { 465 - return false; 466 - } 467 - 468 - static inline bool 469 - is_ds_client(struct nfs_client *clp) 470 - { 471 - return false; 472 - } 473 - 474 - static inline void 475 - nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_flags, 476 - struct rpc_clnt **clntp, struct rpc_message *msg) 477 - { 478 - } 479 - 480 - static inline void 481 - nfs4_state_protect_write(struct nfs_client *clp, struct rpc_clnt **clntp, 482 - struct rpc_message *msg, struct nfs_pgio_header *hdr) 483 - { 484 - } 485 - #endif /* CONFIG_NFS_V4_1 */ 486 464 487 465 extern const struct nfs4_minor_version_ops *nfs_v4_minor_ops[]; 488 466 ··· 490 518 struct nfs_client **); 491 519 int nfs40_discover_server_trunking(struct nfs_client *clp, 492 520 struct nfs_client **, const struct cred *); 493 - #if defined(CONFIG_NFS_V4_1) 494 521 int nfs41_discover_server_trunking(struct nfs_client *clp, 495 522 struct nfs_client **, const struct cred *); 496 523 extern void nfs4_schedule_session_recovery(struct nfs4_session *, int); 497 524 extern void nfs41_notify_server(struct nfs_client *); 498 525 bool nfs4_check_serverowner_major_id(struct nfs41_server_owner *o1, 499 526 struct nfs41_server_owner *o2); 500 - #else 501 - static inline void nfs4_schedule_session_recovery(struct nfs4_session *session, int err) 502 - { 503 - } 504 - #endif /* CONFIG_NFS_V4_1 */ 505 527 506 528 extern struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *, const struct cred *, gfp_t); 507 529 extern void nfs4_put_state_owner(struct nfs4_state_owner *);
-23
fs/nfs/nfs4client.c
··· 44 44 return ret < 0 ? ret : 0; 45 45 } 46 46 47 - #ifdef CONFIG_NFS_V4_1 48 47 /* 49 48 * Per auth flavor data server rpc clients 50 49 */ ··· 186 187 } 187 188 188 189 } 189 - #endif /* CONFIG_NFS_V4_1 */ 190 190 191 191 struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init) 192 192 { ··· 215 217 clp->cl_mvops = nfs_v4_minor_ops[cl_init->minorversion]; 216 218 clp->cl_mig_gen = 1; 217 219 clp->cl_last_renewal = jiffies; 218 - #if IS_ENABLED(CONFIG_NFS_V4_1) 219 220 init_waitqueue_head(&clp->cl_lock_waitq); 220 - #endif 221 221 INIT_LIST_HEAD(&clp->pending_cb_stateids); 222 222 223 223 if (cl_init->minorversion != 0) ··· 328 332 return 0; 329 333 } 330 334 331 - #if defined(CONFIG_NFS_V4_1) 332 - 333 335 /** 334 336 * nfs41_init_client - nfs_client initialization tasks for NFSv4.1+ 335 337 * @clp: nfs_client to initialize ··· 358 364 nfs_mark_client_ready(clp, NFS_CS_SESSION_INITING); 359 365 return 0; 360 366 } 361 - 362 - #endif /* CONFIG_NFS_V4_1 */ 363 367 364 368 /* 365 369 * Initialize the minor version specific parts of an NFS4 client record ··· 500 508 return 0; 501 509 } 502 510 503 - #ifdef CONFIG_NFS_V4_1 504 511 /* 505 512 * Returns true if the server major ids match 506 513 */ ··· 628 637 nfs_put_client(prev); 629 638 return status; 630 639 } 631 - #endif /* CONFIG_NFS_V4_1 */ 632 640 633 641 static void nfs4_destroy_server(struct nfs_server *server) 634 642 { ··· 659 669 return clp; 660 670 } 661 671 662 - #if defined(CONFIG_NFS_V4_1) 663 672 /* Common match routine for v4.0 and v4.1 callback services */ 664 673 static bool nfs4_cb_match_client(const struct sockaddr *addr, 665 674 struct nfs_client *clp, u32 minorversion) ··· 715 726 spin_unlock(&nn->nfs_client_lock); 716 727 return NULL; 717 728 } 718 - 719 - #else /* CONFIG_NFS_V4_1 */ 720 - 721 - struct nfs_client * 722 - nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr, 723 - struct nfs4_sessionid *sid, u32 minorversion) 724 - { 725 - return NULL; 726 - } 727 - #endif /* CONFIG_NFS_V4_1 */ 728 729 729 730 /* 730 731 * Set up an NFS4 client ··· 857 878 */ 858 879 static void nfs4_session_limit_rwsize(struct nfs_server *server) 859 880 { 860 - #ifdef CONFIG_NFS_V4_1 861 881 struct nfs4_session *sess; 862 882 u32 server_resp_sz; 863 883 u32 server_rqst_sz; ··· 873 895 server->rsize = server_resp_sz; 874 896 if (server->wsize > server_rqst_sz) 875 897 server->wsize = server_rqst_sz; 876 - #endif /* CONFIG_NFS_V4_1 */ 877 898 } 878 899 879 900 /*
-55
fs/nfs/nfs4proc.c
··· 99 99 static int nfs4_do_setattr(struct inode *inode, const struct cred *cred, 100 100 struct nfs_fattr *fattr, struct iattr *sattr, 101 101 struct nfs_open_context *ctx, struct nfs4_label *ilabel); 102 - #ifdef CONFIG_NFS_V4_1 103 102 static struct rpc_task *_nfs41_proc_sequence(struct nfs_client *clp, 104 103 const struct cred *cred, 105 104 struct nfs4_slot *slot, ··· 107 108 const struct cred *); 108 109 static int nfs41_free_stateid(struct nfs_server *, nfs4_stateid *, 109 110 const struct cred *, bool); 110 - #endif 111 111 112 112 #ifdef CONFIG_NFS_V4_SECURITY_LABEL 113 113 static inline struct nfs4_label * ··· 567 569 case -NFS4ERR_LEASE_MOVED: 568 570 nfs4_schedule_lease_moved_recovery(clp); 569 571 goto wait_on_recovery; 570 - #if defined(CONFIG_NFS_V4_1) 571 572 case -NFS4ERR_BADSESSION: 572 573 case -NFS4ERR_BADSLOT: 573 574 case -NFS4ERR_BAD_HIGH_SLOT: ··· 576 579 case -NFS4ERR_SEQ_MISORDERED: 577 580 /* Handled in nfs41_sequence_process() */ 578 581 goto wait_on_recovery; 579 - #endif /* defined(CONFIG_NFS_V4_1) */ 580 582 case -NFS4ERR_FILE_OPEN: 581 583 if (exception->timeout > HZ) { 582 584 /* We have retried a decent amount, time to ··· 778 782 res->sr_slot = NULL; 779 783 res->sr_slot_ops = clp->cl_mvops->sequence_slot_ops; 780 784 } 781 - 782 - #if defined(CONFIG_NFS_V4_1) 783 785 784 786 static void nfs41_release_slot(struct nfs4_slot *slot) 785 787 { ··· 1015 1021 .rpc_call_done = nfs41_call_sync_done, 1016 1022 }; 1017 1023 1018 - 1019 - #endif /* !CONFIG_NFS_V4_1 */ 1020 1024 1021 1025 static void nfs41_sequence_res_init(struct nfs4_sequence_res *res) 1022 1026 { ··· 1581 1589 nfs4_state_set_mode_locked(state, state->state | fmode); 1582 1590 } 1583 1591 1584 - #ifdef CONFIG_NFS_V4_1 1585 1592 static bool nfs_open_stateid_recover_openmode(struct nfs4_state *state) 1586 1593 { 1587 1594 if (state->n_rdonly && !test_bit(NFS_O_RDONLY_STATE, &state->flags)) ··· 1591 1600 return true; 1592 1601 return false; 1593 1602 } 1594 - #endif /* CONFIG_NFS_V4_1 */ 1595 1603 1596 1604 static void nfs_state_log_update_open_stateid(struct nfs4_state *state) 1597 1605 { ··· 2827 2837 nfs_state_clear_delegation(state); 2828 2838 } 2829 2839 2830 - #if defined(CONFIG_NFS_V4_1) 2831 2840 static int nfs41_test_and_free_expired_stateid(struct nfs_server *server, 2832 2841 nfs4_stateid *stateid, const struct cred *cred) 2833 2842 { ··· 3011 3022 status = nfs4_open_expired(sp, state); 3012 3023 return status; 3013 3024 } 3014 - #endif 3015 3025 3016 3026 /* 3017 3027 * on an EXCLUSIVE create, the server should send back a bitmask with FATTR4-* ··· 4372 4384 return status; 4373 4385 } 4374 4386 4375 - #if IS_ENABLED(CONFIG_NFS_V4_1) 4376 4387 static bool should_request_dir_deleg(struct inode *inode) 4377 4388 { 4378 4389 if (!directory_delegations) ··· 4388 4401 return false; 4389 4402 return true; 4390 4403 } 4391 - #else 4392 - static bool should_request_dir_deleg(struct inode *inode) 4393 - { 4394 - return false; 4395 - } 4396 - #endif /* CONFIG_NFS_V4_1 */ 4397 4404 4398 4405 static void nfs4_call_getattr_prepare(struct rpc_task *task, void *calldata) 4399 4406 { ··· 7533 7552 return err; 7534 7553 } 7535 7554 7536 - #if defined(CONFIG_NFS_V4_1) 7537 7555 static int nfs41_lock_expired(struct nfs4_state *state, struct file_lock *request) 7538 7556 { 7539 7557 struct nfs4_lock_state *lsp; ··· 7547 7567 return 0; 7548 7568 return nfs4_lock_expired(state, request); 7549 7569 } 7550 - #endif 7551 7570 7552 7571 static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock *request) 7553 7572 { ··· 7620 7641 return status; 7621 7642 } 7622 7643 7623 - #ifdef CONFIG_NFS_V4_1 7624 7644 struct nfs4_lock_waiter { 7625 7645 struct inode *inode; 7626 7646 struct nfs_lowner owner; ··· 7687 7709 7688 7710 return status; 7689 7711 } 7690 - #else /* !CONFIG_NFS_V4_1 */ 7691 - static inline int 7692 - nfs4_retry_setlk(struct nfs4_state *state, int cmd, struct file_lock *request) 7693 - { 7694 - return nfs4_retry_setlk_simple(state, cmd, request); 7695 - } 7696 - #endif 7697 7712 7698 7713 static int 7699 7714 nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request) ··· 7819 7848 return nfs4_server_supports_acls(NFS_SB(dentry->d_sb), NFS4ACL_ACL); 7820 7849 } 7821 7850 7822 - #if defined(CONFIG_NFS_V4_1) 7823 7851 #define XATTR_NAME_NFSV4_DACL "system.nfs4_dacl" 7824 7852 7825 7853 static int nfs4_xattr_set_nfs4_dacl(const struct xattr_handler *handler, ··· 7864 7894 { 7865 7895 return nfs4_server_supports_acls(NFS_SB(dentry->d_sb), NFS4ACL_SACL); 7866 7896 } 7867 - 7868 - #endif 7869 7897 7870 7898 #ifdef CONFIG_NFS_V4_SECURITY_LABEL 7871 7899 ··· 8124 8156 return err; 8125 8157 } 8126 8158 8127 - #ifdef CONFIG_NFS_V4_1 8128 - 8129 8159 /* 8130 8160 * This operation also signals the server that this client is 8131 8161 * performing migration recovery. The server can stop asserting ··· 8186 8220 return status; 8187 8221 } 8188 8222 8189 - #endif /* CONFIG_NFS_V4_1 */ 8190 - 8191 8223 /** 8192 8224 * nfs4_proc_get_locations - discover locations for a migrated FSID 8193 8225 * @server: pointer to nfs_server to process ··· 8233 8269 return status; 8234 8270 } 8235 8271 8236 - #ifdef CONFIG_NFS_V4_1 8237 - 8238 8272 /* 8239 8273 * This operation also signals the server that this client is 8240 8274 * performing "lease moved" recovery. The server can stop asserting ··· 8270 8308 status = -NFS4ERR_LEASE_MOVED; 8271 8309 return status; 8272 8310 } 8273 - 8274 - #endif /* CONFIG_NFS_V4_1 */ 8275 8311 8276 8312 /** 8277 8313 * nfs4_proc_fsid_present - Is this FSID present or absent on server? ··· 8399 8439 return err; 8400 8440 } 8401 8441 8402 - #ifdef CONFIG_NFS_V4_1 8403 8442 /* 8404 8443 * Check the exchange flags returned by the server for invalid flags, having 8405 8444 * both PNFS and NON_PNFS flags set, and not having one of NON_PNFS, PNFS, or ··· 9011 9052 return ret; 9012 9053 } 9013 9054 9014 - #endif /* CONFIG_NFS_V4_1 */ 9015 - 9016 9055 struct nfs4_get_lease_time_data { 9017 9056 struct nfs4_get_lease_time_args *args; 9018 9057 struct nfs4_get_lease_time_res *res; ··· 9086 9129 nfs4_init_sequence(clp, &args.la_seq_args, &res.lr_seq_res, 0, 1); 9087 9130 return nfs4_call_sync_custom(&task_setup); 9088 9131 } 9089 - 9090 - #ifdef CONFIG_NFS_V4_1 9091 9132 9092 9133 /* 9093 9134 * Initialize the values to be used by the client in CREATE_SESSION ··· 10425 10470 return s1->seqid == 0 || s2->seqid == 0; 10426 10471 } 10427 10472 10428 - #endif /* CONFIG_NFS_V4_1 */ 10429 - 10430 10473 bool nfs4_match_stateid(const nfs4_stateid *s1, 10431 10474 const nfs4_stateid *s2) 10432 10475 { ··· 10434 10481 } 10435 10482 10436 10483 10437 - #if defined(CONFIG_NFS_V4_1) 10438 10484 static const struct nfs4_sequence_slot_ops nfs41_sequence_slot_ops = { 10439 10485 .process = nfs41_sequence_process, 10440 10486 .done = nfs41_sequence_done, ··· 10500 10548 .state_renewal_ops = &nfs41_state_renewal_ops, 10501 10549 .mig_recovery_ops = &nfs41_mig_recovery_ops, 10502 10550 }; 10503 - #endif 10504 10551 10505 10552 #if defined(CONFIG_NFS_V4_2) 10506 10553 static const struct nfs4_minor_version_ops nfs_v4_2_minor_ops = { ··· 10545 10594 #if defined(CONFIG_NFS_V4_0) 10546 10595 [0] = &nfs_v4_0_minor_ops, 10547 10596 #endif /* CONFIG_NFS_V4_0 */ 10548 - #if defined(CONFIG_NFS_V4_1) 10549 10597 [1] = &nfs_v4_1_minor_ops, 10550 - #endif 10551 10598 #if defined(CONFIG_NFS_V4_2) 10552 10599 [2] = &nfs_v4_2_minor_ops, 10553 10600 #endif ··· 10724 10775 .set = nfs4_xattr_set_nfs4_acl, 10725 10776 }; 10726 10777 10727 - #if defined(CONFIG_NFS_V4_1) 10728 10778 static const struct xattr_handler nfs4_xattr_nfs4_dacl_handler = { 10729 10779 .name = XATTR_NAME_NFSV4_DACL, 10730 10780 .list = nfs4_xattr_list_nfs4_dacl, ··· 10737 10789 .get = nfs4_xattr_get_nfs4_sacl, 10738 10790 .set = nfs4_xattr_set_nfs4_sacl, 10739 10791 }; 10740 - #endif 10741 10792 10742 10793 #ifdef CONFIG_NFS_V4_2 10743 10794 static const struct xattr_handler nfs4_xattr_nfs4_user_handler = { ··· 10748 10801 10749 10802 const struct xattr_handler * const nfs4_xattr_handlers[] = { 10750 10803 &nfs4_xattr_nfs4_acl_handler, 10751 - #if defined(CONFIG_NFS_V4_1) 10752 10804 &nfs4_xattr_nfs4_dacl_handler, 10753 10805 &nfs4_xattr_nfs4_sacl_handler, 10754 - #endif 10755 10806 #ifdef CONFIG_NFS_V4_SECURITY_LABEL 10756 10807 &nfs4_xattr_nfs4_label_handler, 10757 10808 #endif
-4
fs/nfs/nfs4session.c
··· 408 408 } 409 409 } 410 410 411 - #if defined(CONFIG_NFS_V4_1) 412 - 413 411 static void nfs41_set_max_slotid_locked(struct nfs4_slot_table *tbl, 414 412 u32 target_highest_slotid) 415 413 { ··· 651 653 return 0; 652 654 } 653 655 EXPORT_SYMBOL_GPL(nfs4_init_ds_session); 654 - 655 - #endif /* defined(CONFIG_NFS_V4_1) */
-23
fs/nfs/nfs4session.h
··· 111 111 return clp->cl_session; 112 112 } 113 113 114 - #if defined(CONFIG_NFS_V4_1) 115 114 extern void nfs41_set_target_slotid(struct nfs4_slot_table *tbl, 116 115 u32 target_highest_slotid); 117 116 extern void nfs41_update_target_slotid(struct nfs4_slot_table *tbl, ··· 153 154 */ 154 155 #define nfs_session_id_hash(sess_id) \ 155 156 (~crc32_le(0xFFFFFFFF, &(sess_id)->data[0], sizeof((sess_id)->data))) 156 - #else /* defined(CONFIG_NFS_V4_1) */ 157 157 158 - static inline int nfs4_init_session(struct nfs_client *clp) 159 - { 160 - return 0; 161 - } 162 - 163 - /* 164 - * Determine if sessions are in use. 165 - */ 166 - static inline int nfs4_has_session(const struct nfs_client *clp) 167 - { 168 - return 0; 169 - } 170 - 171 - static inline int nfs4_has_persistent_session(const struct nfs_client *clp) 172 - { 173 - return 0; 174 - } 175 - 176 - #define nfs_session_id_hash(session) (0) 177 - 178 - #endif /* defined(CONFIG_NFS_V4_1) */ 179 158 #endif /* IS_ENABLED(CONFIG_NFS_V4) */ 180 159 #endif /* __LINUX_FS_NFS_NFS4SESSION_H */
-17
fs/nfs/nfs4state.c
··· 259 259 return nfs4_drain_slot_tbl(&ses->fc_slot_table); 260 260 } 261 261 262 - #if defined(CONFIG_NFS_V4_1) 263 - 264 262 static void nfs41_finish_session_reset(struct nfs_client *clp) 265 263 { 266 264 clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); ··· 336 338 nfs_put_client(clp); 337 339 return status; 338 340 } 339 - 340 - #endif /* CONFIG_NFS_V4_1 */ 341 341 342 342 /** 343 343 * nfs4_get_clid_cred - Acquire credential for a setclientid operation ··· 2306 2310 return status; 2307 2311 } 2308 2312 2309 - #ifdef CONFIG_NFS_V4_1 2310 2313 void nfs4_schedule_session_recovery(struct nfs4_session *session, int err) 2311 2314 { 2312 2315 struct nfs_client *clp = session->clp; ··· 2512 2517 set_bit(NFS4CLNT_RUN_MANAGER, &clp->cl_state); 2513 2518 } 2514 2519 } 2515 - #else /* CONFIG_NFS_V4_1 */ 2516 - static int nfs4_reset_session(struct nfs_client *clp) { return 0; } 2517 - 2518 - static int nfs4_bind_conn_to_session(struct nfs_client *clp) 2519 - { 2520 - return 0; 2521 - } 2522 - 2523 - static void nfs4_layoutreturn_any_run(struct nfs_client *clp) 2524 - { 2525 - } 2526 - #endif /* CONFIG_NFS_V4_1 */ 2527 2520 2528 2521 static void nfs4_state_manager(struct nfs_client *clp) 2529 2522 {
-2
fs/nfs/nfs4trace.c
··· 14 14 #define CREATE_TRACE_POINTS 15 15 #include "nfs4trace.h" 16 16 17 - #ifdef CONFIG_NFS_V4_1 18 17 EXPORT_TRACEPOINT_SYMBOL_GPL(nfs4_pnfs_read); 19 18 EXPORT_TRACEPOINT_SYMBOL_GPL(nfs4_pnfs_write); 20 19 EXPORT_TRACEPOINT_SYMBOL_GPL(nfs4_pnfs_commit_ds); ··· 38 39 EXPORT_TRACEPOINT_SYMBOL_GPL(bl_pr_key_unreg_err); 39 40 40 41 EXPORT_TRACEPOINT_SYMBOL_GPL(fl_getdevinfo); 41 - #endif
-16
fs/nfs/nfs4trace.h
··· 71 71 DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid_confirm); 72 72 DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew); 73 73 DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew_async); 74 - #ifdef CONFIG_NFS_V4_1 75 74 DEFINE_NFS4_CLIENTID_EVENT(nfs4_exchange_id); 76 75 DEFINE_NFS4_CLIENTID_EVENT(nfs4_create_session); 77 76 DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_session); ··· 300 301 __entry->status 301 302 ) 302 303 ); 303 - 304 - #endif /* CONFIG_NFS_V4_1 */ 305 304 306 305 TRACE_EVENT(nfs4_setup_sequence, 307 306 TP_PROTO( ··· 1065 1068 ) 1066 1069 ); 1067 1070 1068 - #ifdef CONFIG_NFS_V4_1 1069 1071 DECLARE_EVENT_CLASS(nfs4_test_stateid_event, 1070 1072 TP_PROTO( 1071 1073 const struct nfs4_state *state, ··· 1119 1123 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid); 1120 1124 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid); 1121 1125 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid); 1122 - #endif /* CONFIG_NFS_V4_1 */ 1123 1126 1124 1127 DECLARE_EVENT_CLASS(nfs4_lookup_event, 1125 1128 TP_PROTO( ··· 1621 1626 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name); 1622 1627 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group); 1623 1628 1624 - #ifdef CONFIG_NFS_V4_1 1625 1629 #define NFS4_LSEG_LAYOUT_STATEID_HASH(lseg) \ 1626 1630 (lseg ? nfs_stateid_hash(&lseg->pls_layout->plh_stateid) : 0) 1627 - #else 1628 - #define NFS4_LSEG_LAYOUT_STATEID_HASH(lseg) (0) 1629 - #endif 1630 1631 1631 1632 DECLARE_EVENT_CLASS(nfs4_read_event, 1632 1633 TP_PROTO( ··· 1694 1703 ), \ 1695 1704 TP_ARGS(hdr, error)) 1696 1705 DEFINE_NFS4_READ_EVENT(nfs4_read); 1697 - #ifdef CONFIG_NFS_V4_1 1698 1706 DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read); 1699 - #endif /* CONFIG_NFS_V4_1 */ 1700 1707 1701 1708 DECLARE_EVENT_CLASS(nfs4_write_event, 1702 1709 TP_PROTO( ··· 1767 1778 ), \ 1768 1779 TP_ARGS(hdr, error)) 1769 1780 DEFINE_NFS4_WRITE_EVENT(nfs4_write); 1770 - #ifdef CONFIG_NFS_V4_1 1771 1781 DEFINE_NFS4_WRITE_EVENT(nfs4_pnfs_write); 1772 - #endif /* CONFIG_NFS_V4_1 */ 1773 1782 1774 1783 DECLARE_EVENT_CLASS(nfs4_commit_event, 1775 1784 TP_PROTO( ··· 1827 1840 ), \ 1828 1841 TP_ARGS(data, error)) 1829 1842 DEFINE_NFS4_COMMIT_EVENT(nfs4_commit); 1830 - #ifdef CONFIG_NFS_V4_1 1831 1843 DEFINE_NFS4_COMMIT_EVENT(nfs4_pnfs_commit_ds); 1832 1844 1833 1845 TRACE_EVENT(nfs4_layoutget, ··· 2859 2873 2860 2874 DEFINE_NFS4_INODE_EVENT(nfs4_listxattr); 2861 2875 #endif /* CONFIG_NFS_V4_2 */ 2862 - 2863 - #endif /* CONFIG_NFS_V4_1 */ 2864 2876 2865 2877 #endif /* _TRACE_NFS4_H */ 2866 2878
-87
fs/nfs/nfs4xdr.c
··· 308 308 #define encode_secinfo_maxsz (op_encode_hdr_maxsz + nfs4_name_maxsz) 309 309 #define decode_secinfo_maxsz (op_decode_hdr_maxsz + 1 + ((NFS_MAX_SECFLAVORS * (16 + GSS_OID_MAX_LEN)) / 4)) 310 310 311 - #if defined(CONFIG_NFS_V4_1) 312 311 #define NFS4_MAX_MACHINE_NAME_LEN (64) 313 312 #define IMPL_NAME_LIMIT (sizeof(utsname()->sysname) + sizeof(utsname()->release) + \ 314 313 sizeof(utsname()->version) + sizeof(utsname()->machine) + 8) ··· 454 455 #define encode_free_stateid_maxsz (op_encode_hdr_maxsz + 1 + \ 455 456 XDR_QUADLEN(NFS4_STATEID_SIZE)) 456 457 #define decode_free_stateid_maxsz (op_decode_hdr_maxsz) 457 - #else /* CONFIG_NFS_V4_1 */ 458 - #define encode_sequence_maxsz 0 459 - #define decode_sequence_maxsz 0 460 - #define encode_get_dir_deleg_maxsz 0 461 - #define decode_get_dir_deleg_maxsz 0 462 - #define encode_layoutreturn_maxsz 0 463 - #define decode_layoutreturn_maxsz 0 464 - #define encode_layoutget_maxsz 0 465 - #define decode_layoutget_maxsz 0 466 - #endif /* CONFIG_NFS_V4_1 */ 467 458 468 459 #define NFS4_enc_compound_sz (1024) /* XXX: large enough? */ 469 460 #define NFS4_dec_compound_sz (1024) /* XXX: large enough? */ ··· 827 838 decode_putfh_maxsz + \ 828 839 decode_getfh_maxsz + \ 829 840 decode_renew_maxsz) 830 - #if defined(CONFIG_NFS_V4_1) 831 841 #define NFS4_enc_bind_conn_to_session_sz \ 832 842 (compound_encode_hdr_maxsz + \ 833 843 encode_bind_conn_to_session_maxsz) ··· 859 871 #define NFS4_dec_sequence_sz \ 860 872 (compound_decode_hdr_maxsz + \ 861 873 decode_sequence_maxsz) 862 - #endif 863 874 #define NFS4_enc_get_lease_time_sz (compound_encode_hdr_maxsz + \ 864 875 encode_sequence_maxsz + \ 865 876 encode_putrootfh_maxsz + \ ··· 867 880 decode_sequence_maxsz + \ 868 881 decode_putrootfh_maxsz + \ 869 882 decode_fsinfo_maxsz) 870 - #if defined(CONFIG_NFS_V4_1) 871 883 #define NFS4_enc_reclaim_complete_sz (compound_encode_hdr_maxsz + \ 872 884 encode_sequence_maxsz + \ 873 885 encode_reclaim_complete_maxsz) ··· 944 958 decode_sequence_maxsz) * 945 959 XDR_UNIT); 946 960 EXPORT_SYMBOL_GPL(nfs41_maxgetdevinfo_overhead); 947 - #endif /* CONFIG_NFS_V4_1 */ 948 961 949 962 static const umode_t nfs_type2fmt[] = { 950 963 [NF4BAD] = 0, ··· 1819 1834 encode_string(xdr, name->len, name->name); 1820 1835 } 1821 1836 1822 - #if defined(CONFIG_NFS_V4_1) 1823 1837 /* NFSv4.1 operations */ 1824 1838 static void encode_bind_conn_to_session(struct xdr_stream *xdr, 1825 1839 const struct nfs41_bind_conn_to_session_args *args, ··· 1970 1986 encode_op_hdr(xdr, OP_RECLAIM_COMPLETE, decode_reclaim_complete_maxsz, hdr); 1971 1987 encode_uint32(xdr, args->one_fs); 1972 1988 } 1973 - #endif /* CONFIG_NFS_V4_1 */ 1974 1989 1975 1990 static void encode_sequence(struct xdr_stream *xdr, 1976 1991 const struct nfs4_sequence_args *args, 1977 1992 struct compound_hdr *hdr) 1978 1993 { 1979 - #if defined(CONFIG_NFS_V4_1) 1980 1994 struct nfs4_session *session; 1981 1995 struct nfs4_slot_table *tp; 1982 1996 struct nfs4_slot *slot = args->sa_slot; ··· 2005 2023 *p++ = cpu_to_be32(slot->slot_nr); 2006 2024 *p++ = cpu_to_be32(tp->highest_used_slotid); 2007 2025 *p = cpu_to_be32(args->sa_cache_this); 2008 - #endif /* CONFIG_NFS_V4_1 */ 2009 2026 } 2010 2027 2011 - #ifdef CONFIG_NFS_V4_1 2012 2028 static void 2013 2029 encode_get_dir_delegation(struct xdr_stream *xdr, struct compound_hdr *hdr) 2014 2030 { ··· 2168 2188 encode_op_hdr(xdr, OP_FREE_STATEID, decode_free_stateid_maxsz, hdr); 2169 2189 encode_nfs4_stateid(xdr, &args->stateid); 2170 2190 } 2171 - #else 2172 - static inline void 2173 - encode_get_dir_delegation(struct xdr_stream *xdr, struct compound_hdr *hdr) 2174 - { 2175 - } 2176 - 2177 - static inline void 2178 - encode_layoutreturn(struct xdr_stream *xdr, 2179 - const struct nfs4_layoutreturn_args *args, 2180 - struct compound_hdr *hdr) 2181 - { 2182 - } 2183 - 2184 - static void 2185 - encode_layoutget(struct xdr_stream *xdr, 2186 - const struct nfs4_layoutget_args *args, 2187 - struct compound_hdr *hdr) 2188 - { 2189 - } 2190 - #endif /* CONFIG_NFS_V4_1 */ 2191 2191 2192 2192 /* 2193 2193 * END OF "GENERIC" ENCODE ROUTINES. ··· 2175 2215 2176 2216 static u32 nfs4_xdr_minorversion(const struct nfs4_sequence_args *args) 2177 2217 { 2178 - #if defined(CONFIG_NFS_V4_1) 2179 2218 struct nfs4_session *session = args->sa_slot->table->session; 2180 2219 if (session) 2181 2220 return session->clp->cl_mvops->minor_version; 2182 - #endif /* CONFIG_NFS_V4_1 */ 2183 2221 return 0; 2184 2222 } 2185 2223 ··· 2935 2977 encode_nops(&hdr); 2936 2978 } 2937 2979 2938 - #if defined(CONFIG_NFS_V4_1) 2939 2980 /* 2940 2981 * BIND_CONN_TO_SESSION request 2941 2982 */ ··· 3036 3079 encode_nops(&hdr); 3037 3080 } 3038 3081 3039 - #endif 3040 - 3041 3082 /* 3042 3083 * a GET_LEASE_TIME request 3043 3084 */ ··· 3055 3100 encode_fsinfo(xdr, lease_bitmap, &hdr); 3056 3101 encode_nops(&hdr); 3057 3102 } 3058 - 3059 - #ifdef CONFIG_NFS_V4_1 3060 3103 3061 3104 /* 3062 3105 * a RECLAIM_COMPLETE request ··· 3218 3265 encode_free_stateid(xdr, args, &hdr); 3219 3266 encode_nops(&hdr); 3220 3267 } 3221 - #endif /* CONFIG_NFS_V4_1 */ 3222 3268 3223 3269 static int decode_opaque_inline(struct xdr_stream *xdr, unsigned int *len, char **string) 3224 3270 { ··· 5716 5764 return decode_secinfo_common(xdr, res); 5717 5765 } 5718 5766 5719 - #if defined(CONFIG_NFS_V4_1) 5720 5767 static int decode_secinfo_no_name(struct xdr_stream *xdr, struct nfs4_secinfo_res *res) 5721 5768 { 5722 5769 int status = decode_op_hdr(xdr, OP_SECINFO_NO_NAME); ··· 5927 5976 { 5928 5977 return decode_op_hdr(xdr, OP_RECLAIM_COMPLETE); 5929 5978 } 5930 - #endif /* CONFIG_NFS_V4_1 */ 5931 5979 5932 5980 static int decode_sequence(struct xdr_stream *xdr, 5933 5981 struct nfs4_sequence_res *res, 5934 5982 struct rpc_rqst *rqstp) 5935 5983 { 5936 - #if defined(CONFIG_NFS_V4_1) 5937 5984 struct nfs4_session *session; 5938 5985 struct nfs4_sessionid id; 5939 5986 u32 dummy; ··· 5991 6042 out_overflow: 5992 6043 status = -EIO; 5993 6044 goto out_err; 5994 - #else /* CONFIG_NFS_V4_1 */ 5995 - return 0; 5996 - #endif /* CONFIG_NFS_V4_1 */ 5997 6045 } 5998 6046 5999 - #if defined(CONFIG_NFS_V4_1) 6000 6047 static int decode_layout_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) 6001 6048 { 6002 6049 stateid->type = NFS4_LAYOUT_STATEID_TYPE; ··· 6255 6310 res->status = decode_op_hdr(xdr, OP_FREE_STATEID); 6256 6311 return res->status; 6257 6312 } 6258 - #else 6259 - static int decode_get_dir_delegation(struct xdr_stream *xdr, 6260 - struct nfs4_getattr_res *res) 6261 - { 6262 - return 0; 6263 - } 6264 - 6265 - static inline 6266 - int decode_layoutreturn(struct xdr_stream *xdr, 6267 - struct nfs4_layoutreturn_res *res) 6268 - { 6269 - return 0; 6270 - } 6271 - 6272 - static int decode_layoutget(struct xdr_stream *xdr, struct rpc_rqst *req, 6273 - struct nfs4_layoutget_res *res) 6274 - { 6275 - return 0; 6276 - } 6277 - 6278 - #endif /* CONFIG_NFS_V4_1 */ 6279 6313 6280 6314 /* 6281 6315 * END OF "GENERIC" DECODE ROUTINES. ··· 7283 7359 return status; 7284 7360 } 7285 7361 7286 - #if defined(CONFIG_NFS_V4_1) 7287 7362 /* 7288 7363 * Decode BIND_CONN_TO_SESSION response 7289 7364 */ ··· 7379 7456 return status; 7380 7457 } 7381 7458 7382 - #endif 7383 - 7384 7459 /* 7385 7460 * Decode GET_LEASE_TIME response 7386 7461 */ ··· 7399 7478 status = decode_fsinfo(xdr, res->lr_fsinfo); 7400 7479 return status; 7401 7480 } 7402 - 7403 - #ifdef CONFIG_NFS_V4_1 7404 7481 7405 7482 /* 7406 7483 * Decode RECLAIM_COMPLETE response ··· 7587 7668 out: 7588 7669 return status; 7589 7670 } 7590 - #endif /* CONFIG_NFS_V4_1 */ 7591 7671 7592 7672 /** 7593 7673 * nfs4_decode_dirent - Decode a single NFSv4 directory entry stored in ··· 7692 7774 STUB(proc) 7693 7775 #endif /* CONFIG_NFS_V4_0 */ 7694 7776 7695 - #if defined(CONFIG_NFS_V4_1) 7696 7777 #define PROC41(proc, argtype, restype) \ 7697 7778 PROC(proc, argtype, restype) 7698 - #else 7699 - #define PROC41(proc, argtype, restype) \ 7700 - STUB(proc) 7701 - #endif 7702 7779 7703 7780 #if defined(CONFIG_NFS_V4_2) 7704 7781 #define PROC42(proc, argtype, restype) \
+3 -3
fs/nfs/pnfs.h
··· 84 84 PNFS_TRY_AGAIN = 2, 85 85 }; 86 86 87 - #ifdef CONFIG_NFS_V4_1 87 + #if IS_ENABLED(CONFIG_NFS_V4) 88 88 89 89 #define LAYOUT_NFSV4_1_MODULE_PREFIX "nfs-layouttype4" 90 90 ··· 704 704 } 705 705 706 706 #endif /* NFS_DEBUG */ 707 - #else /* CONFIG_NFS_V4_1 */ 707 + #else /* CONFIG_NFS_V4 */ 708 708 709 709 static inline bool nfs_have_layout(struct inode *inode) 710 710 { ··· 913 913 return false; 914 914 } 915 915 916 - #endif /* CONFIG_NFS_V4_1 */ 916 + #endif /* CONFIG_NFS_V4 */ 917 917 918 918 #if IS_ENABLED(CONFIG_NFS_V4_2) 919 919 int pnfs_report_layoutstat(struct inode *inode, gfp_t gfp_flags);
+2 -2
fs/nfs/read.c
··· 68 68 struct nfs_server *server = NFS_SERVER(inode); 69 69 const struct nfs_pageio_ops *pg_ops = &nfs_pgio_rw_ops; 70 70 71 - #ifdef CONFIG_NFS_V4_1 71 + #if IS_ENABLED(CONFIG_NFS_V4) 72 72 if (server->pnfs_curr_ld && !force_mds) 73 73 pg_ops = server->pnfs_curr_ld->pg_read_ops; 74 - #endif 74 + #endif /* CONFIG_NFS_V4 */ 75 75 nfs_pageio_init(pgio, inode, pg_ops, compl_ops, &nfs_rw_read_ops, 76 76 server->rsize, 0); 77 77 }
+3 -13
fs/nfs/super.c
··· 589 589 seq_printf(m, ",lease_expired=%ld", 590 590 time_after(expire, jiffies) ? 0 : (jiffies - expire) / HZ); 591 591 } 592 - #ifdef CONFIG_NFS_V4_1 592 + 593 593 static void show_sessions(struct seq_file *m, struct nfs_server *server) 594 594 { 595 595 if (nfs4_has_session(server->nfs_client)) 596 596 seq_puts(m, ",sessions"); 597 597 } 598 - #else 599 - static void show_sessions(struct seq_file *m, struct nfs_server *server) {} 600 - #endif 601 - #endif 602 598 603 - #ifdef CONFIG_NFS_V4_1 604 599 static void show_pnfs(struct seq_file *m, struct nfs_server *server) 605 600 { 606 601 seq_printf(m, ",pnfs="); ··· 615 620 impl_id->date.seconds, impl_id->date.nseconds); 616 621 } 617 622 } 618 - #else 619 - #if IS_ENABLED(CONFIG_NFS_V4) 620 - static void show_pnfs(struct seq_file *m, struct nfs_server *server) 621 - { 622 - } 623 - #endif 623 + #else /* CONFIG_NFS_V4 */ 624 624 static void show_implementation_id(struct seq_file *m, struct nfs_server *nfss) 625 625 { 626 626 } 627 - #endif 627 + #endif /* CONFIG_NFS_V4 */ 628 628 629 629 int nfs_show_devname(struct seq_file *m, struct dentry *root) 630 630 {
+5 -5
fs/nfs/sysfs.c
··· 293 293 294 294 static struct kobj_attribute nfs_sysfs_attr_shutdown = __ATTR_RW(shutdown); 295 295 296 - #if IS_ENABLED(CONFIG_NFS_V4_1) 296 + #if IS_ENABLED(CONFIG_NFS_V4) 297 297 static ssize_t 298 298 implid_domain_show(struct kobject *kobj, struct kobj_attribute *attr, 299 299 char *buf) ··· 323 323 324 324 static struct kobj_attribute nfs_sysfs_attr_implid_name = __ATTR_RO(implid_name); 325 325 326 - #endif /* IS_ENABLED(CONFIG_NFS_V4_1) */ 326 + #endif /* IS_ENABLED(CONFIG_NFS_V4) */ 327 327 328 328 #define RPC_CLIENT_NAME_SIZE 64 329 329 ··· 362 362 .child_ns_type = nfs_netns_object_child_ns_type, 363 363 }; 364 364 365 - #if IS_ENABLED(CONFIG_NFS_V4_1) 365 + #if IS_ENABLED(CONFIG_NFS_V4) 366 366 static void nfs_sysfs_add_nfsv41_server(struct nfs_server *server) 367 367 { 368 368 int ret; ··· 382 382 pr_warn("NFS: sysfs_create_file_ns for server-%d failed (%d)\n", 383 383 server->s_sysfs_id, ret); 384 384 } 385 - #else /* CONFIG_NFS_V4_1 */ 385 + #else /* CONFIG_NFS_V4 */ 386 386 static inline void nfs_sysfs_add_nfsv41_server(struct nfs_server *server) 387 387 { 388 388 } 389 - #endif /* CONFIG_NFS_V4_1 */ 389 + #endif /* CONFIG_NFS_V4 */ 390 390 391 391 #if IS_ENABLED(CONFIG_NFS_LOCALIO) 392 392
+1 -1
fs/nfs/write.c
··· 1402 1402 struct nfs_server *server = NFS_SERVER(inode); 1403 1403 const struct nfs_pageio_ops *pg_ops = &nfs_pgio_rw_ops; 1404 1404 1405 - #ifdef CONFIG_NFS_V4_1 1405 + #if IS_ENABLED(CONFIG_NFS_V4) 1406 1406 if (server->pnfs_curr_ld && !force_mds) 1407 1407 pg_ops = server->pnfs_curr_ld->pg_write_ops; 1408 1408 #endif
-2
include/linux/nfs_fs_sb.h
··· 115 115 #define NFS_SP4_MACH_CRED_WRITE 5 /* WRITE */ 116 116 #define NFS_SP4_MACH_CRED_COMMIT 6 /* COMMIT */ 117 117 #define NFS_SP4_MACH_CRED_PNFS_CLEANUP 7 /* LAYOUTRETURN */ 118 - #if IS_ENABLED(CONFIG_NFS_V4_1) 119 118 wait_queue_head_t cl_lock_waitq; 120 - #endif /* CONFIG_NFS_V4_1 */ 121 119 #endif /* CONFIG_NFS_V4 */ 122 120 123 121 /* Our own IP address, as a null-terminated string.
+1 -5
include/linux/nfs_xdr.h
··· 1324 1324 unsigned char renew:1; 1325 1325 }; 1326 1326 1327 - #endif /* CONFIG_NFS_V4 */ 1328 - 1329 - #ifdef CONFIG_NFS_V4_1 1330 - 1331 1327 struct pnfs_commit_bucket { 1332 1328 struct list_head written; 1333 1329 struct list_head committing; ··· 1463 1467 struct pnfs_ds_commit_info { 1464 1468 }; 1465 1469 1466 - #endif /* CONFIG_NFS_V4_1 */ 1470 + #endif /* CONFIG_NFS_V4 */ 1467 1471 1468 1472 #ifdef CONFIG_NFS_V4_2 1469 1473 struct nfs42_falloc_args {