All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Waychison <michael.waychison@sun.com>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Cc: raven@themaw.net
Subject: [PATCH 27/28] Testing syscall for expiry
Date: Mon, 25 Oct 2004 10:52:12 -0400	[thread overview]
Message-ID: <1098715932358@sun.com> (raw)
In-Reply-To: <1098715902968@sun.com>

This patch adds a temporary syscall (to x86 only) that allows for quick
testing to make sure that mnt_expire works properly.  Tests can be found in
the autofsng userspace package.

Signed-off-by: Mike Waychison <michael.waychison@sun.com>
---

 arch/i386/kernel/entry.S  |    1 +
 fs/namespace.c            |   32 ++++++++++++++++++++++++++++++++
 include/asm-i386/unistd.h |    3 ++-
 3 files changed, 35 insertions(+), 1 deletion(-)

Index: linux-2.6.9-quilt/arch/i386/kernel/entry.S
===================================================================
--- linux-2.6.9-quilt.orig/arch/i386/kernel/entry.S	2004-10-22 17:17:40.735271440 -0400
+++ linux-2.6.9-quilt/arch/i386/kernel/entry.S	2004-10-22 17:17:48.436100736 -0400
@@ -903,5 +903,6 @@ ENTRY(sys_call_table)
 	.long sys_ni_syscall
 	.long sys_ni_syscall
 	.long sys_mountfd		/* 300 */
+	.long sys_mnt_expire
 
 syscall_table_size=(.-sys_call_table)
Index: linux-2.6.9-quilt/include/asm-i386/unistd.h
===================================================================
--- linux-2.6.9-quilt.orig/include/asm-i386/unistd.h	2004-10-22 17:17:40.735271440 -0400
+++ linux-2.6.9-quilt/include/asm-i386/unistd.h	2004-10-22 17:17:48.436100736 -0400
@@ -290,8 +290,9 @@
 #define __NR_mq_getsetattr	(__NR_mq_open+5)
 #define __NR_sys_kexec_load	283
 #define __NR_mountfd		300
+#define __NR_mnt_expire		301
 
-#define NR_syscalls 301
+#define NR_syscalls 302
 
 /* user-visible error numbers are in the range -1 - -124: see <asm-i386/errno.h> */
 
Index: linux-2.6.9-quilt/fs/namespace.c
===================================================================
--- linux-2.6.9-quilt.orig/fs/namespace.c	2004-10-22 17:17:47.809196040 -0400
+++ linux-2.6.9-quilt/fs/namespace.c	2004-10-22 17:17:48.437100584 -0400
@@ -1119,6 +1119,38 @@ static void bump_expiry_counter(struct v
 		parent->mnt_expiry_countdown = diff;
 }
 
+/* TESTING PURPOSES ONLY:  THIS IS NOT A REAL SYSCALL!! - IT WILL GO AWAY */
+asmlinkage int sys_mnt_expire(char __user *_path, int ticks)
+{
+	struct nameidata nd;
+	char *path;
+	int err;
+
+	path = getname(_path);
+	err = PTR_ERR(path);
+	if (IS_ERR(path))
+		goto out;
+
+	err = path_lookup(path, LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_NOALT, &nd);
+	if (err)
+		goto out_name;
+
+	err = -EINVAL;
+	if (nd.mnt->mnt_root != nd.dentry)
+		goto out_nd;
+
+	err = -EBUSY;
+	if (!mnt_expire(nd.mnt, ticks))
+		err = 0;
+
+out_nd:
+	path_release(&nd);
+out_name:
+	putname(path);
+out:
+	return err;
+}
+
 /*
  * process a list of expirable mountpoints with the intent of discarding any
  * mountpoints that aren't in use and haven't been touched since last we came


  reply	other threads:[~2004-10-26  0:15 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                         ` Mike Waychison [this message]
2004-10-25 15:01                           ` [PATCH 27/28] Testing syscall for expiry 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   ` [PATCH 15/28] VFS: Mountpoint file descriptor umount support Christoph Hellwig
2004-10-26 14:16     ` 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=1098715932358@sun.com \
    --to=michael.waychison@sun.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.