Skip to contentSkip to conversation

Move NFS mount code from util-linux to nfs-utils - take2

PATCH In review Amit Gud 2 participants 3 messages Jun 12, 2006 – Jun 13, 2006

Subsystems (2)
lore
Share & tools
lore

Amit Gud

author
#0 lore raw

PATCH 1/1 Move NFS mount code from util-linux to nfs-utils - take2

Neil,

It avoids code duplication (of parsing the options and error checking) if we don't branch two different binaries for the NFSv4 and older versions.

AG

Signature · 2 lines
May the source be with you.
http://www.cis.ksu.edu/~gud

Adds the mount directory and the code to mount and umount the NFS file system.

---

utils/Makefile.am +4 -0
diff -uprN nfs-utils-1.0.8/utils/Makefile.am nfs-utils-1.0.8-ag/utils/Makefile.am
@@ -14,6 +14,10 @@ if CONFIG_GSS
 OPTDIRS += gssd
 endif
 
+if CONFIG_NOMOUNT
+OPTDIRS += mount
+endif
+
 SUBDIRS = \
 	exportfs \
 	lockd \
utils/mount/Makefile.am +38 -0
diff -uprN nfs-utils-1.0.8/utils/mount/Makefile.am nfs-utils-1.0.8-ag/utils/mount/Makefile.am
@@ -0,0 +1,38 @@
+## Process this file with automake to produce Makefile.in
+
+man8_MANS	= mount.nfs.man umount.nfs.man
+
+sbin_PROGRAMS	= mount.nfs
+EXTRA_DIST = nfsmount.x $(man8_MANS)
+mount_nfs_SOURCES = mount.c nfsmount.c nfs4mount.c nfsumount.c \
+		  nfsmount_xdr.c mount_constants.h nfs4_mount.h nfsmount.h \
+		  nfs_mount4.h
+
+mount_nfs_LDADD = ../../support/nfs/libnfs.a
+
+MAINTAINERCLEANFILES = Makefile.in
+
+install-exec-hook:
+	(cd $(DESTDIR)$(sbindir) && \
+	  ln -sf $(sbin_PROGRAMS) mount.nfs4 && \
+	  ln -sf $(sbin_PROGRAMS) umount.nfs && \
+	  ln -sf $(sbin_PROGRAMS) umount.nfs4)
+uninstall-hook:
+	(cd $(DESTDIR)$(sbindir) && \
+	    rm -f mount.nfs4 umount.nfs umount.nfs4)
+
+
+install-man-links:
+	(cd $(DESTDIR)$(man8dir) && \
+	  for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
+	    inst=`echo $$m | sed -e 's/man$$/8/'`; \
+	    rm -f $$inst ; \
+	  done)
+
+uninstall-man-links:
+	(cd $(DESTDIR)$(man8dir) && \
+	  for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
+	    inst=`echo $$m | sed -e 's/man$$/8/'`; \
+	    rm -f $$inst ; \
+	  done)
+
utils/mount/mount.c +387 -0

387 lines not on this page · raw message

utils/mount/mount_constants.h +53 -0

53 lines not on this page · raw message

utils/mount/mount.nfs.man +100 -0

100 lines not on this page · raw message

utils/mount/nfs4mount.c +444 -0

444 lines not on this page · raw message

utils/mount/nfs4_mount.h +85 -0

85 lines not on this page · raw message

utils/mount/nfsmount.c +1244 -0

1,244 lines not on this page · raw message

utils/mount/nfs_mount.h +84 -0

84 lines not on this page · raw message

utils/mount/nfsmount.x +336 -0

336 lines not on this page · raw message

utils/mount/nfsumount.c +392 -0

219 lines not on this page · raw message

utils/mount/nfsumount.h +11 -0
diff -uprN nfs-utils-1.0.8/utils/mount/nfsumount.h nfs-utils-1.0.8-ag/utils/mount/nfsumount.h

Lines of this file are not shown. View the raw message.

utils/mount/umount.nfs.man +74 -0

74 lines not on this page · raw message

configure.in +8 -0

Lines of this file are not shown. View the raw message.

ChangeLog +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

Part of the diff is not shown here. View the raw message.

#1 lore raw

utils/mount/mount.c line 382

Quoted 10 lines · Amit Gud

Neil,

It avoids code duplication (of parsing the options and error checking) if we don't branch two different binaries for the NFSv4 and older versions.

utils/mount/mount.c +4 -0
+
+		if(!nomtab)
+			add_mtab(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs",
+				 flags, extra_opts, 0, 0);

If mtab~ is busy won't this cause mtab to get out of sync?

Ian

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

author
#2 lore raw
Quoted 7 lines · Ian Kent
Quoted 5 lines · Amit Gud

Neil,

It avoids code duplication (of parsing the options and error checking) if we don't branch two different binaries for the NFSv4 and older versions.

Quoted 7 lines

utils/mount/mount.c line 382

Quoted 4 lines
utils/mount/mount.c +4 -0
+
+		if(!nomtab)
+			add_mtab(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs",
+				 flags, extra_opts, 0, 0);

If mtab~ is busy won't this cause mtab to get out of sync?

Cannot really spin over until the file lock is achieved, it may potentially never be.

AG

Signature · 8 lines
May the source be with you.
http://www.cis.ksu.edu/~gud



_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs