]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] split namei.h out of fs.h
authorChristoph Hellwig <hch@infradead.org>
Wed, 22 May 2002 04:50:24 +0000 (21:50 -0700)
committerChristoph Hellwig <hch@infradead.org>
Wed, 22 May 2002 04:50:24 +0000 (21:50 -0700)
Currently fs.h is full of unrelated declarations and included in almost
any source file. Thus it makes sense to spilt certain aspects out that are
only used by few users.

This patch starts with the namei/path lookup interface and splits it into
<linux/namei.h> which is now directly included by the 24 files that actually
need it.

26 files changed:
drivers/usb/core/inode.c
fs/autofs/dirhash.c
fs/binfmt_misc.c
fs/coda/pioctl.c
fs/driverfs/inode.c
fs/exec.c
fs/exportfs/expfs.c
fs/namei.c
fs/namespace.c
fs/nfs/dir.c
fs/nfsctl.c
fs/nfsd/export.c
fs/nfsd/nfs3xdr.c
fs/nfsd/nfsproc.c
fs/nfsd/vfs.c
fs/open.c
fs/proc/base.c
fs/quota.c
fs/stat.c
fs/super.c
fs/xattr.c
include/linux/fs.h
include/linux/namei.h [new file with mode: 0644]
kernel/ksyms.c
mm/swapfile.c
net/unix/af_unix.c

index 73527b766d81d3c071972ac367efb8827483f0ae..5b7fac56a9a7f5d675491f65135e02efc2607c33 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/init.h>
 #include <linux/proc_fs.h>
 #include <linux/usb.h>
+#include <linux/namei.h>
 #include <linux/usbdevice_fs.h>
 #include <linux/smp_lock.h>
 #include <asm/byteorder.h>
index 448143fd0796a36546dedb42d3ff8a38807bd5c6..6b0a3595db057c9ee37f54bf60ae293073812145 100644 (file)
@@ -10,6 +10,8 @@
  *
  * ------------------------------------------------------------------------- */
 
+#include <linux/dcache.h>
+#include <linux/namei.h>
 #include "autofs_i.h"
 
 /* Functions for maintenance of expiry queue */
index 49e76ddda8cc4dcfe2f27b7621a3e06bd1b30149..926ff80a8bcc0510f9d25f8665b28445d4243302 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/ctype.h>
 #include <linux/file.h>
 #include <linux/pagemap.h>
+#include <linux/namei.h>
 
 #include <asm/uaccess.h>
 
index 53f4d2c714dc41d63922c3ff37fc55bc8549e2dd..e4633745e1e51f7fe032a461ff7620538de1b594 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/errno.h>
 #include <linux/string.h>
 #define __NO_VERSION__
+#include <linux/namei.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 
index 438dc6fa38ff8c9cc6abe82e39db50e7e6efbb29..5de6cd337e743a90f802c5a48660280bc18b9468 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/stat.h>
 #include <linux/fs.h>
 #include <linux/dcache.h>
+#include <linux/namei.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/device.h>
index e7e4da3c3a8da9ce5bbf0edbf7d4819350b4fe8d..532d18eadc3ed9f174d57224fc7001a3569ea6d7 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -38,6 +38,7 @@
 #include <linux/binfmts.h>
 #define __NO_VERSION__
 #include <linux/module.h>
+#include <linux/namei.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
index 9046e59def5e855eaa3595fad732002053005166..3a3e2ffdfe484f0aab6fda09858fe52e18bb257c 100644 (file)
@@ -2,6 +2,7 @@
 #include <linux/fs.h>
 #include <linux/module.h>
 #include <linux/smp_lock.h>
+#include <linux/namei.h>
 
 struct export_operations export_op_default;
 
index 8ed094ea90b020ce7bee45228b10fcf90e26010b..5b6e0cf59ec8c918f0fd83f40e0875cb1e39554c 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/fs.h>
+#include <linux/namei.h>
 #include <linux/quotaops.h>
 #include <linux/pagemap.h>
 #include <linux/dnotify.h>
index 1225bac1bafa4916c870a01caaa376c81fe9e520..64515aa0025e85e638decd342154bdaa2d03bce3 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/module.h>
 #include <linux/seq_file.h>
 #include <linux/namespace.h>
+#include <linux/namei.h>
 
 #include <asm/uaccess.h>
 
index 31d58c25914f0a9818e071fafdf5de4836a61df5..40c622741d696cdc4dd4544a595147b1bbf3252e 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/nfs_mount.h>
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
+#include <linux/namei.h>
 
 #define NFS_PARANOIA 1
 /* #define NFS_DEBUG_VERBOSE 1 */
index 99afff5ad4ce25c8a71f2af23a29fd1e4067d42e..42a0d1125f494fbe4dea03e079ada49489679c40 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/syscall.h>
 #include <linux/linkage.h>
+#include <linux/namei.h>
 #include <asm/uaccess.h>
 
 /*
index 936781bb107bbb3875fdb19839371f16735d1c78..1ccea370c9aa0114ab4f2f3d0ed9401d1bd4001d 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/in.h>
 #include <linux/seq_file.h>
 #include <linux/rwsem.h>
+#include <linux/namei.h>
 
 #include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
index 20b86a0e79df7f4b7a5140ddf21ff83df408bb5d..b5994d6b36cf8af50f842e5055de5b443ed4fe8f 100644 (file)
@@ -9,6 +9,8 @@
 #include <linux/types.h>
 #include <linux/time.h>
 #include <linux/nfs3.h>
+#include <linux/dcache.h>
+#include <linux/namei.h>
 
 #include <linux/sunrpc/xdr.h>
 #include <linux/sunrpc/svc.h>
index 5527f0d6b5d46088edae051600cc0a49f14cbfd8..139a76099c7de2c6da66a3d907262abcc2515ad0 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/fcntl.h>
 #include <linux/net.h>
 #include <linux/in.h>
+#include <linux/namei.h>
 #include <linux/version.h>
 #include <linux/unistd.h>
 #include <linux/slab.h>
index b9d0bbfb333af2bf9737cbd14827c1fc60fd1a88..02419edd0250b07658efcf3c44bb19c4372a9439 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/in.h>
 #define __NO_VERSION__
 #include <linux/module.h>
+#include <linux/namei.h>
 
 #include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
index 2ef917feadb73bdd4a140c9f035d441fece41f7c..55f8b0083f0d9e84e8180d4fc3df928a6cc001a5 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -15,6 +15,7 @@
 #include <linux/slab.h>
 #include <linux/tty.h>
 #include <linux/iobuf.h>
+#include <linux/namei.h>
 #include <linux/backing-dev.h>
 
 #include <asm/uaccess.h>
index 4e839bd9eade26b0e5ac252fcd180da262dbe188..c8a80b066a72948ee5524fd7ed9263959754993d 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/file.h>
 #include <linux/string.h>
 #include <linux/seq_file.h>
+#include <linux/namei.h>
 #include <linux/namespace.h>
 #include <linux/mm.h>
 #include <linux/smp_lock.h>
index e877afd9a9e2fb8cbb41476dafc685cedf351f3c..422e4cf7ce1279dbd02072a15a5101cc472d87b3 100644 (file)
@@ -11,6 +11,7 @@
 #include <asm/uaccess.h>
 #include <linux/kernel.h>
 #include <linux/smp_lock.h>
+#include <linux/namei.h>
 #ifdef CONFIG_QIFACE_COMPAT
 #include <linux/quotacompat.h>
 #endif
index a09b7f6abd7363b7d9f6f7aaaa8bb4e97bbb5991..3f963e9d9c9371c47ec764c82e061c5d5322ff0b 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -11,6 +11,7 @@
 #include <linux/smp_lock.h>
 #include <linux/highuid.h>
 #include <linux/fs.h>
+#include <linux/namei.h>
 
 #include <asm/uaccess.h>
 
index 13f1b7a7e34d59c79ebdec997e7be6ad876637f9..1d45d67fc6113a76c0958b374778a92c74f06a5d 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/acct.h>
 #include <linux/blkdev.h>
 #include <linux/quotaops.h>
+#include <linux/namei.h>
 #include <asm/uaccess.h>
 
 void get_filesystem(struct file_system_type *fs);
index 20a7f5b049f98ec4b75a48f33ce7bb796be6456a..387d7dc74fe5d0685dc057db0ee1ff54d88cdc04 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/smp_lock.h>
 #include <linux/file.h>
 #include <linux/xattr.h>
+#include <linux/namei.h>
 #include <asm/uaccess.h>
 
 /*
index 0f2ae2f148e6076743575df49f98d98b1b47616b..95cd02771592c8d184ae1e47a2a104358a9ee176 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/atomic.h>
 
 struct poll_table_struct;
+struct nameidata;
 
 
 /*
@@ -605,16 +606,6 @@ extern void kill_fasync(struct fasync_struct **, int, int);
 /* only for net: no internal synchronization */
 extern void __kill_fasync(struct fasync_struct *, int, int);
 
-struct nameidata {
-       struct dentry *dentry;
-       struct vfsmount *mnt;
-       struct qstr last;
-       unsigned int flags;
-       int last_type;
-       struct dentry *old_dentry;
-       struct vfsmount *old_mnt;
-};
-
 /*
  *     Umount options
  */
@@ -707,9 +698,6 @@ extern int vfs_rmdir(struct inode *, struct dentry *);
 extern int vfs_unlink(struct inode *, struct dentry *);
 extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
 
-extern struct dentry *lock_rename(struct dentry *, struct dentry *);
-extern void unlock_rename(struct dentry *, struct dentry *);
-
 /*
  * File types
  */
@@ -1166,25 +1154,6 @@ extern ino_t find_inode_number(struct dentry *, struct qstr *);
 
 #include <linux/err.h>
 
-/*
- * The bitmask for a lookup event:
- *  - follow links at the end
- *  - require a directory
- *  - ending slashes ok even for nonexistent files
- *  - internal "there are more path compnents" flag
- *  - locked when lookup done with dcache_lock held
- */
-#define LOOKUP_FOLLOW          (1)
-#define LOOKUP_DIRECTORY       (2)
-#define LOOKUP_CONTINUE                (4)
-#define LOOKUP_PARENT          (16)
-#define LOOKUP_NOALT           (32)
-
-/*
- * Type of the last component on LOOKUP_PARENT
- */
-enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
-
 /*
  * "descriptor" for what we're up to with a read for sendfile().
  * This allows us to use the same read code yet
@@ -1206,19 +1175,6 @@ typedef int (*read_actor_t)(read_descriptor_t *, struct page *, unsigned long, u
 /* needed for stackable file system support */
 extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
 
-extern int FASTCALL(__user_walk(const char *, unsigned, struct nameidata *));
-extern int FASTCALL(path_init(const char *, unsigned, struct nameidata *));
-extern int FASTCALL(path_walk(const char *, struct nameidata *));
-extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
-extern int FASTCALL(link_path_walk(const char *, struct nameidata *));
-extern void path_release(struct nameidata *);
-extern int follow_down(struct vfsmount **, struct dentry **);
-extern int follow_up(struct vfsmount **, struct dentry **);
-extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
-extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
-#define user_path_walk(name,nd)         __user_walk(name, LOOKUP_FOLLOW, nd)
-#define user_path_walk_link(name,nd) __user_walk(name, 0, nd)
-
 extern void inode_init_once(struct inode *);
 extern void iput(struct inode *);
 extern void force_delete(struct inode *);
diff --git a/include/linux/namei.h b/include/linux/namei.h
new file mode 100644 (file)
index 0000000..2c789cf
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef _LINUX_NAMEI_H
+#define _LINUX_NAMEI_H
+
+struct vfsmount;
+
+struct nameidata {
+       struct dentry   *dentry;
+       struct vfsmount *mnt;
+       struct qstr     last;
+       unsigned int    flags;
+       int             last_type;
+       struct dentry   *old_dentry;
+       struct vfsmount *old_mnt;
+};
+
+/*
+ * Type of the last component on LOOKUP_PARENT
+ */
+enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
+
+/*
+ * The bitmask for a lookup event:
+ *  - follow links at the end
+ *  - require a directory
+ *  - ending slashes ok even for nonexistent files
+ *  - internal "there are more path compnents" flag
+ *  - locked when lookup done with dcache_lock held
+ */
+#define LOOKUP_FOLLOW           1
+#define LOOKUP_DIRECTORY        2
+#define LOOKUP_CONTINUE                 4
+#define LOOKUP_PARENT          16
+#define LOOKUP_NOALT           32
+
+
+extern int FASTCALL(__user_walk(const char *, unsigned, struct nameidata *));
+#define user_path_walk(name,nd) \
+       __user_walk(name, LOOKUP_FOLLOW, nd)
+#define user_path_walk_link(name,nd) \
+       __user_walk(name, 0, nd)
+extern int FASTCALL(path_init(const char *, unsigned, struct nameidata *));
+extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
+extern int FASTCALL(path_walk(const char *, struct nameidata *));
+extern int FASTCALL(link_path_walk(const char *, struct nameidata *));
+extern void path_release(struct nameidata *);
+
+extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
+extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
+
+extern int follow_down(struct vfsmount **, struct dentry **);
+extern int follow_up(struct vfsmount **, struct dentry **);
+
+extern struct dentry *lock_rename(struct dentry *, struct dentry *);
+extern void unlock_rename(struct dentry *, struct dentry *);
+
+#endif /* _LINUX_NAMEI_H */
index 9b120182258295324ba924300e01776310a669d8..9c38804e4694c61fdb06865a30ea8396bcbe6a4f 100644 (file)
@@ -47,6 +47,7 @@
 #include <linux/completion.h>
 #include <linux/seq_file.h>
 #include <linux/binfmts.h>
+#include <linux/namei.h>
 #include <asm/checksum.h>
 
 #if defined(CONFIG_PROC_FS)
index 504c34fbbaf0b9d106f038e52c810f27d8240d1f..a1fe966321e76824bcfbfe8d85481f7bf4f5c501 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/swapctl.h>
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
+#include <linux/namei.h>
 #include <linux/shm.h>
 #include <linux/blkdev.h>
 #include <linux/compiler.h>
index 2891751d9b5ff2e70c3e615317d92b8d2f3f0253..bd6fb1b8f9f25d60d76b06d5f7ba782630cafb4a 100644 (file)
@@ -88,6 +88,7 @@
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/stat.h>
+#include <linux/namei.h>
 #include <linux/socket.h>
 #include <linux/un.h>
 #include <linux/fcntl.h>