diff options
| author | NeilBrown <neilb@suse.com> | 2016-12-06 11:02:42 -0500 |
|---|---|---|
| committer | Steve Dickson <steved@redhat.com> | 2016-12-06 11:15:37 -0500 |
| commit | fc1127d754578cd1dc3b52aebce1d5ae09f2d347 (patch) | |
| tree | 4ea987b878532eff62f797d3933dd9ff5f29f24f /utils/exportfs | |
| parent | 6a060231b029aa6b7a0af4fa69c84603f9f663dd (diff) | |
| download | nfs-utils-fc1127d754578cd1dc3b52aebce1d5ae09f2d347.tar.gz nfs-utils-fc1127d754578cd1dc3b52aebce1d5ae09f2d347.tar.xz nfs-utils-fc1127d754578cd1dc3b52aebce1d5ae09f2d347.zip | |
Remove all use of the nfsctl system call.
This systemcall was deprecated early in the 2.6 series
as it was replaced by an in-kernel cache which was refilled
using an upcall. All communication to kernel is now through
the nfsd filesystem.
The nfsctl systemcall itself was removed in 3.1.
It is unlikely to have been used for over a decade.
To remove all uses for the nfsctl systemcall, and call code that only
runs when "new_cache" is false. We now assume "new_cache" is always
true.
This allows the removal of several files as well as assorted functions.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/exportfs')
| -rw-r--r-- | utils/exportfs/exportfs.c | 84 |
1 files changed, 2 insertions, 82 deletions
diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c index 1816796..b7a910e 100644 --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -40,9 +40,7 @@ static void export_all(int verbose); static void exportfs(char *arg, char *options, int verbose); static void unexportfs(char *arg, int verbose); -static void exports_update(int verbose); static void dump(int verbose, int export_format); -static void error(nfs_export *exp, int err); static void usage(const char *progname, int n); static void validate_export(nfs_export *exp); static int matchhostname(const char *hostname1, const char *hostname2); @@ -94,7 +92,6 @@ main(int argc, char **argv) int f_reexport = 0; int f_ignore = 0; int i, c; - int new_cache = 0; int force_flush = 0; if ((progname = strrchr(argv[0], '/')) != NULL) @@ -157,17 +154,9 @@ main(int argc, char **argv) xlog(L_ERROR, "-r and -u are incompatible"); return 1; } - new_cache = check_new_cache(); if (optind == argc && ! f_all) { if (force_flush) { - if (new_cache) - cache_flush(1); - else { - xlog(L_ERROR, "-f is available only " - "with new cache controls. " - "Mount /proc/fs/nfsd first"); - return 1; - } + cache_flush(1); return 0; } else { xtab_export_read(); @@ -209,71 +198,13 @@ main(int argc, char **argv) if (!f_export) for (i = optind ; i < argc ; i++) unexportfs(argv[i], f_verbose); - if (!new_cache) - rmtab_read(); - } - if (!new_cache) { - xtab_mount_read(); - exports_update(f_verbose); } xtab_export_write(); - if (new_cache) - cache_flush(force_flush); + cache_flush(force_flush); return export_errno; } -static void -exports_update_one(nfs_export *exp, int verbose) -{ - /* check mountpoint option */ - if (exp->m_mayexport && - exp->m_export.e_mountpoint && - !is_mountpoint(exp->m_export.e_mountpoint[0]? - exp->m_export.e_mountpoint: - exp->m_export.e_path)) { - printf("%s not exported as %s not a mountpoint.\n", - exp->m_export.e_path, exp->m_export.e_mountpoint); - exp->m_mayexport = 0; - } - if (exp->m_mayexport && exp->m_changed) { - if (verbose) - printf("%sexporting %s:%s to kernel\n", - exp->m_exported ?"re":"", - exp->m_client->m_hostname, - exp->m_export.e_path); - if (!export_export(exp)) - error(exp, errno); - } - if (exp->m_exported && ! exp->m_mayexport) { - if (verbose) - printf("unexporting %s:%s from kernel\n", - exp->m_client->m_hostname, - exp->m_export.e_path); - if (!export_unexport(exp)) - error(exp, errno); - } -} - - -/* we synchronise intention with reality. - * entries with m_mayexport get exported - * entries with m_exported but not m_mayexport get unexported - * looking at m_client->m_type == MCL_FQDN and m_client->m_type == MCL_GSS only - */ -static void -exports_update(int verbose) -{ - nfs_export *exp; - - for (exp = exportlist[MCL_FQDN].p_head; exp; exp=exp->m_next) { - exports_update_one(exp, verbose); - } - for (exp = exportlist[MCL_GSS].p_head; exp; exp=exp->m_next) { - exports_update_one(exp, verbose); - } -} - /* * export_all finds all entries and * marks them xtabent and mayexport so that they get exported @@ -438,10 +369,6 @@ unexportfs_parsed(char *hname, char *path, int verbose) exp->m_client->m_hostname, exp->m_export.e_path); } -#if 0 - if (exp->m_exported && !export_unexport(exp)) - error(exp, errno); -#endif exp->m_xtabent = 0; exp->m_mayexport = 0; success = 1; @@ -809,13 +736,6 @@ dump(int verbose, int export_format) } static void -error(nfs_export *exp, int err) -{ - xlog(L_ERROR, "%s:%s: %s", exp->m_client->m_hostname, - exp->m_export.e_path, strerror(err)); -} - -static void usage(const char *progname, int n) { fprintf(stderr, "usage: %s [-adfhioruvs] [host:/path]\n", progname); |
