fs: icache RCU free inodes
[firefly-linux-kernel-4.4.55.git] / include / linux / fs.h
index c9e06cc70dad585c6c185db2d1503d3fad4a5a48..1ff4d0a33b25a8942cd0d6417074b608b5b33400 100644 (file)
@@ -602,6 +602,7 @@ struct address_space_operations {
        sector_t (*bmap)(struct address_space *, sector_t);
        void (*invalidatepage) (struct page *, unsigned long);
        int (*releasepage) (struct page *, gfp_t);
+       void (*freepage)(struct page *);
        ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
                        loff_t offset, unsigned long nr_segs);
        int (*get_xip_mem)(struct address_space *, pgoff_t, int,
@@ -736,7 +737,10 @@ struct inode {
        struct list_head        i_wb_list;      /* backing dev IO list */
        struct list_head        i_lru;          /* inode LRU list */
        struct list_head        i_sb_list;
-       struct list_head        i_dentry;
+       union {
+               struct list_head        i_dentry;
+               struct rcu_head         i_rcu;
+       };
        unsigned long           i_ino;
        atomic_t                i_count;
        unsigned int            i_nlink;
@@ -1377,7 +1381,7 @@ struct super_block {
 #else
        struct list_head        s_files;
 #endif
-       /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */
+       /* s_dentry_lru, s_nr_dentry_unused protected by dcache.c lru locks */
        struct list_head        s_dentry_lru;   /* unused dentry lru */
        int                     s_nr_dentry_unused;     /* # of dentry on lru */
 
@@ -2445,6 +2449,10 @@ static inline ino_t parent_ino(struct dentry *dentry)
 {
        ino_t res;
 
+       /*
+        * Don't strictly need d_lock here? If the parent ino could change
+        * then surely we'd have a deeper race in the caller?
+        */
        spin_lock(&dentry->d_lock);
        res = dentry->d_parent->d_inode->i_ino;
        spin_unlock(&dentry->d_lock);