aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c41
1 files changed, 32 insertions, 9 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 558a85c9594a..ac6a3c55dce4 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -315,7 +315,7 @@ const struct super_operations nfs_sops = {
315}; 315};
316EXPORT_SYMBOL_GPL(nfs_sops); 316EXPORT_SYMBOL_GPL(nfs_sops);
317 317
318#ifdef CONFIG_NFS_V4 318#if IS_ENABLED(CONFIG_NFS_V4)
319static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *); 319static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *);
320static int nfs4_validate_mount_data(void *options, 320static int nfs4_validate_mount_data(void *options,
321 struct nfs_parsed_mount_data *args, const char *dev_name); 321 struct nfs_parsed_mount_data *args, const char *dev_name);
@@ -366,6 +366,7 @@ void nfs_sb_active(struct super_block *sb)
366 if (atomic_inc_return(&server->active) == 1) 366 if (atomic_inc_return(&server->active) == 1)
367 atomic_inc(&sb->s_active); 367 atomic_inc(&sb->s_active);
368} 368}
369EXPORT_SYMBOL_GPL(nfs_sb_active);
369 370
370void nfs_sb_deactive(struct super_block *sb) 371void nfs_sb_deactive(struct super_block *sb)
371{ 372{
@@ -374,6 +375,7 @@ void nfs_sb_deactive(struct super_block *sb)
374 if (atomic_dec_and_test(&server->active)) 375 if (atomic_dec_and_test(&server->active))
375 deactivate_super(sb); 376 deactivate_super(sb);
376} 377}
378EXPORT_SYMBOL_GPL(nfs_sb_deactive);
377 379
378/* 380/*
379 * Deliver file system statistics to userspace 381 * Deliver file system statistics to userspace
@@ -439,6 +441,7 @@ int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
439 dprintk("%s: statfs error = %d\n", __func__, -error); 441 dprintk("%s: statfs error = %d\n", __func__, -error);
440 return error; 442 return error;
441} 443}
444EXPORT_SYMBOL_GPL(nfs_statfs);
442 445
443/* 446/*
444 * Map the security flavour number to a name 447 * Map the security flavour number to a name
@@ -544,7 +547,7 @@ static void nfs_show_mountd_options(struct seq_file *m, struct nfs_server *nfss,
544 nfs_show_mountd_netid(m, nfss, showdefaults); 547 nfs_show_mountd_netid(m, nfss, showdefaults);
545} 548}
546 549
547#ifdef CONFIG_NFS_V4 550#if IS_ENABLED(CONFIG_NFS_V4)
548static void nfs_show_nfsv4_options(struct seq_file *m, struct nfs_server *nfss, 551static void nfs_show_nfsv4_options(struct seq_file *m, struct nfs_server *nfss,
549 int showdefaults) 552 int showdefaults)
550{ 553{
@@ -675,8 +678,9 @@ int nfs_show_options(struct seq_file *m, struct dentry *root)
675 678
676 return 0; 679 return 0;
677} 680}
681EXPORT_SYMBOL_GPL(nfs_show_options);
678 682
679#ifdef CONFIG_NFS_V4 683#if IS_ENABLED(CONFIG_NFS_V4)
680#ifdef CONFIG_NFS_V4_1 684#ifdef CONFIG_NFS_V4_1
681static void show_sessions(struct seq_file *m, struct nfs_server *server) 685static void show_sessions(struct seq_file *m, struct nfs_server *server)
682{ 686{
@@ -709,7 +713,7 @@ static void show_implementation_id(struct seq_file *m, struct nfs_server *nfss)
709 } 713 }
710} 714}
711#else 715#else
712#ifdef CONFIG_NFS_V4 716#if IS_ENABLED(CONFIG_NFS_V4)
713static void show_pnfs(struct seq_file *m, struct nfs_server *server) 717static void show_pnfs(struct seq_file *m, struct nfs_server *server)
714{ 718{
715} 719}
@@ -734,12 +738,14 @@ int nfs_show_devname(struct seq_file *m, struct dentry *root)
734 free_page((unsigned long)page); 738 free_page((unsigned long)page);
735 return err; 739 return err;
736} 740}
741EXPORT_SYMBOL_GPL(nfs_show_devname);
737 742
738int nfs_show_path(struct seq_file *m, struct dentry *dentry) 743int nfs_show_path(struct seq_file *m, struct dentry *dentry)
739{ 744{
740 seq_puts(m, "/"); 745 seq_puts(m, "/");
741 return 0; 746 return 0;
742} 747}
748EXPORT_SYMBOL_GPL(nfs_show_path);
743 749
744/* 750/*
745 * Present statistical information for this VFS mountpoint 751 * Present statistical information for this VFS mountpoint
@@ -774,7 +780,7 @@ int nfs_show_stats(struct seq_file *m, struct dentry *root)
774 seq_printf(m, ",bsize=%u", nfss->bsize); 780 seq_printf(m, ",bsize=%u", nfss->bsize);
775 seq_printf(m, ",namlen=%u", nfss->namelen); 781 seq_printf(m, ",namlen=%u", nfss->namelen);
776 782
777#ifdef CONFIG_NFS_V4 783#if IS_ENABLED(CONFIG_NFS_V4)
778 if (nfss->nfs_client->rpc_ops->version == 4) { 784 if (nfss->nfs_client->rpc_ops->version == 4) {
779 seq_printf(m, "\n\tnfsv4:\t"); 785 seq_printf(m, "\n\tnfsv4:\t");
780 seq_printf(m, "bm0=0x%x", nfss->attr_bitmask[0]); 786 seq_printf(m, "bm0=0x%x", nfss->attr_bitmask[0]);
@@ -832,6 +838,7 @@ int nfs_show_stats(struct seq_file *m, struct dentry *root)
832 838
833 return 0; 839 return 0;
834} 840}
841EXPORT_SYMBOL_GPL(nfs_show_stats);
835 842
836/* 843/*
837 * Begin unmount by attempting to remove all automounted mountpoints we added 844 * Begin unmount by attempting to remove all automounted mountpoints we added
@@ -851,6 +858,7 @@ void nfs_umount_begin(struct super_block *sb)
851 if (!IS_ERR(rpc)) 858 if (!IS_ERR(rpc))
852 rpc_killall_tasks(rpc); 859 rpc_killall_tasks(rpc);
853} 860}
861EXPORT_SYMBOL_GPL(nfs_umount_begin);
854 862
855static struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(void) 863static struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(void)
856{ 864{
@@ -1915,7 +1923,7 @@ out_invalid_fh:
1915 return -EINVAL; 1923 return -EINVAL;
1916} 1924}
1917 1925
1918#ifdef CONFIG_NFS_V4 1926#if IS_ENABLED(CONFIG_NFS_V4)
1919static int nfs_validate_mount_data(struct file_system_type *fs_type, 1927static int nfs_validate_mount_data(struct file_system_type *fs_type,
1920 void *options, 1928 void *options,
1921 struct nfs_parsed_mount_data *args, 1929 struct nfs_parsed_mount_data *args,
@@ -1953,7 +1961,7 @@ static int nfs_validate_text_mount_data(void *options,
1953 goto out_no_address; 1961 goto out_no_address;
1954 1962
1955 if (args->version == 4) { 1963 if (args->version == 4) {
1956#ifdef CONFIG_NFS_V4 1964#if IS_ENABLED(CONFIG_NFS_V4)
1957 port = NFS_PORT; 1965 port = NFS_PORT;
1958 max_namelen = NFS4_MAXNAMLEN; 1966 max_namelen = NFS4_MAXNAMLEN;
1959 max_pathlen = NFS4_MAXPATHLEN; 1967 max_pathlen = NFS4_MAXPATHLEN;
@@ -1976,7 +1984,7 @@ static int nfs_validate_text_mount_data(void *options,
1976 &args->nfs_server.export_path, 1984 &args->nfs_server.export_path,
1977 max_pathlen); 1985 max_pathlen);
1978 1986
1979#ifndef CONFIG_NFS_V4 1987#if !IS_ENABLED(CONFIG_NFS_V4)
1980out_v4_not_compiled: 1988out_v4_not_compiled:
1981 dfprintk(MOUNT, "NFS: NFSv4 is not compiled into kernel\n"); 1989 dfprintk(MOUNT, "NFS: NFSv4 is not compiled into kernel\n");
1982 return -EPROTONOSUPPORT; 1990 return -EPROTONOSUPPORT;
@@ -2075,6 +2083,7 @@ out:
2075 kfree(data); 2083 kfree(data);
2076 return error; 2084 return error;
2077} 2085}
2086EXPORT_SYMBOL_GPL(nfs_remount);
2078 2087
2079/* 2088/*
2080 * Initialise the common bits of the superblock 2089 * Initialise the common bits of the superblock
@@ -2123,6 +2132,7 @@ void nfs_fill_super(struct super_block *sb, struct nfs_mount_info *mount_info)
2123 2132
2124 nfs_initialise_sb(sb); 2133 nfs_initialise_sb(sb);
2125} 2134}
2135EXPORT_SYMBOL_GPL(nfs_fill_super);
2126 2136
2127/* 2137/*
2128 * Finish setting up a cloned NFS2/3/4 superblock 2138 * Finish setting up a cloned NFS2/3/4 superblock
@@ -2292,6 +2302,7 @@ int nfs_set_sb_security(struct super_block *s, struct dentry *mntroot,
2292{ 2302{
2293 return security_sb_set_mnt_opts(s, &mount_info->parsed->lsm_opts); 2303 return security_sb_set_mnt_opts(s, &mount_info->parsed->lsm_opts);
2294} 2304}
2305EXPORT_SYMBOL_GPL(nfs_set_sb_security);
2295 2306
2296int nfs_clone_sb_security(struct super_block *s, struct dentry *mntroot, 2307int nfs_clone_sb_security(struct super_block *s, struct dentry *mntroot,
2297 struct nfs_mount_info *mount_info) 2308 struct nfs_mount_info *mount_info)
@@ -2302,6 +2313,7 @@ int nfs_clone_sb_security(struct super_block *s, struct dentry *mntroot,
2302 return -ESTALE; 2313 return -ESTALE;
2303 return 0; 2314 return 0;
2304} 2315}
2316EXPORT_SYMBOL_GPL(nfs_clone_sb_security);
2305 2317
2306struct dentry *nfs_fs_mount_common(struct nfs_server *server, 2318struct dentry *nfs_fs_mount_common(struct nfs_server *server,
2307 int flags, const char *dev_name, 2319 int flags, const char *dev_name,
@@ -2375,6 +2387,7 @@ error_splat_bdi:
2375 deactivate_locked_super(s); 2387 deactivate_locked_super(s);
2376 goto out; 2388 goto out;
2377} 2389}
2390EXPORT_SYMBOL_GPL(nfs_fs_mount_common);
2378 2391
2379struct dentry *nfs_fs_mount(struct file_system_type *fs_type, 2392struct dentry *nfs_fs_mount(struct file_system_type *fs_type,
2380 int flags, const char *dev_name, void *raw_data) 2393 int flags, const char *dev_name, void *raw_data)
@@ -2415,6 +2428,7 @@ out:
2415 nfs_free_fhandle(mount_info.mntfh); 2428 nfs_free_fhandle(mount_info.mntfh);
2416 return mntroot; 2429 return mntroot;
2417} 2430}
2431EXPORT_SYMBOL_GPL(nfs_fs_mount);
2418 2432
2419/* 2433/*
2420 * Ensure that we unregister the bdi before kill_anon_super 2434 * Ensure that we unregister the bdi before kill_anon_super
@@ -2426,6 +2440,7 @@ void nfs_put_super(struct super_block *s)
2426 2440
2427 bdi_unregister(&server->backing_dev_info); 2441 bdi_unregister(&server->backing_dev_info);
2428} 2442}
2443EXPORT_SYMBOL_GPL(nfs_put_super);
2429 2444
2430/* 2445/*
2431 * Destroy an NFS2/3 superblock 2446 * Destroy an NFS2/3 superblock
@@ -2438,6 +2453,7 @@ void nfs_kill_super(struct super_block *s)
2438 nfs_fscache_release_super_cookie(s); 2453 nfs_fscache_release_super_cookie(s);
2439 nfs_free_server(server); 2454 nfs_free_server(server);
2440} 2455}
2456EXPORT_SYMBOL_GPL(nfs_kill_super);
2441 2457
2442/* 2458/*
2443 * Clone an NFS2/3/4 server record on xdev traversal (FSID-change) 2459 * Clone an NFS2/3/4 server record on xdev traversal (FSID-change)
@@ -2478,7 +2494,7 @@ out_err:
2478 goto out; 2494 goto out;
2479} 2495}
2480 2496
2481#ifdef CONFIG_NFS_V4 2497#if IS_ENABLED(CONFIG_NFS_V4)
2482 2498
2483static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *args) 2499static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *args)
2484{ 2500{
@@ -2590,6 +2606,13 @@ bool nfs4_disable_idmapping = true;
2590unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE; 2606unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE;
2591unsigned short send_implementation_id = 1; 2607unsigned short send_implementation_id = 1;
2592 2608
2609EXPORT_SYMBOL_GPL(nfs_callback_set_tcpport);
2610EXPORT_SYMBOL_GPL(nfs_callback_tcpport);
2611EXPORT_SYMBOL_GPL(nfs_idmap_cache_timeout);
2612EXPORT_SYMBOL_GPL(nfs4_disable_idmapping);
2613EXPORT_SYMBOL_GPL(max_session_slots);
2614EXPORT_SYMBOL_GPL(send_implementation_id);
2615
2593#define NFS_CALLBACK_MAXPORTNR (65535U) 2616#define NFS_CALLBACK_MAXPORTNR (65535U)
2594 2617
2595static int param_set_portnr(const char *val, const struct kernel_param *kp) 2618static int param_set_portnr(const char *val, const struct kernel_param *kp)