patch-2.3.99-pre9 linux/fs/autofs/dir.c

Next file: linux/fs/autofs/dirhash.c
Previous file: linux/fs/affs/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre8/linux/fs/autofs/dir.c linux/fs/autofs/dir.c
@@ -12,29 +12,10 @@
 
 #include "autofs_i.h"
 
-static int autofs_dir_readdir(struct file *filp,
-			       void *dirent, filldir_t filldir)
-{
-	struct inode *inode=filp->f_dentry->d_inode;
-
-	switch((unsigned long) filp->f_pos)
-	{
-	case 0:
-		if (filldir(dirent, ".", 1, 0, inode->i_ino) < 0)
-			return 0;
-		filp->f_pos++;
-		/* fall through */
-	case 1:
-		if (filldir(dirent, "..", 2, 1, AUTOFS_ROOT_INO) < 0)
-			return 0;
-		filp->f_pos++;
-		/* fall through */
-	}
-	return 1;
-}
-
 /*
- * No entries except for "." and "..", both of which are handled by the VFS layer
+ * No entries except for "." and "..", both of which are handled by the VFS
+ * layer. So all children are negative and dcache-based versions of operations
+ * are OK.
  */
 static struct dentry *autofs_dir_lookup(struct inode *dir,struct dentry *dentry)
 {
@@ -44,7 +25,7 @@
 
 struct file_operations autofs_dir_operations = {
 	read:		generic_read_dir,
-	readdir:	autofs_dir_readdir,
+	readdir:	dcache_readdir,
 };
 
 struct inode_operations autofs_dir_inode_operations = {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)