summaryrefslogtreecommitdiffstats
path: root/fs/ceph/super.h
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-06-06 10:01:39 +0200
committerIlya Dryomov <idryomov@gmail.com>2016-07-28 02:55:39 +0200
commit774a6a118c70f8c11fcfe636032b5016ad71a746 (patch)
tree8c1380f9b9fe2b6db6360b68f4aad373be01072b /fs/ceph/super.h
parentceph: set user pages dirty after direct IO read (diff)
downloadlinux-774a6a118c70f8c11fcfe636032b5016ad71a746.tar.xz
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/super.h')
-rw-r--r--fs/ceph/super.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 7ceab18c8ee2..50846e6f6a8c 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -321,7 +321,7 @@ struct ceph_inode_info {
dirty|flushing caps */
unsigned i_snap_caps; /* cap bits for snapped files */
- int i_nr_by_mode[CEPH_FILE_MODE_NUM]; /* open file counts */
+ int i_nr_by_mode[CEPH_FILE_MODE_BITS]; /* open file counts */
struct mutex i_truncate_mutex;
u32 i_truncate_seq; /* last truncate to smaller size */
@@ -906,10 +906,7 @@ extern int ceph_get_caps(struct ceph_inode_info *ci, int need, int want,
loff_t endoff, int *got, struct page **pinned_page);
/* for counting open files by mode */
-static inline void __ceph_get_fmode(struct ceph_inode_info *ci, int mode)
-{
- ci->i_nr_by_mode[mode]++;
-}
+extern void __ceph_get_fmode(struct ceph_inode_info *ci, int mode);
extern void ceph_put_fmode(struct ceph_inode_info *ci, int mode);
/* addr.c */