diff options
author | Luis Henriques <lhenriques@suse.com> | 2018-01-12 20:19:28 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2018-04-02 12:17:53 +0300 |
commit | e3161f17d92699ce6ca3b7988131b10ad4035cf9 (patch) | |
tree | 64517e87740efded4fd4a962343ba81bef5d6be9 /fs/ceph/inode.c | |
parent | 0eb6bbe4d9cf02f639d661edf7c02defc3453a69 (diff) | |
download | linux-e3161f17d92699ce6ca3b7988131b10ad4035cf9.tar.xz |
ceph: quota: cache inode pointer in ceph_snap_realm
Keep a pointer to the inode in struct ceph_snap_realm. This allows to
optimize functions that walk the realms hierarchy (e.g. in quotas).
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 50ccae151ea0..8ea11b1a2e23 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -551,6 +551,9 @@ void ceph_destroy_inode(struct inode *inode) dout(" dropping residual ref to snap realm %p\n", realm); spin_lock(&realm->inodes_with_caps_lock); list_del_init(&ci->i_snap_realm_item); + ci->i_snap_realm = NULL; + if (realm->ino == ci->i_vino.ino) + realm->inode = NULL; spin_unlock(&realm->inodes_with_caps_lock); ceph_put_snap_realm(mdsc, realm); } |