diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fs.h | 46 | ||||
| -rw-r--r-- | include/linux/namei.h | 56 |
2 files changed, 57 insertions, 45 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 0f2ae2f148e6..95cd02771592 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -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 */ @@ -1167,25 +1155,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 * have multiple different users of the data that @@ -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 index 000000000000..2c789cf0d4fc --- /dev/null +++ b/include/linux/namei.h @@ -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 */ |
