linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Mike Waychison <michael.waychison@sun.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	raven@themaw.net
Subject: Re: [PATCH 15/28] VFS: Mountpoint file descriptor umount support
Date: Tue, 26 Oct 2004 11:28:38 +0100	[thread overview]
Message-ID: <20041026102838.GB12026@infradead.org> (raw)
In-Reply-To: <10987155691365@sun.com>

On Mon, Oct 25, 2004 at 10:46:09AM -0400, Mike Waychison wrote:
> This patch adds functionality to mountfd so that a user can perform the
> various types of umount (forced umount, not-busy umount, lazy-umount).
> 
> Signed-off-by: Mike Waychison <michael.waychison@sun.com>
> ---
> 
>  fs/mountfd.c       |   20 ++++++++++++++++++++
>  fs/namespace.c     |    2 +-
>  include/linux/fs.h |    5 ++++-
>  3 files changed, 25 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6.9-quilt/fs/mountfd.c
> ===================================================================
> --- linux-2.6.9-quilt.orig/fs/mountfd.c	2004-10-22 17:17:40.736271288 -0400
> +++ linux-2.6.9-quilt/fs/mountfd.c	2004-10-22 17:17:41.367175376 -0400
> @@ -11,6 +11,8 @@
>  
>  #define VFSMOUNT(filp) ((struct vfsmount *)((filp)->private_data))
>  
> +extern int do_umount(struct vfsmount *mnt, int flags);
> +
>  static struct vfsmount *mfdfs_mnt;
>  
>  static void mfdfs_read_inode(struct inode *inode);
> @@ -72,6 +74,18 @@ static int mfd_release(struct inode *ino
>  	return 0;
>  }
>  
> +static long mfd_umount(struct file *mountfilp, int flags)
> +{
> +	struct vfsmount *mnt;
> +	int error;
> +	
> +	mnt = mntget(VFSMOUNT(mountfilp));
> +
> +	error = do_umount(mnt, flags);
> +
> +	return error;
> +}
> +
>  static int mfd_ioctl(struct inode *inode, struct file *filp,
>  		     unsigned int cmd, unsigned long arg);
>  static struct file_operations mfd_file_ops = {
> @@ -243,6 +257,12 @@ static int mfd_ioctl(struct inode *inode
>  	switch (cmd) {
>  	case MOUNTFD_IOC_GETDIRFD:
>  		return mfd_getdirfd(filp);
> +	case MOUNTFD_IOC_DETACH:
> +		return mfd_umount(filp, MNT_DETACH);
> +	case MOUNTFD_IOC_UNMOUNT:
> +		return mfd_umount(filp, 0);
> +	case MOUNTFD_IOC_FORCEDUNMOUNT:
> +		return mfd_umount(filp, MNT_FORCE);

Urgg, you don't want to add gazillions of strange ioctls, do you?


  parent reply	other threads:[~2004-10-26 10:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <10987155332448@sun.com>
2004-10-25 14:46 ` [PATCH 15/28] VFS: Mountpoint file descriptor umount support Mike Waychison
2004-10-25 14:46   ` [PATCH 16/28] VFS: Mountpoint file descriptor attach support Mike Waychison
2004-10-25 14:47     ` [PATCH 17/28] VFS: Mountpoint file descriptor walking Mike Waychison
2004-10-25 14:47       ` [PATCH 18/28] VFS: Mountpoint file descriptor read properties Mike Waychison
2004-10-25 14:48         ` [PATCH 19/28] VFS: Mountpoint file descriptor expiry support Mike Waychison
2004-10-25 14:48           ` [PATCH 20/28] HOTPLUG: call_usermodehelper callback support Mike Waychison
2004-10-25 14:49             ` [PATCH 21/28] HOTPLUG: Hack to allow for call to execve Mike Waychison
2004-10-25 14:49               ` [PATCH 22/28] VFS: Export put_namespace Mike Waychison
2004-10-25 14:50                 ` [PATCH 23/28] VFS: Export get_sb_pseudo Mike Waychison
2004-10-25 14:50                   ` [PATCH 24/28] VFS: Fixup for ->follow_link on root of filesystem Mike Waychison
2004-10-25 14:51                     ` [PATCH 25/28] VFS: statfs(64) shouldn't follow last component symlink Mike Waychison
2004-10-25 14:51                       ` [PATCH 26/28] VFS: Introduce MNT_NOFOLLOW Mike Waychison
2004-10-25 14:52                         ` [PATCH 27/28] Testing syscall for expiry Mike Waychison
2004-10-25 15:01                           ` Christoph Hellwig
2004-10-25 15:37                           ` [PATCH 28/28] AUTOFSNG: New autofs filesystem (resend) Mike Waychison
2004-10-25 15:14                       ` [PATCH 25/28] VFS: statfs(64) shouldn't follow last component symlink Christoph Hellwig
2004-10-25 15:21                         ` Mike Waychison
2004-10-25 15:18             ` [PATCH 20/28] HOTPLUG: call_usermodehelper callback support Christoph Hellwig
2004-10-25 15:29               ` Mike Waychison
2004-10-26 10:28   ` Christoph Hellwig [this message]
2004-10-26 14:16     ` [PATCH 15/28] VFS: Mountpoint file descriptor umount support Mike Waychison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041026102838.GB12026@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.waychison@sun.com \
    --cc=raven@themaw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).