diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-26 21:33:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-26 21:33:33 -0500 |
commit | 2844a48706e54ddda4a04269dba4250b42f449de (patch) | |
tree | deaf92b185ed33b86c5f6de225f0d16e39a94725 /fs | |
parent | 5687100aad982b7964f998886c282034b472653d (diff) | |
parent | aa10990e028cac3d5e255711fb9fb47e00700e35 (diff) |
Merge branch 'akpm' (Fixes from Andrew)
Merge misc fixes from Andrew Morton:
"8 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (8 patches)
futex: avoid wake_futex() for a PI futex_q
watchdog: using u64 in get_sample_period()
writeback: put unused inodes to LRU after writeback completion
mm: vmscan: check for fatal signals iff the process was throttled
Revert "mm: remove __GFP_NO_KSWAPD"
proc: check vma->vm_file before dereferencing
UAPI: strip the _UAPI prefix from header guards during header installation
include/linux/bug.h: fix sparse warning related to BUILD_BUG_ON_INVALID
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fs-writeback.c | 2 | ||||
-rw-r--r-- | fs/inode.c | 16 | ||||
-rw-r--r-- | fs/internal.h | 1 | ||||
-rw-r--r-- | fs/proc/base.c | 5 |
4 files changed, 20 insertions, 4 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 51ea267d444c..3e3422f7f0a4 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -228,6 +228,8 @@ static void requeue_io(struct inode *inode, struct bdi_writeback *wb) | |||
228 | static void inode_sync_complete(struct inode *inode) | 228 | static void inode_sync_complete(struct inode *inode) |
229 | { | 229 | { |
230 | inode->i_state &= ~I_SYNC; | 230 | inode->i_state &= ~I_SYNC; |
231 | /* If inode is clean an unused, put it into LRU now... */ | ||
232 | inode_add_lru(inode); | ||
231 | /* Waiters must see I_SYNC cleared before being woken up */ | 233 | /* Waiters must see I_SYNC cleared before being woken up */ |
232 | smp_mb(); | 234 | smp_mb(); |
233 | wake_up_bit(&inode->i_state, __I_SYNC); | 235 | wake_up_bit(&inode->i_state, __I_SYNC); |
diff --git a/fs/inode.c b/fs/inode.c index b03c71957246..64999f144153 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -408,6 +408,19 @@ static void inode_lru_list_add(struct inode *inode) | |||
408 | spin_unlock(&inode->i_sb->s_inode_lru_lock); | 408 | spin_unlock(&inode->i_sb->s_inode_lru_lock); |
409 | } | 409 | } |
410 | 410 | ||
411 | /* | ||
412 | * Add inode to LRU if needed (inode is unused and clean). | ||
413 | * | ||
414 | * Needs inode->i_lock held. | ||
415 | */ | ||
416 | void inode_add_lru(struct inode *inode) | ||
417 | { | ||
418 | if (!(inode->i_state & (I_DIRTY | I_SYNC | I_FREEING | I_WILL_FREE)) && | ||
419 | !atomic_read(&inode->i_count) && inode->i_sb->s_flags & MS_ACTIVE) | ||
420 | inode_lru_list_add(inode); | ||
421 | } | ||
422 | |||
423 | |||
411 | static void inode_lru_list_del(struct inode *inode) | 424 | static void inode_lru_list_del(struct inode *inode) |
412 | { | 425 | { |
413 | spin_lock(&inode->i_sb->s_inode_lru_lock); | 426 | spin_lock(&inode->i_sb->s_inode_lru_lock); |
@@ -1390,8 +1403,7 @@ static void iput_final(struct inode *inode) | |||
1390 | 1403 | ||
1391 | if (!drop && (sb->s_flags & MS_ACTIVE)) { | 1404 | if (!drop && (sb->s_flags & MS_ACTIVE)) { |
1392 | inode->i_state |= I_REFERENCED; | 1405 | inode->i_state |= I_REFERENCED; |
1393 | if (!(inode->i_state & (I_DIRTY|I_SYNC))) | 1406 | inode_add_lru(inode); |
1394 | inode_lru_list_add(inode); | ||
1395 | spin_unlock(&inode->i_lock); | 1407 | spin_unlock(&inode->i_lock); |
1396 | return; | 1408 | return; |
1397 | } | 1409 | } |
diff --git a/fs/internal.h b/fs/internal.h index 916b7cbf3e3e..2f6af7f645eb 100644 --- a/fs/internal.h +++ b/fs/internal.h | |||
@@ -110,6 +110,7 @@ extern int open_check_o_direct(struct file *f); | |||
110 | * inode.c | 110 | * inode.c |
111 | */ | 111 | */ |
112 | extern spinlock_t inode_sb_list_lock; | 112 | extern spinlock_t inode_sb_list_lock; |
113 | extern void inode_add_lru(struct inode *inode); | ||
113 | 114 | ||
114 | /* | 115 | /* |
115 | * fs-writeback.c | 116 | * fs-writeback.c |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 3c231adf8450..9e28356a959a 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1877,8 +1877,9 @@ static struct dentry *proc_map_files_lookup(struct inode *dir, | |||
1877 | if (!vma) | 1877 | if (!vma) |
1878 | goto out_no_vma; | 1878 | goto out_no_vma; |
1879 | 1879 | ||
1880 | result = proc_map_files_instantiate(dir, dentry, task, | 1880 | if (vma->vm_file) |
1881 | (void *)(unsigned long)vma->vm_file->f_mode); | 1881 | result = proc_map_files_instantiate(dir, dentry, task, |
1882 | (void *)(unsigned long)vma->vm_file->f_mode); | ||
1882 | 1883 | ||
1883 | out_no_vma: | 1884 | out_no_vma: |
1884 | up_read(&mm->mmap_sem); | 1885 | up_read(&mm->mmap_sem); |