From 214359fe1689999048809cf752a997847d538dc6 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Fri, 14 Nov 2025 15:15:19 -0500 Subject: [PATCH] NFS: Move nfs40_init_client into nfs40client.c Signed-off-by: Anna Schumaker --- fs/nfs/nfs40.h | 1 + fs/nfs/nfs40client.c | 27 +++++++++++++++++++++++++++ fs/nfs/nfs4_fs.h | 1 - fs/nfs/nfs4client.c | 27 --------------------------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/fs/nfs/nfs40.h b/fs/nfs/nfs40.h index 9369bb08825a8..5a9c5d367b125 100644 --- a/fs/nfs/nfs40.h +++ b/fs/nfs/nfs40.h @@ -5,6 +5,7 @@ /* nfs40client.c */ void nfs40_shutdown_client(struct nfs_client *); +int nfs40_init_client(struct nfs_client *); /* nfs40proc.c */ extern const struct nfs4_minor_version_ops nfs_v4_0_minor_ops; diff --git a/fs/nfs/nfs40client.c b/fs/nfs/nfs40client.c index 4a19ad9df7890..cd105dc1cee1a 100644 --- a/fs/nfs/nfs40client.c +++ b/fs/nfs/nfs40client.c @@ -53,6 +53,33 @@ void nfs40_shutdown_client(struct nfs_client *clp) } } +/** + * nfs40_init_client - nfs_client initialization tasks for NFSv4.0 + * @clp: nfs_client to initialize + * + * Returns zero on success, or a negative errno if some error occurred. + */ +int nfs40_init_client(struct nfs_client *clp) +{ + struct nfs4_slot_table *tbl; + int ret; + + tbl = kzalloc(sizeof(*tbl), GFP_NOFS); + if (tbl == NULL) + return -ENOMEM; + + ret = nfs4_setup_slot_table(tbl, NFS4_MAX_SLOT_TABLE, + "NFSv4.0 transport Slot table"); + if (ret) { + nfs4_shutdown_slot_table(tbl); + kfree(tbl); + return ret; + } + + clp->cl_slot_tbl = tbl; + return 0; +} + /** * nfs40_walk_client_list - Find server that recognizes a client ID * diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 3a81a658e5d20..9d0bec3a23f3c 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h @@ -483,7 +483,6 @@ extern const u32 nfs4_fsinfo_bitmap[3]; extern const u32 nfs4_fs_locations_bitmap[3]; void nfs41_shutdown_client(struct nfs_client *); -int nfs40_init_client(struct nfs_client *); int nfs41_init_client(struct nfs_client *); void nfs4_free_client(struct nfs_client *); diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index d83a8a2a3c707..c376b2420b6cf 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -331,33 +331,6 @@ static int nfs4_init_callback(struct nfs_client *clp) return 0; } -/** - * nfs40_init_client - nfs_client initialization tasks for NFSv4.0 - * @clp: nfs_client to initialize - * - * Returns zero on success, or a negative errno if some error occurred. - */ -int nfs40_init_client(struct nfs_client *clp) -{ - struct nfs4_slot_table *tbl; - int ret; - - tbl = kzalloc(sizeof(*tbl), GFP_NOFS); - if (tbl == NULL) - return -ENOMEM; - - ret = nfs4_setup_slot_table(tbl, NFS4_MAX_SLOT_TABLE, - "NFSv4.0 transport Slot table"); - if (ret) { - nfs4_shutdown_slot_table(tbl); - kfree(tbl); - return ret; - } - - clp->cl_slot_tbl = tbl; - return 0; -} - #if defined(CONFIG_NFS_V4_1) /** -- 2.47.3