]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
hfsplus: remove the rsrc_inodes list
authorChristoph Hellwig <hch@tuxera.com>
Fri, 1 Oct 2010 03:44:02 +0000 (05:44 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 1 Oct 2010 03:44:02 +0000 (05:44 +0200)
We never walk the list - the only reason for it is to make the resource fork
inodes appear hashed to the writeback code.  Borrow a trick from JFS to do
that without needing a list head.

Signed-off-by: Christoph Hellwig <hch@tuxera.com>
fs/hfsplus/hfsplus_fs.h
fs/hfsplus/inode.c
fs/hfsplus/super.c

index 5e2418a71887176c9af1fcdbdc897f0ff43edea8..0cd9ba00f96863ed3943f71a8c27b865e9cc80c1 100644 (file)
@@ -145,8 +145,6 @@ struct hfsplus_sb_info {
        int part, session;
 
        unsigned long flags;
-
-       struct hlist_head rsrc_inodes;
 };
 
 #define HFSPLUS_SB_WRITEBACKUP 0x0001
index 309defb4f41fcab0ddf6a888329f639dc0b7c9ef..a05b3afa72301cc0375fe7ab7c8f9311dee839f8 100644 (file)
@@ -204,7 +204,15 @@ static struct dentry *hfsplus_file_lookup(struct inode *dir, struct dentry *dent
        hip->rsrc_inode = dir;
        HFSPLUS_I(dir)->rsrc_inode = inode;
        igrab(dir);
-       hlist_add_head(&inode->i_hash, &HFSPLUS_SB(sb)->rsrc_inodes);
+
+       /*
+        * __mark_inode_dirty expects inodes to be hashed.  Since we don't
+        * want resource fork inodes in the regular inode space, we make them
+        * appear hashed, but do not put on any lists.  hlist_del()
+        * will work fine and require no locking.
+        */
+       inode->i_hash.pprev = &inode->i_hash.next;
+
        mark_inode_dirty(inode);
 out:
        d_add(dentry, inode);
index f310a1fdcd5fb0b69aaf6f10759ced90fedb4cc2..923f385b32caf887abff460e460ceaf22dc864ee 100644 (file)
@@ -318,7 +318,6 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
                return -ENOMEM;
 
        sb->s_fs_info = sbi;
-       INIT_HLIST_HEAD(&sbi->rsrc_inodes);
        mutex_init(&sbi->alloc_mutex);
        hfsplus_fill_defaults(sbi);
        if (!hfsplus_parse_options(data, sbi)) {