summaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h67
1 files changed, 33 insertions, 34 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3f135fa01..4eb593aba 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -20,6 +20,7 @@
#include <linux/stat.h>
#include <linux/cache.h>
#include <linux/stddef.h>
+#include <linux/string.h>
#include <asm/atomic.h>
#include <asm/bitops.h>
@@ -78,7 +79,11 @@ extern int max_super_blocks, nr_super_blocks;
#define FS_NO_PRELIM 4 /* prevent preloading of dentries, even if
* FS_NO_DCACHE is not set.
*/
-
+#define FS_SINGLE 8 /*
+ * Filesystem that can have only one superblock;
+ * kernel-wide vfsmnt is kept in ->kern_mnt.
+ */
+#define FS_NOMOUNT 16 /* Never mount from userland */
/*
* These are the fs-independent mount-flags: up to 16 flags are supported
*/
@@ -173,7 +178,6 @@ extern int max_super_blocks, nr_super_blocks;
#ifdef __KERNEL__
-#include <linux/string.h>
#include <asm/semaphore.h>
#include <asm/byteorder.h>
@@ -251,7 +255,7 @@ void init_buffer(struct buffer_head *, bh_end_io_t *, void *);
extern void set_bh_page(struct buffer_head *bh, struct page *page, unsigned long offset);
-#define touch_buffer(bh) set_bit(PG_referenced, &bh->b_page->flags)
+#define touch_buffer(bh) SetPageReferenced(bh->b_page)
#include <linux/pipe_fs_i.h>
@@ -338,8 +342,8 @@ struct page;
struct address_space;
struct address_space_operations {
- int (*writepage)(struct file *, struct dentry *, struct page *);
- int (*readpage)(struct dentry *, struct page *);
+ int (*writepage)(struct file *, struct page *);
+ int (*readpage)(struct file *, struct page *);
int (*sync_page)(struct page *);
int (*prepare_write)(struct file *, struct page *, unsigned, unsigned);
int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
@@ -625,6 +629,7 @@ struct super_block {
struct list_head s_files;
struct block_device *s_bdev;
+ struct list_head s_mounts; /* vfsmount(s) of this one */
struct quota_mount_options s_dquot; /* Diskquota specific options */
union {
@@ -769,6 +774,7 @@ struct file_system_type {
int fs_flags;
struct super_block *(*read_super) (struct super_block *, void *, int);
struct module *owner;
+ struct vfsmount *kern_mnt; /* For kernel mount, if it's FS_SINGLE fs */
struct file_system_type * next;
};
@@ -785,16 +791,11 @@ struct file_system_type var = { \
extern int register_filesystem(struct file_system_type *);
extern int unregister_filesystem(struct file_system_type *);
+extern struct vfsmount *kern_mount(struct file_system_type *);
+extern void kern_umount(struct vfsmount *);
+extern int may_umount(struct vfsmount *);
-static inline int vfs_statfs(struct super_block *sb, struct statfs *buf)
-{
- if (!sb)
- return -ENODEV;
- if (!sb->s_op || !sb->s_op->statfs)
- return -ENOSYS;
- memset(buf, 0, sizeof(struct statfs));
- return sb->s_op->statfs(sb, buf);
-}
+extern int vfs_statfs(struct super_block *, struct statfs *);
/* Return value for VFS lock functions - tells locks.c to lock conventionally
* REALLY kosha for root NFS and nfs_lock
@@ -821,7 +822,7 @@ static inline int locks_verify_locked(struct inode *inode)
return 0;
}
-extern inline int locks_verify_area(int read_write, struct inode *inode,
+static inline int locks_verify_area(int read_write, struct inode *inode,
struct file *filp, loff_t offset,
size_t count)
{
@@ -830,7 +831,7 @@ extern inline int locks_verify_area(int read_write, struct inode *inode,
return 0;
}
-extern inline int locks_verify_truncate(struct inode *inode,
+static inline int locks_verify_truncate(struct inode *inode,
struct file *filp,
loff_t size)
{
@@ -898,7 +899,6 @@ extern struct file_operations write_pipe_fops;
extern struct file_operations rdwr_pipe_fops;
extern int fs_may_remount_ro(struct super_block *);
-extern int fs_may_mount(kdev_t);
extern int try_to_free_buffers(struct page *);
extern void refile_buffer(struct buffer_head * buf);
@@ -912,7 +912,7 @@ extern void refile_buffer(struct buffer_head * buf);
/*
* This is called by bh->b_end_io() handlers when I/O has completed.
*/
-extern inline void mark_buffer_uptodate(struct buffer_head * bh, int on)
+static inline void mark_buffer_uptodate(struct buffer_head * bh, int on)
{
if (on)
set_bit(BH_Uptodate, &bh->b_state);
@@ -922,12 +922,12 @@ extern inline void mark_buffer_uptodate(struct buffer_head * bh, int on)
#define atomic_set_buffer_clean(bh) test_and_clear_bit(BH_Dirty, &(bh)->b_state)
-extern inline void __mark_buffer_clean(struct buffer_head *bh)
+static inline void __mark_buffer_clean(struct buffer_head *bh)
{
refile_buffer(bh);
}
-extern inline void mark_buffer_clean(struct buffer_head * bh)
+static inline void mark_buffer_clean(struct buffer_head * bh)
{
if (atomic_set_buffer_clean(bh))
__mark_buffer_clean(bh);
@@ -935,12 +935,12 @@ extern inline void mark_buffer_clean(struct buffer_head * bh)
#define atomic_set_buffer_protected(bh) test_and_set_bit(BH_Protected, &(bh)->b_state)
-extern inline void __mark_buffer_protected(struct buffer_head *bh)
+static inline void __mark_buffer_protected(struct buffer_head *bh)
{
refile_buffer(bh);
}
-extern inline void mark_buffer_protected(struct buffer_head * bh)
+static inline void mark_buffer_protected(struct buffer_head * bh)
{
if (!atomic_set_buffer_protected(bh))
__mark_buffer_protected(bh);
@@ -968,7 +968,6 @@ extern int notify_change(struct dentry *, struct iattr *);
extern int permission(struct inode *, int);
extern int get_write_access(struct inode *);
extern void put_write_access(struct inode *);
-extern struct dentry * do_mknod(const char *, int, dev_t);
extern int do_pipe(int *);
extern int open_namei(const char *, int, int, struct nameidata *);
@@ -1031,14 +1030,16 @@ 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 struct dentry * lookup_dentry(const char *, unsigned int);
-extern int walk_init(const char *, unsigned, struct nameidata *);
-extern int walk_name(const char *, struct nameidata *);
+extern int __user_walk(const char *, unsigned, struct nameidata *);
+extern int path_init(const char *, unsigned, struct nameidata *);
+extern int 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(const char *, struct dentry *);
-extern struct dentry * __namei(const char *, unsigned int);
-
-#define namei(pathname) __namei(pathname, LOOKUP_FOLLOW)
-#define lnamei(pathname) __namei(pathname, 0)
+extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
+#define user_path_walk(name,nd) __user_walk(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd)
+#define user_path_walk_link(name,nd) __user_walk(name, LOOKUP_POSITIVE, nd)
extern void iput(struct inode *);
extern struct inode * igrab(struct inode *);
@@ -1064,13 +1065,13 @@ extern struct buffer_head * getblk(kdev_t, int, int);
extern void ll_rw_block(int, int, struct buffer_head * bh[]);
extern int is_read_only(kdev_t);
extern void __brelse(struct buffer_head *);
-extern inline void brelse(struct buffer_head *buf)
+static inline void brelse(struct buffer_head *buf)
{
if (buf)
__brelse(buf);
}
extern void __bforget(struct buffer_head *);
-extern inline void bforget(struct buffer_head *buf)
+static inline void bforget(struct buffer_head *buf)
{
if (buf)
__bforget(buf);
@@ -1083,7 +1084,6 @@ extern void wakeup_bdflush(int wait);
extern int brw_page(int, struct page *, kdev_t, int [], int);
-typedef int (*writepage_t)(struct file *, struct page *, unsigned long, unsigned long, const char *);
typedef int (get_block_t)(struct inode*,long,struct buffer_head*,int);
/* Generic buffer handling for block filesystems.. */
@@ -1119,7 +1119,6 @@ extern int vfs_readdir(struct file *, filldir_t, void *);
extern struct super_block *get_super(kdev_t);
struct super_block *get_empty_super(void);
-void remove_vfsmnt(kdev_t dev);
extern void put_super(kdev_t);
unsigned long generate_cluster(kdev_t, int b[], int);
unsigned long generate_cluster_swab32(kdev_t, int b[], int);