aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-09-20 07:55:31 -0400
committerSage Weil <sage@inktank.com>2013-12-13 12:13:16 -0500
commit9f12bd119e408388233e7aeb1152f372a8b5dcad (patch)
tree9cf2b88f6c466ec72a52be088d1db3ab33b60906 /fs
parent56f91aad69444d650237295f68c195b74d888d95 (diff)
ceph: drop unconnected inodes
Positve dentry and corresponding inode are always accompanied in MDS reply. So no need to keep inode in the cache after dropping all its aliases. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/inode.c10
-rw-r--r--fs/ceph/super.c1
-rw-r--r--fs/ceph/super.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 278fd2891288..d37b2dc01d3f 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -436,6 +436,16 @@ void ceph_destroy_inode(struct inode *inode)
436 call_rcu(&inode->i_rcu, ceph_i_callback); 436 call_rcu(&inode->i_rcu, ceph_i_callback);
437} 437}
438 438
439int ceph_drop_inode(struct inode *inode)
440{
441 /*
442 * Positve dentry and corresponding inode are always accompanied
443 * in MDS reply. So no need to keep inode in the cache after
444 * dropping all its aliases.
445 */
446 return 1;
447}
448
439/* 449/*
440 * Helpers to fill in size, ctime, mtime, and atime. We have to be 450 * Helpers to fill in size, ctime, mtime, and atime. We have to be
441 * careful because either the client or MDS may have more up to date 451 * careful because either the client or MDS may have more up to date
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 6a0951e43044..e58bd4a23bfb 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -686,6 +686,7 @@ static const struct super_operations ceph_super_ops = {
686 .alloc_inode = ceph_alloc_inode, 686 .alloc_inode = ceph_alloc_inode,
687 .destroy_inode = ceph_destroy_inode, 687 .destroy_inode = ceph_destroy_inode,
688 .write_inode = ceph_write_inode, 688 .write_inode = ceph_write_inode,
689 .drop_inode = ceph_drop_inode,
689 .sync_fs = ceph_sync_fs, 690 .sync_fs = ceph_sync_fs,
690 .put_super = ceph_put_super, 691 .put_super = ceph_put_super,
691 .show_options = ceph_show_options, 692 .show_options = ceph_show_options,
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index ef4ac38bb614..8de94b564d67 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -691,6 +691,7 @@ extern const struct inode_operations ceph_file_iops;
691 691
692extern struct inode *ceph_alloc_inode(struct super_block *sb); 692extern struct inode *ceph_alloc_inode(struct super_block *sb);
693extern void ceph_destroy_inode(struct inode *inode); 693extern void ceph_destroy_inode(struct inode *inode);
694extern int ceph_drop_inode(struct inode *inode);
694 695
695extern struct inode *ceph_get_inode(struct super_block *sb, 696extern struct inode *ceph_get_inode(struct super_block *sb,
696 struct ceph_vino vino); 697 struct ceph_vino vino);