]> git.decadent.org.uk Git - nfs-utils.git/commit - utils/mount/mount_libmount.c
mount: add --enable-libmount-mount nfs-utils-1-2-4-rc7
authorKarel Zak <kzak@redhat.com>
Wed, 6 Apr 2011 16:39:21 +0000 (12:39 -0400)
committerSteve Dickson <steved@redhat.com>
Wed, 6 Apr 2011 16:40:30 +0000 (12:40 -0400)
commita99269230a0e77e7bed4fa31c9547f0d61c7f206
treec1d1f4647ab24c91fe931053f350f0dd11e758c2
parentc01e5ca6179b8f5b041605d9bbd75a0f76812d54
mount: add --enable-libmount-mount

This patch allows to link mount.nfs with libmount from util-linux >=
v2.19. The new libmount based code is enabled by CONFIG_LIBMOUNT and
is stored in mount_libmount.c. The old code is not affected by this
change.

The libmount does not have officially stable API yet, so the
--enable-libmount-mount is marked as experimental in the configure
help output.

The ./configure option is the same as we use in util-linux to enable
support for libmount in mount(8).

The addr= (and some other options necessary for remount/umount) are
stored to /etc/mtab or to /dev/.mount/utab. The utab file is *private*
libmount file. It's possible that some mount options (for example
user=) will be moved to kernel, so the utab will not be necessary.

About libmount:

  * supports systems without and with regular /etc/mtab
  * does not store VFS and FS mount options in userspace
  * manages user= option and evaluate permissions
  * parses VFS mount options and generate MS_* flags
  * parses /etc/{fstab,mtab}, /proc/mounts or /proc/self/mountinfo
  * long-term goal is to use the same code in all mount.<type> helpers

Note, use

   LIBMOUNT_DEBUG=0xffff mount.nfs foo:/path /path

to debug the library.

On systems with util-linux v2.19 the findmnt(8) command uses libmount
to list all/selected mount points:

   $ findmnt /path
   $ findmnt --mtab /path

the --mtab appends userspace mount options (e.g. user=) to the output.

CC: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
configure.ac
utils/mount/Makefile.am
utils/mount/mount_libmount.c [new file with mode: 0644]