Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+26 -26
+1 -1
fs/gfs2/file.c
··· 1013 1013 struct gfs2_inode *ip = GFS2_I(file_inode(file)); 1014 1014 struct gfs2_glock *gl; 1015 1015 unsigned int state; 1016 - int flags; 1016 + u16 flags; 1017 1017 int error = 0; 1018 1018 int sleeptime; 1019 1019
+5 -5
fs/gfs2/glock.c
··· 446 446 { 447 447 const struct gfs2_glock_operations *glops = gl->gl_ops; 448 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 450 int ret; 451 451 452 452 lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP | ··· 750 750 * 751 751 */ 752 752 753 - void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, unsigned flags, 753 + void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, u16 flags, 754 754 struct gfs2_holder *gh) 755 755 { 756 756 INIT_LIST_HEAD(&gh->gh_list); ··· 774 774 * 775 775 */ 776 776 777 - void gfs2_holder_reinit(unsigned int state, unsigned flags, struct gfs2_holder *gh) 777 + void gfs2_holder_reinit(unsigned int state, u16 flags, struct gfs2_holder *gh) 778 778 { 779 779 gh->gh_state = state; 780 780 gh->gh_flags = flags; ··· 1080 1080 1081 1081 int gfs2_glock_nq_num(struct gfs2_sbd *sdp, u64 number, 1082 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 1085 struct gfs2_glock *gl; 1086 1086 int error; ··· 1539 1539 return "??"; 1540 1540 } 1541 1541 1542 - static const char *hflags2str(char *buf, unsigned flags, unsigned long iflags) 1542 + static const char *hflags2str(char *buf, u16 flags, unsigned long iflags) 1543 1543 { 1544 1544 char *p = buf; 1545 1545 if (flags & LM_FLAG_TRY)
+13 -13
fs/gfs2/glock.h
··· 79 79 * requested had acquired and released the lock. 80 80 */ 81 81 82 - #define LM_FLAG_TRY 0x00000001 83 - #define LM_FLAG_TRY_1CB 0x00000002 84 - #define LM_FLAG_NOEXP 0x00000004 85 - #define LM_FLAG_ANY 0x00000008 86 - #define LM_FLAG_PRIORITY 0x00000010 87 - #define GL_ASYNC 0x00000040 88 - #define GL_EXACT 0x00000080 89 - #define GL_SKIP 0x00000100 90 - #define GL_NOCACHE 0x00000400 82 + #define LM_FLAG_TRY 0x0001 83 + #define LM_FLAG_TRY_1CB 0x0002 84 + #define LM_FLAG_NOEXP 0x0004 85 + #define LM_FLAG_ANY 0x0008 86 + #define LM_FLAG_PRIORITY 0x0010 87 + #define GL_ASYNC 0x0040 88 + #define GL_EXACT 0x0080 89 + #define GL_SKIP 0x0100 90 + #define GL_NOCACHE 0x0400 91 91 92 92 /* 93 93 * lm_async_cb return flags ··· 183 183 int create, struct gfs2_glock **glp); 184 184 extern void gfs2_glock_put(struct gfs2_glock *gl); 185 185 extern void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, 186 - unsigned flags, struct gfs2_holder *gh); 187 - extern void gfs2_holder_reinit(unsigned int state, unsigned flags, 186 + u16 flags, struct gfs2_holder *gh); 187 + extern void gfs2_holder_reinit(unsigned int state, u16 flags, 188 188 struct gfs2_holder *gh); 189 189 extern void gfs2_holder_uninit(struct gfs2_holder *gh); 190 190 extern int gfs2_glock_nq(struct gfs2_holder *gh); ··· 195 195 extern void gfs2_glock_dq_uninit(struct gfs2_holder *gh); 196 196 extern int gfs2_glock_nq_num(struct gfs2_sbd *sdp, u64 number, 197 197 const struct gfs2_glock_operations *glops, 198 - unsigned int state, int flags, 198 + unsigned int state, u16 flags, 199 199 struct gfs2_holder *gh); 200 200 extern int gfs2_glock_nq_m(unsigned int num_gh, struct gfs2_holder *ghs); 201 201 extern void gfs2_glock_dq_m(unsigned int num_gh, struct gfs2_holder *ghs); ··· 215 215 */ 216 216 217 217 static inline int gfs2_glock_nq_init(struct gfs2_glock *gl, 218 - unsigned int state, int flags, 218 + unsigned int state, u16 flags, 219 219 struct gfs2_holder *gh) 220 220 { 221 221 int error;
+2 -2
fs/gfs2/incore.h
··· 259 259 260 260 struct gfs2_glock *gh_gl; 261 261 struct pid *gh_owner_pid; 262 - unsigned int gh_state; 263 - unsigned gh_flags; 262 + u16 gh_flags; 263 + u16 gh_state; 264 264 265 265 int gh_error; 266 266 unsigned long gh_iflags; /* HIF_... */
+5 -5
fs/gfs2/quota.c
··· 620 620 void gfs2_quota_unhold(struct gfs2_inode *ip) 621 621 { 622 622 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 623 - unsigned int x; 623 + u32 x; 624 624 625 625 if (ip->i_qadata == NULL) 626 626 return; ··· 1036 1036 { 1037 1037 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 1038 1038 struct gfs2_quota_data *qd; 1039 - unsigned int x; 1039 + u32 x; 1040 1040 int error = 0; 1041 1041 1042 1042 if (capable(CAP_SYS_RESOURCE) || ··· 1109 1109 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 1110 1110 struct gfs2_quota_data *qda[4]; 1111 1111 unsigned int count = 0; 1112 - unsigned int x; 1112 + u32 x; 1113 1113 int found; 1114 1114 1115 1115 if (!test_and_clear_bit(GIF_QD_LOCKED, &ip->i_flags)) ··· 1191 1191 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 1192 1192 struct gfs2_quota_data *qd; 1193 1193 s64 value, warn, limit; 1194 - unsigned int x; 1194 + u32 x; 1195 1195 int error = 0; 1196 1196 1197 1197 ap->allowed = UINT_MAX; /* Assume we are permitted a whole lot */ ··· 1249 1249 kuid_t uid, kgid_t gid) 1250 1250 { 1251 1251 struct gfs2_quota_data *qd; 1252 - unsigned int x; 1252 + u32 x; 1253 1253 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 1254 1254 1255 1255 if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON ||