summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2015-07-24 10:45:43 -0400
committerBob Peterson <rpeterso@redhat.com>2015-12-14 13:19:24 -0500
commitb58bf407ca4669a2dfcc00f5888ee719d9c34150 (patch)
tree359fd1f15869b180a4f7775e6e0c45e565d59bb8
parenta097dc7e24cba7980bc5e2df461a4ef228e97e59 (diff)
GFS2: Reduce size of incore inode
This patch makes no functional changes. Its goal is to reduce the size of the gfs2 inode in memory by rearranging structures and changing the size of some variables within the structure. Signed-off-by: Bob Peterson <rpeterso@redhat.com>
-rw-r--r--fs/gfs2/file.c2
-rw-r--r--fs/gfs2/glock.c10
-rw-r--r--fs/gfs2/glock.h26
-rw-r--r--fs/gfs2/incore.h4
-rw-r--r--fs/gfs2/quota.c10
5 files changed, 26 insertions, 26 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 3ead27d64bf0..860408053c95 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -1013,7 +1013,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
1013 struct gfs2_inode *ip = GFS2_I(file_inode(file)); 1013 struct gfs2_inode *ip = GFS2_I(file_inode(file));
1014 struct gfs2_glock *gl; 1014 struct gfs2_glock *gl;
1015 unsigned int state; 1015 unsigned int state;
1016 int flags; 1016 u16 flags;
1017 int error = 0; 1017 int error = 0;
1018 int sleeptime; 1018 int sleeptime;
1019 1019
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 430326e631dc..68484ef89a2c 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -446,7 +446,7 @@ __acquires(&gl->gl_lockref.lock)
446{ 446{
447 const struct gfs2_glock_operations *glops = gl->gl_ops; 447 const struct gfs2_glock_operations *glops = gl->gl_ops;
448 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; 448 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
449 unsigned int lck_flags = gh ? gh->gh_flags : 0; 449 unsigned int lck_flags = (unsigned int)(gh ? gh->gh_flags : 0);
450 int ret; 450 int ret;
451 451
452 lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP | 452 lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP |
@@ -750,7 +750,7 @@ again:
750 * 750 *
751 */ 751 */
752 752
753void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, unsigned flags, 753void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, u16 flags,
754 struct gfs2_holder *gh) 754 struct gfs2_holder *gh)
755{ 755{
756 INIT_LIST_HEAD(&gh->gh_list); 756 INIT_LIST_HEAD(&gh->gh_list);
@@ -774,7 +774,7 @@ void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, unsigned flags,
774 * 774 *
775 */ 775 */
776 776
777void gfs2_holder_reinit(unsigned int state, unsigned flags, struct gfs2_holder *gh) 777void gfs2_holder_reinit(unsigned int state, u16 flags, struct gfs2_holder *gh)
778{ 778{
779 gh->gh_state = state; 779 gh->gh_state = state;
780 gh->gh_flags = flags; 780 gh->gh_flags = flags;
@@ -1080,7 +1080,7 @@ void gfs2_glock_dq_uninit(struct gfs2_holder *gh)
1080 1080
1081int gfs2_glock_nq_num(struct gfs2_sbd *sdp, u64 number, 1081int gfs2_glock_nq_num(struct gfs2_sbd *sdp, u64 number,
1082 const struct gfs2_glock_operations *glops, 1082 const struct gfs2_glock_operations *glops,
1083 unsigned int state, int flags, struct gfs2_holder *gh) 1083 unsigned int state, u16 flags, struct gfs2_holder *gh)
1084{ 1084{
1085 struct gfs2_glock *gl; 1085 struct gfs2_glock *gl;
1086 int error; 1086 int error;
@@ -1539,7 +1539,7 @@ static const char *state2str(unsigned state)
1539 return "??"; 1539 return "??";
1540} 1540}
1541 1541
1542static const char *hflags2str(char *buf, unsigned flags, unsigned long iflags) 1542static const char *hflags2str(char *buf, u16 flags, unsigned long iflags)
1543{ 1543{
1544 char *p = buf; 1544 char *p = buf;
1545 if (flags & LM_FLAG_TRY) 1545 if (flags & LM_FLAG_TRY)
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index f7cdaa8b4c83..46ab67fc16da 100644
--- a/fs/gfs2/glock.h
+++ b/fs/gfs2/glock.h
@@ -79,15 +79,15 @@ enum {
79 * requested had acquired and released the lock. 79 * requested had acquired and released the lock.
80 */ 80 */
81 81
82#define LM_FLAG_TRY 0x00000001 82#define LM_FLAG_TRY 0x0001
83#define LM_FLAG_TRY_1CB 0x00000002 83#define LM_FLAG_TRY_1CB 0x0002
84#define LM_FLAG_NOEXP 0x00000004 84#define LM_FLAG_NOEXP 0x0004
85#define LM_FLAG_ANY 0x00000008 85#define LM_FLAG_ANY 0x0008
86#define LM_FLAG_PRIORITY 0x00000010 86#define LM_FLAG_PRIORITY 0x0010
87#define GL_ASYNC 0x00000040 87#define GL_ASYNC 0x0040
88#define GL_EXACT 0x00000080 88#define GL_EXACT 0x0080
89#define GL_SKIP 0x00000100 89#define GL_SKIP 0x0100
90#define GL_NOCACHE 0x00000400 90#define GL_NOCACHE 0x0400
91 91
92/* 92/*
93 * lm_async_cb return flags 93 * lm_async_cb return flags
@@ -183,8 +183,8 @@ extern int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
183 int create, struct gfs2_glock **glp); 183 int create, struct gfs2_glock **glp);
184extern void gfs2_glock_put(struct gfs2_glock *gl); 184extern void gfs2_glock_put(struct gfs2_glock *gl);
185extern void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, 185extern void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state,
186 unsigned flags, struct gfs2_holder *gh); 186 u16 flags, struct gfs2_holder *gh);
187extern void gfs2_holder_reinit(unsigned int state, unsigned flags, 187extern void gfs2_holder_reinit(unsigned int state, u16 flags,
188 struct gfs2_holder *gh); 188 struct gfs2_holder *gh);
189extern void gfs2_holder_uninit(struct gfs2_holder *gh); 189extern void gfs2_holder_uninit(struct gfs2_holder *gh);
190extern int gfs2_glock_nq(struct gfs2_holder *gh); 190extern int gfs2_glock_nq(struct gfs2_holder *gh);
@@ -195,7 +195,7 @@ extern void gfs2_glock_dq_wait(struct gfs2_holder *gh);
195extern void gfs2_glock_dq_uninit(struct gfs2_holder *gh); 195extern void gfs2_glock_dq_uninit(struct gfs2_holder *gh);
196extern int gfs2_glock_nq_num(struct gfs2_sbd *sdp, u64 number, 196extern int gfs2_glock_nq_num(struct gfs2_sbd *sdp, u64 number,
197 const struct gfs2_glock_operations *glops, 197 const struct gfs2_glock_operations *glops,
198 unsigned int state, int flags, 198 unsigned int state, u16 flags,
199 struct gfs2_holder *gh); 199 struct gfs2_holder *gh);
200extern int gfs2_glock_nq_m(unsigned int num_gh, struct gfs2_holder *ghs); 200extern int gfs2_glock_nq_m(unsigned int num_gh, struct gfs2_holder *ghs);
201extern void gfs2_glock_dq_m(unsigned int num_gh, struct gfs2_holder *ghs); 201extern void gfs2_glock_dq_m(unsigned int num_gh, struct gfs2_holder *ghs);
@@ -215,7 +215,7 @@ void gfs2_print_dbg(struct seq_file *seq, const char *fmt, ...);
215 */ 215 */
216 216
217static inline int gfs2_glock_nq_init(struct gfs2_glock *gl, 217static inline int gfs2_glock_nq_init(struct gfs2_glock *gl,
218 unsigned int state, int flags, 218 unsigned int state, u16 flags,
219 struct gfs2_holder *gh) 219 struct gfs2_holder *gh)
220{ 220{
221 int error; 221 int error;
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 25d0f12aaec5..921304e1d785 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -259,8 +259,8 @@ struct gfs2_holder {
259 259
260 struct gfs2_glock *gh_gl; 260 struct gfs2_glock *gh_gl;
261 struct pid *gh_owner_pid; 261 struct pid *gh_owner_pid;
262 unsigned int gh_state; 262 u16 gh_flags;
263 unsigned gh_flags; 263 u16 gh_state;
264 264
265 int gh_error; 265 int gh_error;
266 unsigned long gh_iflags; /* HIF_... */ 266 unsigned long gh_iflags; /* HIF_... */
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 63a72109976c..be6d9c450b22 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -620,7 +620,7 @@ out:
620void gfs2_quota_unhold(struct gfs2_inode *ip) 620void gfs2_quota_unhold(struct gfs2_inode *ip)
621{ 621{
622 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 622 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
623 unsigned int x; 623 u32 x;
624 624
625 if (ip->i_qadata == NULL) 625 if (ip->i_qadata == NULL)
626 return; 626 return;
@@ -1036,7 +1036,7 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
1036{ 1036{
1037 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 1037 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
1038 struct gfs2_quota_data *qd; 1038 struct gfs2_quota_data *qd;
1039 unsigned int x; 1039 u32 x;
1040 int error = 0; 1040 int error = 0;
1041 1041
1042 if (capable(CAP_SYS_RESOURCE) || 1042 if (capable(CAP_SYS_RESOURCE) ||
@@ -1109,7 +1109,7 @@ void gfs2_quota_unlock(struct gfs2_inode *ip)
1109 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 1109 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
1110 struct gfs2_quota_data *qda[4]; 1110 struct gfs2_quota_data *qda[4];
1111 unsigned int count = 0; 1111 unsigned int count = 0;
1112 unsigned int x; 1112 u32 x;
1113 int found; 1113 int found;
1114 1114
1115 if (!test_and_clear_bit(GIF_QD_LOCKED, &ip->i_flags)) 1115 if (!test_and_clear_bit(GIF_QD_LOCKED, &ip->i_flags))
@@ -1191,7 +1191,7 @@ int gfs2_quota_check(struct gfs2_inode *ip, kuid_t uid, kgid_t gid,
1191 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 1191 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
1192 struct gfs2_quota_data *qd; 1192 struct gfs2_quota_data *qd;
1193 s64 value, warn, limit; 1193 s64 value, warn, limit;
1194 unsigned int x; 1194 u32 x;
1195 int error = 0; 1195 int error = 0;
1196 1196
1197 ap->allowed = UINT_MAX; /* Assume we are permitted a whole lot */ 1197 ap->allowed = UINT_MAX; /* Assume we are permitted a whole lot */
@@ -1249,7 +1249,7 @@ void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
1249 kuid_t uid, kgid_t gid) 1249 kuid_t uid, kgid_t gid)
1250{ 1250{
1251 struct gfs2_quota_data *qd; 1251 struct gfs2_quota_data *qd;
1252 unsigned int x; 1252 u32 x;
1253 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 1253 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
1254 1254
1255 if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON || 1255 if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON ||