diff options
author | John Stultz <johnstul@us.ibm.com> | 2010-04-16 18:30:04 -0700 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-04-27 17:33:04 +0200 |
commit | a0ded0f1eb853e96f3386b4498b42ce6726394ad (patch) | |
tree | 0e3a4339036aacb0d1c32d9459292d46a4dc66db | |
parent | d13cdfecb0d1132e630867250d3e2f21ec6d29f4 (diff) | |
download | lwn-a0ded0f1eb853e96f3386b4498b42ce6726394ad.tar.gz lwn-a0ded0f1eb853e96f3386b4498b42ce6726394ad.zip |
Fixup some compilation warnings and errors
Amit Arora noticed some compile issues with coda, and an fs.h include
issue, so so this patch fixes those along with btrfs warnings.
Thanks to Amit for the testing!
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | fs/btrfs/inode.c | 16 | ||||
-rw-r--r-- | fs/coda/dir.c | 2 | ||||
-rw-r--r-- | include/linux/fs.h | 1 |
3 files changed, 15 insertions, 4 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 9dcc771ff485..3288f3a2899e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1991,8 +1991,14 @@ void btrfs_add_delayed_iput(struct inode *inode) struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; struct delayed_iput *delayed; - if (atomic_add_unless(&inode->i_count, -1, 1)) + spin_lock(&inode->i_lock); + if (inode->i_count == 1) { + spin_unlock(&inode->i_lock); return; + } + inode->i_count--; + spin_unlock(&inode->i_lock); + delayed = kmalloc(sizeof(*delayed), GFP_NOFS | __GFP_NOFAIL); delayed->inode = inode; @@ -3600,8 +3606,14 @@ again: objectid = entry->vfs_inode.i_ino + 1; inode = igrab(&entry->vfs_inode); if (inode) { + int count; spin_unlock(&root->inode_lock); - if (atomic_read(&inode->i_count) > 1) + + spin_lock(&inode->i_lock); + count = inode->i_count; + spin_unlock(&inode->i_lock); + + if (count > 1) d_prune_aliases(inode); /* * btrfs_drop_inode will remove it from diff --git a/fs/coda/dir.c b/fs/coda/dir.c index ee3410542b72..4d3bbd8514ac 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c @@ -613,7 +613,7 @@ static int coda_dentry_revalidate(struct dentry *de, struct nameidata *nd) if (cii->c_flags & C_FLUSH) coda_flag_inode_children(inode, C_FLUSH); - if (de->d_count > 1) + if (atomic_read(&de->d_count) > 1) /* pretend it's valid, but don't change the flags */ goto out; diff --git a/include/linux/fs.h b/include/linux/fs.h index 94b8fa3f486e..4981e6ee3ba5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -8,7 +8,6 @@ #include <linux/limits.h> #include <linux/ioctl.h> -#include <asm/atomic.h> /* * It's silly to have NR_OPEN bigger than NR_FILE, but you can change |