Skip to contentSkip to conversation

autofs - series to replace autofs with autofs4

RFC PATCH New Ian Kent 1 participant 4 messages Nov 26, 2009

Subsystems (2)
lore
Share & tools
lore

Ian Kent

author maintainer
#0 lore raw

cover autofs - series to replace autofs with autofs4

Due to planned changes to locking for the path walking the autofs module could easily deadlock during mount request callback. Since the autofs4 module provides the needed support and a patch series to overcome the locking change has been done, rather than attempt to fix autofs I propose that the autofs module be replaced by the autofs4 module.

To try and give people some warning before actually removing the autofs4 directory I've left that in place, updated the Kconfig help text to warn of the impending removal, and provided a make that builds into the autofs4 directory from the updated autofs directory source. The net result is that fs/autofs/autofs.ko and fs/autofs4/autofs4.ko will be built from the same source.

Also, the defconfig configurations have not yet been changed but that can be done upon actual removal.

Comments on this appraoch and the patch series are welcome.

---

Ian Kent (3):
autofs - use consistent function naming
autofs - rename autofs4 module to autofs
autofs4 - coding style fixes

 fs/autofs/Kconfig      |   12 
 fs/autofs/Makefile     |    2 
 fs/autofs/autofs_i.h   |  317 +++++++++---
 fs/autofs/dev-ioctl.c  |  766 +++++++++++++++++++++++++++++
 fs/autofs/dirhash.c    |  250 ---------
 fs/autofs/expire.c     |  531 ++++++++++++++++++++
 fs/autofs/init.c       |   30 -
 fs/autofs/inode.c      |  406 +++++++++++----
 fs/autofs/root.c       | 1268 ++++++++++++++++++++++++++++++++++--------------
 fs/autofs/symlink.c    |   10 
 fs/autofs/waitq.c      |  474 +++++++++++++++---
 fs/autofs4/Kconfig     |   10 
 fs/autofs4/Makefile    |   10 
 fs/autofs4/autofs_i.h  |  304 ------------
 fs/autofs4/dev-ioctl.c |  765 -----------------------------
 fs/autofs4/expire.c    |  530 --------------------
 fs/autofs4/init.c      |   51 --
 fs/autofs4/inode.c     |  473 ------------------
 fs/autofs4/root.c      | 1109 ------------------------------------------
 fs/autofs4/symlink.c   |   25 -
 fs/autofs4/waitq.c     |  524 --------------------
 21 files changed, 3157 insertions(+), 4710 deletions(-)
 create mode 100644 fs/autofs/dev-ioctl.c
 delete mode 100644 fs/autofs/dirhash.c
 create mode 100644 fs/autofs/expire.c
 delete mode 100644 fs/autofs4/autofs_i.h
 delete mode 100644 fs/autofs4/dev-ioctl.c
 delete mode 100644 fs/autofs4/expire.c
 delete mode 100644 fs/autofs4/init.c
 delete mode 100644 fs/autofs4/inode.c
 delete mode 100644 fs/autofs4/root.c
 delete mode 100644 fs/autofs4/symlink.c
 delete mode 100644 fs/autofs4/waitq.c
Signature · 1 line
Ian
author maintainer
#1 lore raw

RFC PATCH 1/3 autofs4 - coding style fixes

---

 fs/autofs4/autofs_i.h  |   26 +++++++++++-----------
 fs/autofs4/dev-ioctl.c |    3 ++-
 fs/autofs4/expire.c    |   36 +++++++++++++++++-------------
 fs/autofs4/init.c      |    7 ++----
 fs/autofs4/inode.c     |   22 +++++++++----------
 fs/autofs4/root.c      |   57 +++++++++++++++++++++++++++---------------------
 fs/autofs4/symlink.c   |    5 +---
 fs/autofs4/waitq.c     |   21 +++++++++---------
 8 files changed, 92 insertions(+), 85 deletions(-)
fs/autofs4/autofs_i.h +13 -13
index 0118d67..b4a0d82 100644
@@ -1,7 +1,4 @@
-/* -*- c -*- ------------------------------------------------------------- *
- *   
- * linux/fs/autofs/autofs_i.h
- *
+/*
  *   Copyright 1997-1998 Transmeta Corporation - All Rights Reserved
  *   Copyright 2005-2006 Ian Kent <[email protected]>
  *
@@ -101,7 +98,7 @@ struct autofs_info {
 	} u;
 };
 
-#define AUTOFS_INF_EXPIRING	(1<<0) /* dentry is in the process of expiring */
+#define AUTOFS_INF_EXPIRING	(1<<0) /* dentry in the process of expiring */
 #define AUTOFS_INF_MOUNTPOINT	(1<<1) /* mountpoint status for direct expire */
 #define AUTOFS_INF_PENDING	(1<<2) /* dentry pending mount */
 #define AUTOFS_INF_REHASH	(1<<3) /* dentry in transit to ->lookup() */
@@ -158,11 +155,13 @@ static inline struct autofs_info *autofs4_dentry_ino(struct dentry *dentry)
 	return (struct autofs_info *)(dentry->d_fsdata);
 }
 
-/* autofs4_oz_mode(): do we see the man behind the curtain?  (The
-   processes which do manipulations for us in user space sees the raw
-   filesystem without "magic".) */
-
-static inline int autofs4_oz_mode(struct autofs_sb_info *sbi) {
+/*
+ * autofs4_oz_mode(): do we see the man behind the curtain?  (The
+ * processes which do manipulations for us in user space sees the raw
+ * filesystem without "magic".)
+ */
+static inline int autofs4_oz_mode(struct autofs_sb_info *sbi)
+{
 	return sbi->catatonic || task_pgrp_nr(current) == sbi->oz_pgrp;
 }
 
@@ -225,12 +224,13 @@ extern const struct file_operations autofs4_root_operations;
 /* Initializing function */
 
 int autofs4_fill_super(struct super_block *, void *, int);
-struct autofs_info *autofs4_init_ino(struct autofs_info *, struct autofs_sb_info *sbi, mode_t mode);
+struct autofs_info *autofs4_init_ino(struct autofs_info *,
+				     struct autofs_sb_info *, mode_t);
 
 /* Queue management functions */
 
-int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify);
-int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int);
+int autofs4_wait(struct autofs_sb_info *, struct dentry *, enum autofs_notify);
+int autofs4_wait_release(struct autofs_sb_info *, autofs_wqt_t, int);
 void autofs4_catatonic_mode(struct autofs_sb_info *);
 
 static inline int autofs4_follow_mount(struct path *path)
fs/autofs4/dev-ioctl.c +2 -1
index 00bf8fc..a0dcc5b 100644
@@ -620,7 +620,8 @@ static ioctl_fn lookup_dev_ioctl(unsigned int cmd)
 }
 
 /* ioctl dispatcher */
-static int _autofs_dev_ioctl(unsigned int command, struct autofs_dev_ioctl __user *user)
+static int
+_autofs_dev_ioctl(unsigned int command, struct autofs_dev_ioctl __user *user)
 {
 	struct autofs_dev_ioctl *param;
 	struct file *fp;
fs/autofs4/expire.c +20 -16
index 74bc9aa..204c4fe 100644
@@ -1,7 +1,4 @@
-/* -*- c -*- --------------------------------------------------------------- *
- *
- * linux/fs/autofs/expire.c
- *
+/*
  *  Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
  *  Copyright 1999-2000 Jeremy Fitzhardinge <[email protected]>
  *  Copyright 2001-2006 Ian Kent <[email protected]>
@@ -144,7 +141,7 @@ static int autofs4_direct_busy(struct vfsmount *mnt,
  * The tree is not busy iff no mountpoints are busy
  */
 static int autofs4_tree_busy(struct vfsmount *mnt,
-	       		     struct dentry *top,
+			     struct dentry *top,
 			     unsigned long timeout,
 			     int do_now)
 {
@@ -319,10 +316,14 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
 	spin_lock(&dcache_lock);
 	next = root->d_subdirs.next;
 
-	/* On exit from the loop expire is set to a dgot dentry
-	 * to expire or it's NULL */
-	while ( next != &root->d_subdirs ) {
-		struct dentry *dentry = list_entry(next, struct dentry, d_u.d_child);
+	/*
+	 * On exit from the loop expire is set to a dgot dentry
+	 * to expire or it's NULL
+	 */
+	while (next != &root->d_subdirs) {
+		struct dentry *dentry;
+
+		dentry = list_entry(next, struct dentry, d_u.d_child);
 
 		/* Negative dentry - give up */
 		if (!simple_positive(dentry)) {
@@ -343,8 +344,8 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
 		 *	   offset (autofs-5.0+).
 		 */
 		if (d_mountpoint(dentry)) {
-			DPRINTK("checking mountpoint %p %.*s",
-				dentry, (int)dentry->d_name.len, dentry->d_name.name);
+			DPRINTK("checking mountpoint %p %.*s", dentry,
+				(int)dentry->d_name.len, dentry->d_name.name);
 
 			/* Path walk currently on this dentry? */
 			ino_count = atomic_read(&ino->count) + 2;
@@ -456,12 +457,13 @@ int autofs4_expire_run(struct super_block *sb,
 	struct dentry *dentry;
 	int ret = 0;
 
-	memset(&pkt,0,sizeof pkt);
+	memset(&pkt, 0, sizeof pkt);
 
 	pkt.hdr.proto_version = sbi->version;
 	pkt.hdr.type = autofs_ptype_expire;
 
-	if ((dentry = autofs4_expire_indirect(sb, mnt, sbi, 0)) == NULL)
+	dentry = autofs4_expire_indirect(sb, mnt, sbi, 0);
+	if (dentry == NULL)
 		return -EAGAIN;
 
 	pkt.len = dentry->d_name.len;
@@ -469,7 +471,7 @@ int autofs4_expire_run(struct super_block *sb,
 	pkt.name[pkt.len] = '\0';
 	dput(dentry);
 
-	if ( copy_to_user(pkt_p, &pkt, sizeof(struct autofs_packet_expire)) )
+	if (copy_to_user(pkt_p, &pkt, sizeof(struct autofs_packet_expire)))
 		ret = -EFAULT;
 
 	spin_lock(&sbi->fs_lock);
@@ -496,8 +498,10 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
 	if (dentry) {
 		struct autofs_info *ino = autofs4_dentry_ino(dentry);
 
-		/* This is synchronous because it makes the daemon a
-                   little easier */
+		/*
+		 * This is synchronous because it makes the daemon a
+		 * little easier
+		 */
 		ret = autofs4_wait(sbi, dentry, NFY_EXPIRE);
 
 		spin_lock(&sbi->fs_lock);
fs/autofs4/init.c +2 -5
index 9722e4b..11cc42b 100644
@@ -1,7 +1,4 @@
-/* -*- c -*- --------------------------------------------------------------- *
- *
- * linux/fs/autofs/init.c
- *
+/*
  *  Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
  *
  * This file is part of the Linux kernel and is made available under
@@ -46,6 +43,6 @@ static void __exit exit_autofs4_fs(void)
 	unregister_filesystem(&autofs_fs_type);
 }
 
-module_init(init_autofs4_fs) 
+module_init(init_autofs4_fs)
 module_exit(exit_autofs4_fs)
 MODULE_LICENSE("GPL");
fs/autofs4/inode.c +11 -11
index d0a3de2..5b006db 100644
@@ -1,7 +1,4 @@
-/* -*- c -*- --------------------------------------------------------------- *
- *
- * linux/fs/autofs/inode.c
- *
+/*
  *  Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
  *  Copyright 2005-2006 Ian Kent <[email protected]>
  *
@@ -116,7 +113,9 @@ repeat:
 	next = this_parent->d_subdirs.next;
 resume:
 	while (next != &this_parent->d_subdirs) {
-		struct dentry *dentry = list_entry(next, struct dentry, d_u.d_child);
+		struct dentry *dentry;
+
+		dentry = list_entry(next, struct dentry, d_u.d_child);
 
 		/* Negative dentry - don`t care */
 		if (!simple_positive(dentry)) {
@@ -328,7 +327,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 	sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
 	if (!sbi)
 		goto fail_unlock;
-	DPRINTK("starting up, sbi = %p",sbi);
+	DPRINTK("starting up, sbi = %p", sbi);
 
 	s->s_fs_info = sbi;
 	sbi->magic = AUTOFS_SBI_MAGIC;
@@ -377,7 +376,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 	if (parse_options(data, &pipefd, &root_inode->i_uid, &root_inode->i_gid,
 				&sbi->oz_pgrp, &sbi->type, &sbi->min_proto,
 				&sbi->max_proto)) {
-		printk("autofs: called with bogus options\n");
+		printk(KERN_ERR "autofs: called with bogus options\n");
 		goto fail_dput;
 	}
 
@@ -389,8 +388,8 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 	/* Couldn't this be tested earlier? */
 	if (sbi->max_proto < AUTOFS_MIN_PROTO_VERSION ||
 	    sbi->min_proto > AUTOFS_MAX_PROTO_VERSION) {
-		printk("autofs: kernel does not match daemon version "
-		       "daemon (%d, %d) kernel (%d, %d)\n",
+		printk(KERN_ERR "autofs: kernel does not match daemon "
+		       "version (%d, %d) kernel (%d, %d)\n",
 			sbi->min_proto, sbi->max_proto,
 			AUTOFS_MIN_PROTO_VERSION, AUTOFS_MAX_PROTO_VERSION);
 		goto fail_dput;
@@ -407,7 +406,8 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 	pipe = fget(pipefd);
 	
 	if (!pipe) {
-		printk("autofs: could not open pipe file descriptor\n");
+		printk(KERN_ERR
+		      "autofs: could not open pipe file descriptor\n");
 		goto fail_dput;
 	}
 	if (!pipe->f_op || !pipe->f_op->write)
@@ -421,7 +421,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 	 */
 	s->s_root = root;
 	return 0;
-	
+
 	/*
 	 * Failure ... clean up.
 	 */
fs/autofs4/root.c +32 -25

135 lines not on this page · raw message

fs/autofs4/symlink.c +1 -4
index b4ea829..296fbd9 100644
@@ -1,7 +1,4 @@
-/* -*- c -*- --------------------------------------------------------------- *
- *
- * linux/fs/autofs/symlink.c
- *
+/*
  *  Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
  *
  * This file is part of the Linux kernel and is made available under
fs/autofs4/waitq.c +11 -10
index 2341375..a4e55da 100644
@@ -1,7 +1,4 @@
-/* -*- c -*- --------------------------------------------------------------- *
- *
- * linux/fs/autofs/waitq.c
- *
+/*
  *  Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
  *  Copyright 2001-2006 Ian Kent <[email protected]>
  *
@@ -114,8 +111,9 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
 	/* Kernel protocol v4 missing and expire packets */
 	case autofs_ptype_missing:
 	{
-		struct autofs_packet_missing *mp = &pkt.v4_pkt.missing;
+		struct autofs_packet_missing *mp;
 
+		mp = &pkt.v4_pkt.missing;
 		pktsz = sizeof(*mp);
 
 		mp->wait_queue_token = wq->wait_queue_token;
@@ -126,8 +124,9 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
 	}
 	case autofs_ptype_expire_multi:
 	{
-		struct autofs_packet_expire_multi *ep = &pkt.v4_pkt.expire_multi;
+		struct autofs_packet_expire_multi *ep;
 
+		ep = &pkt.v4_pkt.expire_multi;
 		pktsz = sizeof(*ep);
 
 		ep->wait_queue_token = wq->wait_queue_token;
@@ -145,8 +144,9 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
 	case autofs_ptype_missing_direct:
 	case autofs_ptype_expire_direct:
 	{
-		struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet;
+		struct autofs_v5_packet *packet;
 
+		packet = &pkt.v5_pkt.v5_packet;
 		pktsz = sizeof(*packet);
 
 		packet->wait_queue_token = wq->wait_queue_token;
@@ -162,7 +162,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
 		break;
 	}
 	default:
-		printk("autofs4_notify_daemon: bad type %d!\n", type);
+		printk(KERN_ERR "autofs4_notify_daemon: bad type %d!\n", type);
 		return;
 	}
 
@@ -239,7 +239,7 @@ autofs4_find_wait(struct autofs_sb_info *sbi, struct qstr *qstr)
 static int validate_request(struct autofs_wait_queue **wait,
 			    struct autofs_sb_info *sbi,
 			    struct qstr *qstr,
-			    struct dentry*dentry, enum autofs_notify notify)
+			    struct dentry *dentry, enum autofs_notify notify)
 {
 	struct autofs_wait_queue *wq;
 	struct autofs_info *ino;
@@ -495,7 +495,8 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
 }
 
 
-int autofs4_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_token, int status)
+int autofs4_wait_release(struct autofs_sb_info *sbi,
+			 autofs_wqt_t wait_queue_token, int status)
 {
 	struct autofs_wait_queue *wq, **wql;
 
author maintainer
#2 lore raw

RFC PATCH 2/3 autofs - rename autofs4 module to autofs

In reply to Ian Kent

---

 fs/autofs/Kconfig      |   12 
 fs/autofs/Makefile     |    2 
 fs/autofs/autofs_i.h   |  327 +++++++++---
 fs/autofs/dev-ioctl.c  |  766 ++++++++++++++++++++++++++++
 fs/autofs/dirhash.c    |  250 ---------
 fs/autofs/expire.c     |  534 ++++++++++++++++++++
 fs/autofs/init.c       |   38 +
 fs/autofs/inode.c      |  419 +++++++++++-----
 fs/autofs/root.c       | 1294 ++++++++++++++++++++++++++++++++++--------------
 fs/autofs/symlink.c    |   16 -
 fs/autofs/waitq.c      |  480 +++++++++++++++---
 fs/autofs4/Kconfig     |   10 
 fs/autofs4/Makefile    |   10 
 fs/autofs4/autofs_i.h  |  304 -----------
 fs/autofs4/dev-ioctl.c |  766 ----------------------------
 fs/autofs4/expire.c    |  534 --------------------
 fs/autofs4/init.c      |   48 --
 fs/autofs4/inode.c     |  473 ------------------
 fs/autofs4/root.c      | 1116 -----------------------------------------
 fs/autofs4/symlink.c   |   22 -
 fs/autofs4/waitq.c     |  525 -------------------
 21 files changed, 3195 insertions(+), 4751 deletions(-)
 create mode 100644 fs/autofs/dev-ioctl.c
 delete mode 100644 fs/autofs/dirhash.c
 create mode 100644 fs/autofs/expire.c
 delete mode 100644 fs/autofs4/autofs_i.h
 delete mode 100644 fs/autofs4/dev-ioctl.c
 delete mode 100644 fs/autofs4/expire.c
 delete mode 100644 fs/autofs4/init.c
 delete mode 100644 fs/autofs4/inode.c
 delete mode 100644 fs/autofs4/root.c
 delete mode 100644 fs/autofs4/symlink.c
 delete mode 100644 fs/autofs4/waitq.c
fs/autofs/Kconfig +4 -8
index 5f3bea9..12bf6b5 100644
@@ -1,18 +1,14 @@
 config AUTOFS_FS
-	tristate "Kernel automounter support"
+	tristate "Kernel automounter support (supports v3, v4 and v5)"
 	help
 	  The automounter is a tool to automatically mount remote file systems
 	  on demand. This implementation is partially kernel-based to reduce
 	  overhead in the already-mounted case; this is unlike the BSD
 	  automounter (amd), which is a pure user space daemon.
 
-	  To use the automounter you need the user-space tools from the autofs
-	  package; you can find the location in <file:Documentation/Changes>.
-	  You also want to answer Y to "NFS file system support", below.
-
-	  If you want to use the newer version of the automounter with more
-	  features, say N here and say Y to "Kernel automounter v4 support",
-	  below.
+	  To use the automounter you need the user-space tools from
+	  <ftp://ftp.kernel.org/pub/linux/daemons/autofs/>; you also want
+	  to answer Y to "NFS file system support", below.
 
 	  To compile this support as a module, choose M here: the module will be
 	  called autofs.
fs/autofs/Makefile +1 -1
index 453a60f..43fedde 100644
@@ -4,4 +4,4 @@
 
 obj-$(CONFIG_AUTOFS_FS) += autofs.o
 
-autofs-objs := dirhash.o init.o inode.o root.o symlink.o waitq.o
+autofs-objs := init.o inode.o root.o symlink.o waitq.o expire.o dev-ioctl.o
fs/autofs/autofs_i.h +233 -94

395 lines not on this page · raw message

fs/autofs/dev-ioctl.c new file +766 -0

766 lines not on this page · raw message

fs/autofs/dirhash.c deleted +0 -250

250 lines not on this page · raw message

fs/autofs/expire.c new file +534 -0

534 lines not on this page · raw message

fs/autofs/init.c +17 -21
index cea5219..11cc42b 100644
@@ -1,7 +1,4 @@
-/* -*- linux-c -*- --------------------------------------------------------- *
- *
- * linux/fs/autofs/init.c
- *
+/*
  *  Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
  *
  * This file is part of the Linux kernel and is made available under
@@ -17,36 +14,35 @@
 static int autofs_get_sb(struct file_system_type *fs_type,
 	int flags, const char *dev_name, void *data, struct vfsmount *mnt)
 {
-	return get_sb_nodev(fs_type, flags, data, autofs_fill_super, mnt);
+	return get_sb_nodev(fs_type, flags, data, autofs4_fill_super, mnt);
 }
 
 static struct file_system_type autofs_fs_type = {
 	.owner		= THIS_MODULE,
 	.name		= "autofs",
 	.get_sb		= autofs_get_sb,
-	.kill_sb	= autofs_kill_sb,
+	.kill_sb	= autofs4_kill_sb,
 };
 
-static int __init init_autofs_fs(void)
+static int __init init_autofs4_fs(void)
 {
-	return register_filesystem(&autofs_fs_type);
+	int err;
+
+	err = register_filesystem(&autofs_fs_type);
+	if (err)
+		return err;
+
+	autofs_dev_ioctl_init();
+
+	return err;
 }
 
-static void __exit exit_autofs_fs(void)
+static void __exit exit_autofs4_fs(void)
 {
+	autofs_dev_ioctl_exit();
 	unregister_filesystem(&autofs_fs_type);
 }
 
-module_init(init_autofs_fs);
-module_exit(exit_autofs_fs);
-
-#ifdef DEBUG
-void autofs_say(const char *name, int len)
-{
-	printk("(%d: ", len);
-	while ( len-- )
-		printk("%c", *name++);
-	printk(")\n");
-}
-#endif
+module_init(init_autofs4_fs)
+module_exit(exit_autofs4_fs)
 MODULE_LICENSE("GPL");
fs/autofs/inode.c +302 -117

572 lines not on this page · raw message

fs/autofs/root.c +915 -379

396 lines not on this page · raw message

fs/autofs/symlink.c +6 -10
index 7ce9cb2..296fbd9 100644

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

fs/autofs/waitq.c +400 -80

480 lines not on this page · raw message

fs/autofs4/Kconfig +8 -2
index 1204d63..4c8bc1f 100644

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

fs/autofs4/Makefile +9 -1
index a811c1f..bd4a535 100644

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

fs/autofs4/autofs_i.h deleted +0 -304

304 lines not on this page · raw message

fs/autofs4/dev-ioctl.c deleted +0 -766

766 lines not on this page · raw message

fs/autofs4/expire.c deleted +0 -534

534 lines not on this page · raw message

fs/autofs4/init.c deleted +0 -48

48 lines not on this page · raw message

fs/autofs4/inode.c deleted +0 -473

473 lines not on this page · raw message

fs/autofs4/root.c deleted +0 -1116

1,116 lines not on this page · raw message

fs/autofs4/symlink.c deleted +0 -22
deleted file mode 100644
index 296fbd9..0000000

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

fs/autofs4/waitq.c deleted +0 -525

525 lines not on this page · raw message

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

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

author maintainer
#3 lore raw

RFC PATCH 3/3 autofs - use consistent function naming

In reply to Ian Kent

---

 fs/autofs/autofs_i.h  |   94 +++++++--------
 fs/autofs/dev-ioctl.c |   18 +--
 fs/autofs/expire.c    |  117 +++++++++---------
 fs/autofs/init.c      |   12 +-
 fs/autofs/inode.c     |   59 +++++----
 fs/autofs/root.c      |  312 +++++++++++++++++++++++++------------------------
 fs/autofs/symlink.c   |    8 +
 fs/autofs/waitq.c     |   52 ++++----
 8 files changed, 334 insertions(+), 338 deletions(-)
fs/autofs/autofs_i.h +47 -47
index b4a0d82..e33b246 100644
@@ -145,30 +145,30 @@ struct autofs_sb_info {
 	struct list_head expiring_list;
 };
 
-static inline struct autofs_sb_info *autofs4_sbi(struct super_block *sb)
+static inline struct autofs_sb_info *autofs_sbi(struct super_block *sb)
 {
 	return (struct autofs_sb_info *)(sb->s_fs_info);
 }
 
-static inline struct autofs_info *autofs4_dentry_ino(struct dentry *dentry)
+static inline struct autofs_info *autofs_dentry_ino(struct dentry *dentry)
 {
 	return (struct autofs_info *)(dentry->d_fsdata);
 }
 
 /*
- * autofs4_oz_mode(): do we see the man behind the curtain?  (The
+ * autofs_oz_mode(): do we see the man behind the curtain?  (The
  * processes which do manipulations for us in user space sees the raw
  * filesystem without "magic".)
  */
-static inline int autofs4_oz_mode(struct autofs_sb_info *sbi)
+static inline int autofs_oz_mode(struct autofs_sb_info *sbi)
 {
 	return sbi->catatonic || task_pgrp_nr(current) == sbi->oz_pgrp;
 }
 
 /* Does a dentry have some pending activity? */
-static inline int autofs4_ispending(struct dentry *dentry)
+static inline int autofs_ispending(struct dentry *dentry)
 {
-	struct autofs_info *inf = autofs4_dentry_ino(dentry);
+	struct autofs_info *inf = autofs_dentry_ino(dentry);
 
 	if (inf->flags & AUTOFS_INF_PENDING)
 		return 1;
@@ -179,32 +179,32 @@ static inline int autofs4_ispending(struct dentry *dentry)
 	return 0;
 }
 
-static inline void autofs4_copy_atime(struct file *src, struct file *dst)
+static inline void autofs_copy_atime(struct file *src, struct file *dst)
 {
 	dst->f_path.dentry->d_inode->i_atime =
 		src->f_path.dentry->d_inode->i_atime;
 	return;
 }
 
-struct inode *autofs4_get_inode(struct super_block *, struct autofs_info *);
-void autofs4_free_ino(struct autofs_info *);
+struct inode *autofs_get_inode(struct super_block *, struct autofs_info *);
+void autofs_free_ino(struct autofs_info *);
 
 /* Expiration */
-int is_autofs4_dentry(struct dentry *);
-int autofs4_expire_wait(struct dentry *dentry);
-int autofs4_expire_run(struct super_block *, struct vfsmount *,
-			struct autofs_sb_info *,
-			struct autofs_packet_expire __user *);
-int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
-			    struct autofs_sb_info *sbi, int when);
-int autofs4_expire_multi(struct super_block *, struct vfsmount *,
+int is_autofs_dentry(struct dentry *);
+int autofs_expire_wait(struct dentry *dentry);
+int autofs_expire_run(struct super_block *, struct vfsmount *,
+		      struct autofs_sb_info *,
+		      struct autofs_packet_expire __user *);
+int autofs_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
+			   struct autofs_sb_info *sbi, int when);
+int autofs_expire_multi(struct super_block *, struct vfsmount *,
 			struct autofs_sb_info *, int __user *);
-struct dentry *autofs4_expire_direct(struct super_block *sb,
-				     struct vfsmount *mnt,
-				     struct autofs_sb_info *sbi, int how);
-struct dentry *autofs4_expire_indirect(struct super_block *sb,
-				       struct vfsmount *mnt,
-				       struct autofs_sb_info *sbi, int how);
+struct dentry *autofs_expire_direct(struct super_block *sb,
+				    struct vfsmount *mnt,
+				    struct autofs_sb_info *sbi, int how);
+struct dentry *autofs_expire_indirect(struct super_block *sb,
+				      struct vfsmount *mnt,
+				      struct autofs_sb_info *sbi, int how);
 
 /* Device node initialization */
 
@@ -213,27 +213,27 @@ void autofs_dev_ioctl_exit(void);
 
 /* Operations structures */
 
-extern const struct inode_operations autofs4_symlink_inode_operations;
-extern const struct inode_operations autofs4_dir_inode_operations;
-extern const struct inode_operations autofs4_root_inode_operations;
-extern const struct inode_operations autofs4_indirect_root_inode_operations;
-extern const struct inode_operations autofs4_direct_root_inode_operations;
-extern const struct file_operations autofs4_dir_operations;
-extern const struct file_operations autofs4_root_operations;
+extern const struct inode_operations autofs_symlink_inode_operations;
+extern const struct inode_operations autofs_dir_inode_operations;
+extern const struct inode_operations autofs_root_inode_operations;
+extern const struct inode_operations autofs_indirect_root_inode_operations;
+extern const struct inode_operations autofs_direct_root_inode_operations;
+extern const struct file_operations autofs_dir_operations;
+extern const struct file_operations autofs_root_operations;
 
 /* Initializing function */
 
-int autofs4_fill_super(struct super_block *, void *, int);
-struct autofs_info *autofs4_init_ino(struct autofs_info *,
-				     struct autofs_sb_info *, mode_t);
+int autofs_fill_super(struct super_block *, void *, int);
+struct autofs_info *autofs_init_ino(struct autofs_info *,
+				    struct autofs_sb_info *, mode_t);
 
 /* Queue management functions */
 
-int autofs4_wait(struct autofs_sb_info *, struct dentry *, enum autofs_notify);
-int autofs4_wait_release(struct autofs_sb_info *, autofs_wqt_t, int);
-void autofs4_catatonic_mode(struct autofs_sb_info *);
+int autofs_wait(struct autofs_sb_info *, struct dentry *, enum autofs_notify);
+int autofs_wait_release(struct autofs_sb_info *, autofs_wqt_t, int);
+void autofs_catatonic_mode(struct autofs_sb_info *);
 
-static inline int autofs4_follow_mount(struct path *path)
+static inline int autofs_follow_mount(struct path *path)
 {
 	int res = 0;
 
@@ -246,12 +246,12 @@ static inline int autofs4_follow_mount(struct path *path)
 	return res;
 }
 
-static inline u32 autofs4_get_dev(struct autofs_sb_info *sbi)
+static inline u32 autofs_get_dev(struct autofs_sb_info *sbi)
 {
 	return new_encode_dev(sbi->sb->s_dev);
 }
 
-static inline u64 autofs4_get_ino(struct autofs_sb_info *sbi)
+static inline u64 autofs_get_ino(struct autofs_sb_info *sbi)
 {
 	return sbi->sb->s_root->d_inode->i_ino;
 }
@@ -274,10 +274,10 @@ out:
 	return ret;
 }
 
-static inline void autofs4_add_expiring(struct dentry *dentry)
+static inline void autofs_add_expiring(struct dentry *dentry)
 {
-	struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
-	struct autofs_info *ino = autofs4_dentry_ino(dentry);
+	struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb);
+	struct autofs_info *ino = autofs_dentry_ino(dentry);
 	if (ino) {
 		spin_lock(&sbi->lookup_lock);
 		if (list_empty(&ino->expiring))
@@ -287,10 +287,10 @@ static inline void autofs4_add_expiring(struct dentry *dentry)
 	return;
 }
 
-static inline void autofs4_del_expiring(struct dentry *dentry)
+static inline void autofs_del_expiring(struct dentry *dentry)
 {
-	struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
-	struct autofs_info *ino = autofs4_dentry_ino(dentry);
+	struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb);
+	struct autofs_info *ino = autofs_dentry_ino(dentry);
 	if (ino) {
 		spin_lock(&sbi->lookup_lock);
 		if (!list_empty(&ino->expiring))
@@ -300,5 +300,5 @@ static inline void autofs4_del_expiring(struct dentry *dentry)
 	return;
 }
 
-void autofs4_dentry_release(struct dentry *);
-extern void autofs4_kill_sb(struct super_block *);
+void autofs_dentry_release(struct dentry *);
+extern void autofs_kill_sb(struct super_block *);
fs/autofs/dev-ioctl.c +9 -9
index a0dcc5b..ae357f4 100644
@@ -168,7 +168,7 @@ static struct autofs_sb_info *autofs_dev_ioctl_sbi(struct file *f)
 
 	if (f) {
 		inode = f->f_path.dentry->d_inode;
-		sbi = autofs4_sbi(inode->i_sb);
+		sbi = autofs_sbi(inode->i_sb);
 	}
 	return sbi;
 }
@@ -225,7 +225,7 @@ static int test_by_dev(struct path *path, void *p)
 
 static int test_by_type(struct path *path, void *p)
 {
-	struct autofs_info *ino = autofs4_dentry_ino(path->dentry);
+	struct autofs_info *ino = autofs_dentry_ino(path->dentry);
 	return ino && ino->sbi->type & *(unsigned *)p;
 }
 
@@ -331,7 +331,7 @@ static int autofs_dev_ioctl_ready(struct file *fp,
 	autofs_wqt_t token;
 
 	token = (autofs_wqt_t) param->ready.token;
-	return autofs4_wait_release(sbi, token, 0);
+	return autofs_wait_release(sbi, token, 0);
 }
 
 /*
@@ -347,7 +347,7 @@ static int autofs_dev_ioctl_fail(struct file *fp,
 
 	token = (autofs_wqt_t) param->fail.token;
 	status = param->fail.status ? param->fail.status : -ENOENT;
-	return autofs4_wait_release(sbi, token, status);
+	return autofs_wait_release(sbi, token, status);
 }
 
 /*
@@ -403,7 +403,7 @@ static int autofs_dev_ioctl_catatonic(struct file *fp,
 				      struct autofs_sb_info *sbi,
 				      struct autofs_dev_ioctl *param)
 {
-	autofs4_catatonic_mode(sbi);
+	autofs_catatonic_mode(sbi);
 	return 0;
 }
 
@@ -450,10 +450,10 @@ static int autofs_dev_ioctl_requester(struct file *fp,
 	if (err)
 		goto out;
 
-	ino = autofs4_dentry_ino(path.dentry);
+	ino = autofs_dentry_ino(path.dentry);
 	if (ino) {
 		err = 0;
-		autofs4_expire_wait(path.dentry);
+		autofs_expire_wait(path.dentry);
 		spin_lock(&sbi->fs_lock);
 		param->requester.uid = ino->uid;
 		param->requester.gid = ino->gid;
@@ -478,7 +478,7 @@ static int autofs_dev_ioctl_expire(struct file *fp,
 	how = param->expire.how;
 	mnt = fp->f_path.mnt;
 
-	return autofs4_do_expire_multi(sbi->sb, mnt, sbi, how);
+	return autofs_do_expire_multi(sbi->sb, mnt, sbi, how);
 }
 
 /* Check if autofs mount point is in use */
@@ -696,7 +696,7 @@ _autofs_dev_ioctl(unsigned int command, struct autofs_dev_ioctl __user *user)
 		 * Admin needs to be able to set the mount catatonic in
 		 * order to be able to perform the re-open.
 		 */
-		if (!autofs4_oz_mode(sbi) &&
+		if (!autofs_oz_mode(sbi) &&
 		    cmd != AUTOFS_DEV_IOCTL_CATATONIC_CMD) {
 			err = -EACCES;
 			fput(fp);
fs/autofs/expire.c +57 -60

325 lines not on this page · raw message

fs/autofs/init.c +6 -6
index 11cc42b..9c660c0 100644
@@ -14,17 +14,17 @@
 static int autofs_get_sb(struct file_system_type *fs_type,
 	int flags, const char *dev_name, void *data, struct vfsmount *mnt)
 {
-	return get_sb_nodev(fs_type, flags, data, autofs4_fill_super, mnt);
+	return get_sb_nodev(fs_type, flags, data, autofs_fill_super, mnt);
 }
 
 static struct file_system_type autofs_fs_type = {
 	.owner		= THIS_MODULE,
 	.name		= "autofs",
 	.get_sb		= autofs_get_sb,
-	.kill_sb	= autofs4_kill_sb,
+	.kill_sb	= autofs_kill_sb,
 };
 
-static int __init init_autofs4_fs(void)
+static int __init init_autofs_fs(void)
 {
 	int err;
 
@@ -37,12 +37,12 @@ static int __init init_autofs4_fs(void)
 	return err;
 }
 
-static void __exit exit_autofs4_fs(void)
+static void __exit exit_autofs_fs(void)
 {
 	autofs_dev_ioctl_exit();
 	unregister_filesystem(&autofs_fs_type);
 }
 
-module_init(init_autofs4_fs)
-module_exit(exit_autofs4_fs)
+module_init(init_autofs_fs)
+module_exit(exit_autofs_fs)
 MODULE_LICENSE("GPL");
fs/autofs/inode.c +29 -30

169 lines not on this page · raw message

fs/autofs/root.c +156 -156

752 lines not on this page · raw message

fs/autofs/symlink.c +4 -4
index 296fbd9..fcbbe5e 100644
@@ -9,14 +9,14 @@
 
 #include "autofs_i.h"
 
-static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
+static void *autofs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
-	struct autofs_info *ino = autofs4_dentry_ino(dentry);
+	struct autofs_info *ino = autofs_dentry_ino(dentry);
 	nd_set_link(nd, (char *)ino->u.symlink);
 	return NULL;
 }
 
-const struct inode_operations autofs4_symlink_inode_operations = {
+const struct inode_operations autofs_symlink_inode_operations = {
 	.readlink	= generic_readlink,
-	.follow_link	= autofs4_follow_link
+	.follow_link	= autofs_follow_link
 };
fs/autofs/waitq.c +26 -26

158 lines not on this page · raw message