take cgroup_open() and cpuset_open() to fs/proc/base.c
[linux-2.6-microblaze.git] / include / linux / fs.h
index 4e686a0..b1f28b0 100644 (file)
@@ -769,6 +769,7 @@ struct file {
        } f_u;
        struct path             f_path;
 #define f_dentry       f_path.dentry
+       struct inode            *f_inode;       /* cached value */
        const struct file_operations    *f_op;
 
        /*
@@ -1824,6 +1825,8 @@ struct file_system_type {
        struct lock_class_key i_mutex_dir_key;
 };
 
+#define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-" NAME)
+
 extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
        void *data, int (*fill_super)(struct super_block *, void *, int));
 extern struct dentry *mount_bdev(struct file_system_type *fs_type,
@@ -2077,7 +2080,6 @@ extern int sync_filesystem(struct super_block *);
 extern const struct file_operations def_blk_fops;
 extern const struct file_operations def_chr_fops;
 extern const struct file_operations bad_sock_fops;
-extern const struct file_operations def_fifo_fops;
 #ifdef CONFIG_BLOCK
 extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
 extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long);
@@ -2149,10 +2151,6 @@ extern void init_special_inode(struct inode *, umode_t, dev_t);
 extern void make_bad_inode(struct inode *);
 extern int is_bad_inode(struct inode *);
 
-extern const struct file_operations read_pipefifo_fops;
-extern const struct file_operations write_pipefifo_fops;
-extern const struct file_operations rdwr_pipefifo_fops;
-
 #ifdef CONFIG_BLOCK
 /*
  * return READ, READA, or WRITE
@@ -2217,7 +2215,21 @@ static inline bool execute_ok(struct inode *inode)
 
 static inline struct inode *file_inode(struct file *f)
 {
-       return f->f_path.dentry->d_inode;
+       return f->f_inode;
+}
+
+static inline void file_start_write(struct file *file)
+{
+       if (!S_ISREG(file_inode(file)->i_mode))
+               return;
+       __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true);
+}
+
+static inline void file_end_write(struct file *file)
+{
+       if (!S_ISREG(file_inode(file)->i_mode))
+               return;
+       __sb_end_write(file_inode(file)->i_sb, SB_FREEZE_WRITE);
 }
 
 /*