diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-10-26 04:08:43 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-11-02 17:36:48 -0500 |
commit | 5e804ac4824302efc3038e086cb21f2e93ab8900 (patch) | |
tree | 6e67ab2be2c56191d96afa4f012bf688ea001828 /fs/ceph/caps.c | |
parent | 4afb04c0c88e21f37e5ef4776e432907d7b12838 (diff) |
ceph: don't invalidate page cache when inode is no longer used
ceph_check_caps() invalidate page cache when inode is not used
by any open file. This behaviour is not friendly for workload
that repeatly read files.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r-- | fs/ceph/caps.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 27b566874bc1..349315332040 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -1655,9 +1655,8 @@ retry_locked: | |||
1655 | !S_ISDIR(inode->i_mode) && /* ignore readdir cache */ | 1655 | !S_ISDIR(inode->i_mode) && /* ignore readdir cache */ |
1656 | ci->i_wrbuffer_ref == 0 && /* no dirty pages... */ | 1656 | ci->i_wrbuffer_ref == 0 && /* no dirty pages... */ |
1657 | inode->i_data.nrpages && /* have cached pages */ | 1657 | inode->i_data.nrpages && /* have cached pages */ |
1658 | (file_wanted == 0 || /* no open files */ | 1658 | (revoking & (CEPH_CAP_FILE_CACHE| |
1659 | (revoking & (CEPH_CAP_FILE_CACHE| | 1659 | CEPH_CAP_FILE_LAZYIO)) && /* or revoking cache */ |
1660 | CEPH_CAP_FILE_LAZYIO))) && /* or revoking cache */ | ||
1661 | !tried_invalidate) { | 1660 | !tried_invalidate) { |
1662 | dout("check_caps trying to invalidate on %p\n", inode); | 1661 | dout("check_caps trying to invalidate on %p\n", inode); |
1663 | if (try_nonblocking_invalidate(inode) < 0) { | 1662 | if (try_nonblocking_invalidate(inode) < 0) { |