FreeBSD/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
/*
 * Called when invoked as /etc/fs/zfs/umount.  Unlike a manual mount, we allow
 * unmounts of non-legacy filesystems, as this is the dominant administrative
 * interface.
 */
Called when invoked as /etc/fs/zfs/umount.  Unlike a manual mount, we allow
unmounts of non-legacy filesystems, as this is the dominant administrative
interface.
Called when invoked as / etc / fs / zfs / umount . Unlike a manual mount we allow unmounts of non - legacy filesystems as this is the dominant administrative interface .
static int
manual_unmount(int argc, char **argv)
{
	int flags = 0;
	int c;
	while ((c = getopt(argc, argv, "f")) != -1) {
		switch (c) {
		case 'f':
			flags = MS_FORCE;
			break;
		case '?':
			(void) fprintf(stderr, gettext("invalid option '%c'\n"),
			    optopt);
			(void) fprintf(stderr, gettext("usage: unmount [-f] "
			    "<path>\n"));
			return (2);
		}
	}
	argc -= optind;
	argv += optind;
	if (argc != 1) {
		if (argc == 0)
			(void) fprintf(stderr, gettext("missing path "
			    "argument\n"));
		else
			(void) fprintf(stderr, gettext("too many arguments\n"));
		(void) fprintf(stderr, gettext("usage: unmount [-f] <path>\n"));
		return (2);
	}
	return (unshare_unmount_path(OP_MOUNT, argv[0], flags, B_TRUE));
}
static int manual_unmount ( int argc , char * * argv ) { int flags = 0 ; int c ; while ( ( c = getopt ( argc , argv , " " ) ) != -1 ) { switch ( c ) { case ' ' : flags = MS_FORCE ; break ; case ' ' : ( void ) fprintf ( stderr , gettext ( " \n " ) , optopt ) ; ( void ) fprintf ( stderr , gettext ( " " " \n " ) ) ; return ( 2 ) ; } } argc -= optind ; argv += optind ; if ( argc != 1 ) { if ( argc == 0 ) ( void ) fprintf ( stderr , gettext ( " " " \n " ) ) ; else ( void ) fprintf ( stderr , gettext ( " \n " ) ) ; ( void ) fprintf ( stderr , gettext ( " \n " ) ) ; return ( 2 ) ; } return ( unshare_unmount_path ( OP_MOUNT , argv [ 0 ] , flags , B_TRUE ) ) ; }
Called when invoked as /etc/fs/zfs/umount.
Called when invoked as / etc / fs / zfs / umount .
/* check options */ /* check arguments */