diff options
author | NeilBrown <neilb@suse.com> | 2016-11-15 12:03:24 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2016-11-15 16:47:03 -0500 |
commit | 394e388e1e62d88f2771a3a65ed34c63c1e481bf (patch) | |
tree | 5852c9431b8934d1966cdb44e8468fac3cf5e49c /support/export/xtab.c | |
parent | 8f3d12ce1d156b8809dc936d9e452e14e2788b3e (diff) | |
download | nfs-utils-394e388e1e62d88f2771a3a65ed34c63c1e481bf.tar.gz nfs-utils-394e388e1e62d88f2771a3a65ed34c63c1e481bf.tar.xz nfs-utils-394e388e1e62d88f2771a3a65ed34c63c1e481bf.zip |
Remove all use of /var/lib/nfs/xtab
/var/lib/nfs/xtab is only used to find out what has been exported to
the kernel. This is more reliably done by reading
/proc/fs/nfs{,d}/export and nfs-utils uses that file if is available.
So xtab is only need if you have an incredibly ancient kernel which
doesn't have /proc/fs/nfs/export (and so which only supports NFSv2) or
if /proc is not mounted.
Neither of these are credible contexts to run a modern nfs-utils,
so stop creating or reading the xtab file.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/export/xtab.c')
-rw-r--r-- | support/export/xtab.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/support/export/xtab.c b/support/export/xtab.c index e953071..10d9dbc 100644 --- a/support/export/xtab.c +++ b/support/export/xtab.c @@ -1,7 +1,7 @@ /* * support/export/xtab.c * - * Interface to the xtab file. + * Interface to the etab/exports file. * * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de> */ @@ -29,7 +29,6 @@ xtab_read(char *xtab, char *lockfn, int is_export) { /* is_export == 0 => reading /proc/fs/nfs/exports - we know these things are exported to kernel * is_export == 1 => reading /var/lib/nfs/etab - these things are allowed to be exported - * is_export == 2 => reading /var/lib/nfs/xtab - these things might be known to kernel */ struct exportent *xp; nfs_export *exp; @@ -55,9 +54,6 @@ xtab_read(char *xtab, char *lockfn, int is_export) if ((xp->e_flags & NFSEXP_FSID) && xp->e_fsid == 0) v4root_needed = 0; break; - case 2: - exp->m_exported = -1;/* may be exported */ - break; } } endexportent(); @@ -79,7 +75,7 @@ xtab_mount_read(void) return xtab_read(_PATH_PROC_EXPORTS_ALT, _PATH_PROC_EXPORTS_ALT, 0); } else - return xtab_read(_PATH_XTAB, _PATH_XTABLCK, 2); + return 0; } int @@ -135,29 +131,6 @@ xtab_export_write() return xtab_write(_PATH_ETAB, _PATH_ETABTMP, _PATH_ETABLCK, 1); } -int -xtab_mount_write() -{ - return xtab_write(_PATH_XTAB, _PATH_XTABTMP, _PATH_XTABLCK, 0); -} - -void -xtab_append(nfs_export *exp) -{ - struct exportent xe; - int lockid; - - if ((lockid = xflock(_PATH_XTABLCK, "w")) < 0) - return; - setexportent(_PATH_XTAB, "a"); - xe = exp->m_export; - xe.e_hostname = exp->m_client->m_hostname; - putexportent(&xe); - endexportent(); - xfunlock(lockid); - exp->m_xtabent = 1; -} - /* * rename newfile onto oldfile unless * they are identical |