diff options
author | Luis Henriques <lhenriques@suse.com> | 2018-01-12 12:19:28 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2018-04-02 05:17:53 -0400 |
commit | e3161f17d92699ce6ca3b7988131b10ad4035cf9 (patch) | |
tree | 64517e87740efded4fd4a962343ba81bef5d6be9 /fs/ceph/caps.c | |
parent | 0eb6bbe4d9cf02f639d661edf7c02defc3453a69 (diff) |
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/caps.c')
-rw-r--r-- | fs/ceph/caps.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 25141b6683e9..23dbfae16156 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -703,9 +703,11 @@ void ceph_add_cap(struct inode *inode, | |||
703 | } | 703 | } |
704 | 704 | ||
705 | spin_lock(&realm->inodes_with_caps_lock); | 705 | spin_lock(&realm->inodes_with_caps_lock); |
706 | ci->i_snap_realm = realm; | ||
707 | list_add(&ci->i_snap_realm_item, | 706 | list_add(&ci->i_snap_realm_item, |
708 | &realm->inodes_with_caps); | 707 | &realm->inodes_with_caps); |
708 | ci->i_snap_realm = realm; | ||
709 | if (realm->ino == ci->i_vino.ino) | ||
710 | realm->inode = inode; | ||
709 | spin_unlock(&realm->inodes_with_caps_lock); | 711 | spin_unlock(&realm->inodes_with_caps_lock); |
710 | 712 | ||
711 | if (oldrealm) | 713 | if (oldrealm) |