]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/fs.h
locks: rename lock-manager ops
[mv-sheeva.git] / include / linux / fs.h
index 3f9d3251790d081529e51870a073682260b2212b..cf719beb20167a9a0ab36e83be6ad8bfd34141cd 100644 (file)
@@ -208,6 +208,7 @@ struct inodes_stat_t {
 #define MS_KERNMOUNT   (1<<22) /* this is a kern_mount call */
 #define MS_I_VERSION   (1<<23) /* Update inode I_version field */
 #define MS_STRICTATIME (1<<24) /* Always perform atime updates */
+#define MS_NOSEC       (1<<28)
 #define MS_BORN                (1<<29)
 #define MS_ACTIVE      (1<<30)
 #define MS_NOUSER      (1<<31)
@@ -237,6 +238,7 @@ struct inodes_stat_t {
 #define S_PRIVATE      512     /* Inode is fs-internal */
 #define S_IMA          1024    /* Inode has an associated IMA struct */
 #define S_AUTOMOUNT    2048    /* Automount/referral quasi-directory */
+#define S_NOSEC                4096    /* no suid or xattr security attributes */
 
 /*
  * Note that nosuid etc flags are inode-specific: setting some file-system
@@ -273,6 +275,7 @@ struct inodes_stat_t {
 #define IS_PRIVATE(inode)      ((inode)->i_flags & S_PRIVATE)
 #define IS_IMA(inode)          ((inode)->i_flags & S_IMA)
 #define IS_AUTOMOUNT(inode)    ((inode)->i_flags & S_AUTOMOUNT)
+#define IS_NOSEC(inode)                ((inode)->i_flags & S_NOSEC)
 
 /* the read-only stuff doesn't really belong here, but any other place is
    probably as bad and I don't want to create yet another include file. */
@@ -636,6 +639,7 @@ struct address_space {
        struct prio_tree_root   i_mmap;         /* tree of private and shared mappings */
        struct list_head        i_mmap_nonlinear;/*list VM_NONLINEAR mappings */
        struct mutex            i_mmap_mutex;   /* protect tree, count, list */
+       /* Protected by tree_lock together with the radix tree */
        unsigned long           nrpages;        /* number of total pages */
        pgoff_t                 writeback_index;/* writeback starts here */
        const struct address_space_operations *a_ops;   /* methods */
@@ -741,9 +745,13 @@ struct inode {
 
        spinlock_t              i_lock; /* i_blocks, i_bytes, maybe i_size */
        unsigned int            i_flags;
+       unsigned long           i_state;
+#ifdef CONFIG_SECURITY
+       void                    *i_security;
+#endif
        struct mutex            i_mutex;
 
-       unsigned long           i_state;
+
        unsigned long           dirtied_when;   /* jiffies of first dirtying */
 
        struct hlist_node       i_hash;
@@ -795,9 +803,6 @@ struct inode {
        atomic_t                i_readcount; /* struct files open RO */
 #endif
        atomic_t                i_writecount;
-#ifdef CONFIG_SECURITY
-       void                    *i_security;
-#endif
 #ifdef CONFIG_FS_POSIX_ACL
        struct posix_acl        *i_acl;
        struct posix_acl        *i_default_acl;
@@ -1064,12 +1069,12 @@ struct file_lock_operations {
 };
 
 struct lock_manager_operations {
-       int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
-       void (*fl_notify)(struct file_lock *);  /* unblock callback */
-       int (*fl_grant)(struct file_lock *, struct file_lock *, int);
-       void (*fl_release_private)(struct file_lock *);
-       void (*fl_break)(struct file_lock *);
-       int (*fl_change)(struct file_lock **, int);
+       int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
+       void (*lm_notify)(struct file_lock *);  /* unblock callback */
+       int (*lm_grant)(struct file_lock *, struct file_lock *, int);
+       void (*lm_release_private)(struct file_lock *);
+       void (*lm_break)(struct file_lock *);
+       int (*lm_change)(struct file_lock **, int);
 };
 
 struct lock_manager {
@@ -1428,6 +1433,11 @@ struct super_block {
         */
        char __rcu *s_options;
        const struct dentry_operations *s_d_op; /* default d_op for dentries */
+
+       /*
+        * Saved pool identifier for cleancache (-1 means none)
+        */
+       int cleancache_poolid;
 };
 
 extern struct timespec current_fs_time(struct super_block *sb);
@@ -1613,7 +1623,7 @@ struct super_operations {
        struct inode *(*alloc_inode)(struct super_block *sb);
        void (*destroy_inode)(struct inode *);
 
-       void (*dirty_inode) (struct inode *);
+       void (*dirty_inode) (struct inode *, int flags);
        int (*write_inode) (struct inode *, struct writeback_control *wbc);
        int (*drop_inode) (struct inode *);
        void (*evict_inode) (struct inode *);
@@ -2577,5 +2587,16 @@ int __init get_filesystem_list(char *buf);
 #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \
                                            (flag & __FMODE_NONOTIFY)))
 
+static inline int is_sxid(mode_t mode)
+{
+       return (mode & S_ISUID) || ((mode & S_ISGID) && (mode & S_IXGRP));
+}
+
+static inline void inode_has_no_xattr(struct inode *inode)
+{
+       if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & MS_NOSEC))
+               inode->i_flags |= S_NOSEC;
+}
+
 #endif /* __KERNEL__ */
 #endif /* _LINUX_FS_H */