summaryrefslogtreecommitdiffstats
path: root/fs/ceph/ioctl.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-06-06 16:01:39 +0800
committerIlya Dryomov <idryomov@gmail.com>2016-07-28 02:55:39 +0200
commit774a6a118c70f8c11fcfe636032b5016ad71a746 (patch)
tree8c1380f9b9fe2b6db6360b68f4aad373be01072b /fs/ceph/ioctl.c
parenta22bd5ffae2d22c054c832fe0d60976ed9e4a49d (diff)
downloadlinux-774a6a118c70f8c11fcfe636032b5016ad71a746.tar.gz
linux-774a6a118c70f8c11fcfe636032b5016ad71a746.tar.bz2
linux-774a6a118c70f8c11fcfe636032b5016ad71a746.zip
ceph: reduce i_nr_by_mode array size
Track usage count for individual fmode bit. This can reduce the array size by half. Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/ioctl.c')
-rw-r--r--fs/ceph/ioctl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
index 6a30101b55ef..7d752d53353a 100644
--- a/fs/ceph/ioctl.c
+++ b/fs/ceph/ioctl.c
@@ -250,9 +250,8 @@ static long ceph_ioctl_lazyio(struct file *file)
if ((fi->fmode & CEPH_FILE_MODE_LAZY) == 0) {
spin_lock(&ci->i_ceph_lock);
- ci->i_nr_by_mode[fi->fmode]--;
fi->fmode |= CEPH_FILE_MODE_LAZY;
- ci->i_nr_by_mode[fi->fmode]++;
+ ci->i_nr_by_mode[ffs(CEPH_FILE_MODE_LAZY)]++;
spin_unlock(&ci->i_ceph_lock);
dout("ioctl_layzio: file %p marked lazy\n", file);