Merge git://git.linux-nfs.org/pub/linux/nfs-2.6
[pandora-kernel.git] / include / linux / fs.h
index 8ef4dd7..5adf32b 100644 (file)
@@ -65,6 +65,11 @@ extern int dir_notify_enable;
 #define FMODE_PREAD    8
 #define FMODE_PWRITE   FMODE_PREAD     /* These go hand in hand */
 
+/* File is being opened for execution. Primary users of this flag are
+   distributed filesystems that can use it to achieve correct ETXTBUSY
+   behavior for cross-node execution/opening_for_writing of files */
+#define FMODE_EXEC     16
+
 #define RW_MASK                1
 #define RWA_MASK       2
 #define READ 0
@@ -103,7 +108,9 @@ extern int dir_notify_enable;
 #define MS_BIND                4096
 #define MS_MOVE                8192
 #define MS_REC         16384
-#define MS_VERBOSE     32768
+#define MS_VERBOSE     32768   /* War is peace. Verbosity is silence.
+                                  MS_VERBOSE is deprecated. */
+#define MS_SILENT      32768
 #define MS_POSIXACL    (1<<16) /* VFS does not apply the umask */
 #define MS_UNBINDABLE  (1<<17) /* change to unbindable */
 #define MS_PRIVATE     (1<<18) /* change to private */
@@ -197,6 +204,10 @@ extern int dir_notify_enable;
 #define BLKBSZGET  _IOR(0x12,112,size_t)
 #define BLKBSZSET  _IOW(0x12,113,size_t)
 #define BLKGETSIZE64 _IOR(0x12,114,size_t)     /* return device size in bytes (u64 *arg) */
+#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
+#define BLKTRACESTART _IO(0x12,116)
+#define BLKTRACESTOP _IO(0x12,117)
+#define BLKTRACETEARDOWN _IO(0x12,118)
 
 #define BMAP_IOCTL 1           /* obsolete - kept for compatibility */
 #define FIBMAP    _IO(0x00,1)  /* bmap access */
@@ -344,7 +355,7 @@ struct address_space_operations {
        /* Write back some dirty pages from this mapping. */
        int (*writepages)(struct address_space *, struct writeback_control *);
 
-       /* Set a page dirty */
+       /* Set a page dirty.  Return true if this dirtied it */
        int (*set_page_dirty)(struct page *page);
 
        int (*readpages)(struct file *filp, struct address_space *mapping,
@@ -397,8 +408,8 @@ struct block_device {
        dev_t                   bd_dev;  /* not a kdev_t - it's a search key */
        struct inode *          bd_inode;       /* will die */
        int                     bd_openers;
-       struct semaphore        bd_sem; /* open/close mutex */
-       struct semaphore        bd_mount_sem;   /* mount mutex */
+       struct mutex            bd_mutex;       /* open/close mutex */
+       struct mutex            bd_mount_mutex; /* mount mutex */
        struct list_head        bd_inodes;
        void *                  bd_holder;
        int                     bd_holders;
@@ -509,7 +520,7 @@ struct inode {
 
 #ifdef CONFIG_INOTIFY
        struct list_head        inotify_watches; /* watches on this inode */
-       struct semaphore        inotify_sem;    /* protects the watches list */
+       struct mutex            inotify_mutex;  /* protects the watches list */
 #endif
 
        unsigned long           i_state;
@@ -667,7 +678,6 @@ extern spinlock_t files_lock;
 #define FL_POSIX       1
 #define FL_FLOCK       2
 #define FL_ACCESS      8       /* not trying to lock, just looking */
-#define FL_LOCKD       16      /* lock held by rpc.lockd */
 #define FL_LEASE       32      /* lease held on this file */
 #define FL_SLEEP       128     /* A blocking lock */
 
@@ -731,8 +741,6 @@ struct file_lock {
 #define OFFT_OFFSET_MAX        INT_LIMIT(off_t)
 #endif
 
-extern struct list_head file_lock_list;
-
 #include <linux/fcntl.h>
 
 extern int fcntl_getlk(struct file *, struct flock __user *);
@@ -846,7 +854,7 @@ struct super_block {
         * The next field is for VFS *only*. No filesystems have any business
         * even looking at it. You had been warned.
         */
-       struct semaphore s_vfs_rename_sem;      /* Kludge */
+       struct mutex s_vfs_rename_mutex;        /* Kludge */
 
        /* Granuality of c/m/atime in ns.
           Cannot be worse than a second */
@@ -1115,6 +1123,18 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
        __mark_inode_dirty(inode, I_DIRTY_SYNC);
 }
 
+static inline void inode_inc_link_count(struct inode *inode)
+{
+       inode->i_nlink++;
+       mark_inode_dirty(inode);
+}
+
+static inline void inode_dec_link_count(struct inode *inode)
+{
+       inode->i_nlink--;
+       mark_inode_dirty(inode);
+}
+
 extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry);
 static inline void file_accessed(struct file *file)
 {
@@ -1455,6 +1475,12 @@ extern int filemap_fdatawait(struct address_space *);
 extern int filemap_write_and_wait(struct address_space *mapping);
 extern int filemap_write_and_wait_range(struct address_space *mapping,
                                        loff_t lstart, loff_t lend);
+extern int wait_on_page_writeback_range(struct address_space *mapping,
+                               pgoff_t start, pgoff_t end);
+extern int __filemap_fdatawrite_range(struct address_space *mapping,
+                               loff_t start, loff_t end, int sync_mode);
+
+extern long do_fsync(struct file *file, int datasync);
 extern void sync_supers(void);
 extern void sync_filesystems(int wait);
 extern void emergency_sync(void);
@@ -1534,7 +1560,6 @@ extern void destroy_inode(struct inode *);
 extern struct inode *new_inode(struct super_block *);
 extern int remove_suid(struct dentry *);
 extern void remove_dquot_ref(struct super_block *, int, struct list_head *);
-extern struct semaphore iprune_sem;
 
 extern void __insert_inode_hash(struct inode *, unsigned long hashval);
 extern void remove_inode_hash(struct inode *);