aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-02-27 12:00:42 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-02-27 12:00:42 -0500
commit568f4c9659a2225b0d29cf86feecbcf25c9045c8 (patch)
tree8ec0fee12313f88a195e0b90924f6b7633ba29f1 /fs
parent3a8fe9be6c9794e55ac2253eab91d42b28a9dab6 (diff)
[GFS2] 80 Column audit of GFS2
Requested by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/bmap.c10
-rw-r--r--fs/gfs2/dir.c30
-rw-r--r--fs/gfs2/eattr.c4
-rw-r--r--fs/gfs2/inode.c9
-rw-r--r--fs/gfs2/inode.h3
-rw-r--r--fs/gfs2/lm.c9
-rw-r--r--fs/gfs2/log.c12
-rw-r--r--fs/gfs2/lops.c54
-rw-r--r--fs/gfs2/lvb.c3
-rw-r--r--fs/gfs2/meta_io.c6
-rw-r--r--fs/gfs2/meta_io.h3
-rw-r--r--fs/gfs2/ondisk.c3
-rw-r--r--fs/gfs2/ops_address.c6
-rw-r--r--fs/gfs2/ops_file.c6
-rw-r--r--fs/gfs2/ops_fstype.c6
-rw-r--r--fs/gfs2/ops_vm.c6
-rw-r--r--fs/gfs2/quota.c12
-rw-r--r--fs/gfs2/recovery.c3
-rw-r--r--fs/gfs2/rgrp.c3
-rw-r--r--fs/gfs2/super.c30
20 files changed, 146 insertions, 72 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 4efcd8a39e98..e132d8a41008 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -129,7 +129,8 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, gfs2_unstuffer_t unstuffer,
129 gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); 129 gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode));
130 130
131 if (ip->i_di.di_size) { 131 if (ip->i_di.di_size) {
132 *(uint64_t *)(dibh->b_data + sizeof(struct gfs2_dinode)) = cpu_to_be64(block); 132 *(uint64_t *)(dibh->b_data + sizeof(struct gfs2_dinode)) =
133 cpu_to_be64(block);
133 ip->i_di.di_blocks++; 134 ip->i_di.di_blocks++;
134 } 135 }
135 136
@@ -241,7 +242,9 @@ static int build_height(struct gfs2_inode *ip, int height)
241 gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); 242 gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode));
242 243
243 if (new_block) { 244 if (new_block) {
244 *(uint64_t *)(dibh->b_data + sizeof(struct gfs2_dinode)) = cpu_to_be64(block); 245 *(uint64_t *)(dibh->b_data +
246 sizeof(struct gfs2_dinode)) =
247 cpu_to_be64(block);
245 ip->i_di.di_blocks++; 248 ip->i_di.di_blocks++;
246 } 249 }
247 250
@@ -313,7 +316,8 @@ static int build_height(struct gfs2_inode *ip, int height)
313 * 316 *
314 */ 317 */
315 318
316static void find_metapath(struct gfs2_inode *ip, uint64_t block, struct metapath *mp) 319static void find_metapath(struct gfs2_inode *ip, uint64_t block,
320 struct metapath *mp)
317{ 321{
318 struct gfs2_sbd *sdp = ip->i_sbd; 322 struct gfs2_sbd *sdp = ip->i_sbd;
319 uint64_t b = block; 323 uint64_t b = block;
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index 65871a2b460e..56683788a6cf 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -98,7 +98,8 @@ int gfs2_dir_get_buffer(struct gfs2_inode *ip, uint64_t block, int new,
98 gfs2_metatype_set(bh, GFS2_METATYPE_JD, GFS2_FORMAT_JD); 98 gfs2_metatype_set(bh, GFS2_METATYPE_JD, GFS2_FORMAT_JD);
99 gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header)); 99 gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header));
100 } else { 100 } else {
101 error = gfs2_meta_read(ip->i_gl, block, DIO_START | DIO_WAIT, &bh); 101 error = gfs2_meta_read(ip->i_gl, block, DIO_START | DIO_WAIT,
102 &bh);
102 if (error) 103 if (error)
103 return error; 104 return error;
104 if (gfs2_metatype_check(ip->i_sbd, bh, GFS2_METATYPE_JD)) { 105 if (gfs2_metatype_check(ip->i_sbd, bh, GFS2_METATYPE_JD)) {
@@ -163,7 +164,8 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf,
163 164
164 if (gfs2_is_stuffed(ip) && 165 if (gfs2_is_stuffed(ip) &&
165 offset + size <= sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode)) 166 offset + size <= sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode))
166 return gfs2_dir_write_stuffed(ip, buf, (unsigned int)offset, size); 167 return gfs2_dir_write_stuffed(ip, buf, (unsigned int)offset,
168 size);
167 169
168 if (gfs2_assert_warn(sdp, gfs2_is_jdata(ip))) 170 if (gfs2_assert_warn(sdp, gfs2_is_jdata(ip)))
169 return -EINVAL; 171 return -EINVAL;
@@ -188,7 +190,8 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf,
188 190
189 if (!extlen) { 191 if (!extlen) {
190 new = 1; 192 new = 1;
191 error = gfs2_block_map(ip, lblock, &new, &dblock, &extlen); 193 error = gfs2_block_map(ip, lblock, &new, &dblock,
194 &extlen);
192 if (error) 195 if (error)
193 goto fail; 196 goto fail;
194 error = -EIO; 197 error = -EIO;
@@ -196,7 +199,9 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf,
196 goto fail; 199 goto fail;
197 } 200 }
198 201
199 error = gfs2_dir_get_buffer(ip, dblock, (amount == sdp->sd_jbsize) ? 1 : new, &bh); 202 error = gfs2_dir_get_buffer(ip, dblock,
203 (amount == sdp->sd_jbsize) ?
204 1 : new, &bh);
200 if (error) 205 if (error)
201 goto fail; 206 goto fail;
202 207
@@ -280,7 +285,8 @@ static int gfs2_dir_read_data(struct gfs2_inode *ip, char *buf,
280 return 0; 285 return 0;
281 286
282 if (gfs2_is_stuffed(ip)) 287 if (gfs2_is_stuffed(ip))
283 return gfs2_dir_read_stuffed(ip, buf, (unsigned int)offset, size); 288 return gfs2_dir_read_stuffed(ip, buf, (unsigned int)offset,
289 size);
284 290
285 if (gfs2_assert_warn(sdp, gfs2_is_jdata(ip))) 291 if (gfs2_assert_warn(sdp, gfs2_is_jdata(ip)))
286 return -EINVAL; 292 return -EINVAL;
@@ -299,7 +305,8 @@ static int gfs2_dir_read_data(struct gfs2_inode *ip, char *buf,
299 305
300 if (!extlen) { 306 if (!extlen) {
301 new = 0; 307 new = 0;
302 error = gfs2_block_map(ip, lblock, &new, &dblock, &extlen); 308 error = gfs2_block_map(ip, lblock, &new, &dblock,
309 &extlen);
303 if (error) 310 if (error)
304 goto fail; 311 goto fail;
305 } 312 }
@@ -538,13 +545,15 @@ int gfs2_dirent_alloc(struct gfs2_inode *dip, struct buffer_head *bh,
538 545
539 if (dent->de_inum.no_addr) { 546 if (dent->de_inum.no_addr) {
540 new = (struct gfs2_dirent *)((char *)dent + 547 new = (struct gfs2_dirent *)((char *)dent +
541 GFS2_DIRENT_SIZE(cur_name_len)); 548 GFS2_DIRENT_SIZE(cur_name_len));
542 memset(new, 0, sizeof(struct gfs2_dirent)); 549 memset(new, 0, sizeof(struct gfs2_dirent));
543 550
544 new->de_rec_len = cpu_to_be16(cur_rec_len - GFS2_DIRENT_SIZE(cur_name_len)); 551 new->de_rec_len = cpu_to_be16(cur_rec_len -
552 GFS2_DIRENT_SIZE(cur_name_len));
545 new->de_name_len = cpu_to_be16(name_len); 553 new->de_name_len = cpu_to_be16(name_len);
546 554
547 dent->de_rec_len = cpu_to_be16(cur_rec_len - be16_to_cpu(new->de_rec_len)); 555 dent->de_rec_len = cpu_to_be16(cur_rec_len -
556 be16_to_cpu(new->de_rec_len));
548 557
549 *dent_out = new; 558 *dent_out = new;
550 return 0; 559 return 0;
@@ -2281,7 +2290,8 @@ int gfs2_dir_exhash_dealloc(struct gfs2_inode *dip)
2281 error = gfs2_meta_inode_buffer(dip, &bh); 2290 error = gfs2_meta_inode_buffer(dip, &bh);
2282 if (!error) { 2291 if (!error) {
2283 gfs2_trans_add_bh(dip->i_gl, bh, 1); 2292 gfs2_trans_add_bh(dip->i_gl, bh, 1);
2284 ((struct gfs2_dinode *)bh->b_data)->di_mode = cpu_to_be32(S_IFREG); 2293 ((struct gfs2_dinode *)bh->b_data)->di_mode =
2294 cpu_to_be32(S_IFREG);
2285 brelse(bh); 2295 brelse(bh);
2286 } 2296 }
2287 2297
diff --git a/fs/gfs2/eattr.c b/fs/gfs2/eattr.c
index 02e45c4ecbec..146995d9cd65 100644
--- a/fs/gfs2/eattr.c
+++ b/fs/gfs2/eattr.c
@@ -354,7 +354,6 @@ static int ea_remove_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
354 return error; 354 return error;
355} 355}
356 356
357/******************************************************************************/
358 357
359static int gfs2_ea_repack_i(struct gfs2_inode *ip) 358static int gfs2_ea_repack_i(struct gfs2_inode *ip)
360{ 359{
@@ -819,7 +818,8 @@ static int ea_init(struct gfs2_inode *ip, struct gfs2_ea_request *er)
819static struct gfs2_ea_header *ea_split_ea(struct gfs2_ea_header *ea) 818static struct gfs2_ea_header *ea_split_ea(struct gfs2_ea_header *ea)
820{ 819{
821 uint32_t ea_size = GFS2_EA_SIZE(ea); 820 uint32_t ea_size = GFS2_EA_SIZE(ea);
822 struct gfs2_ea_header *new = (struct gfs2_ea_header *)((char *)ea + ea_size); 821 struct gfs2_ea_header *new = (struct gfs2_ea_header *)((char *)ea +
822 ea_size);
823 uint32_t new_size = GFS2_EA_REC_LEN(ea) - ea_size; 823 uint32_t new_size = GFS2_EA_REC_LEN(ea) - ea_size;
824 int last = ea->ea_flags & GFS2_EAFLAG_LAST; 824 int last = ea->ea_flags & GFS2_EAFLAG_LAST;
825 825
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 30ca82a1addf..51ecdb8503b0 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1034,8 +1034,10 @@ static void init_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl,
1034 gfs2_tune_get(sdp, gt_new_files_directio)) 1034 gfs2_tune_get(sdp, gt_new_files_directio))
1035 di->di_flags |= cpu_to_be32(GFS2_DIF_DIRECTIO); 1035 di->di_flags |= cpu_to_be32(GFS2_DIF_DIRECTIO);
1036 } else if (S_ISDIR(mode)) { 1036 } else if (S_ISDIR(mode)) {
1037 di->di_flags |= cpu_to_be32(dip->i_di.di_flags & GFS2_DIF_INHERIT_DIRECTIO); 1037 di->di_flags |= cpu_to_be32(dip->i_di.di_flags &
1038 di->di_flags |= cpu_to_be32(dip->i_di.di_flags & GFS2_DIF_INHERIT_JDATA); 1038 GFS2_DIF_INHERIT_DIRECTIO);
1039 di->di_flags |= cpu_to_be32(dip->i_di.di_flags &
1040 GFS2_DIF_INHERIT_JDATA);
1039 } 1041 }
1040 1042
1041 di->__pad1 = 0; 1043 di->__pad1 = 0;
@@ -1188,7 +1190,8 @@ static int link_dinode(struct gfs2_inode *dip, struct qstr *name,
1188 * Returns: An inode 1190 * Returns: An inode
1189 */ 1191 */
1190 1192
1191struct inode *gfs2_createi(struct gfs2_holder *ghs, struct qstr *name, unsigned int mode) 1193struct inode *gfs2_createi(struct gfs2_holder *ghs, struct qstr *name,
1194 unsigned int mode)
1192{ 1195{
1193 struct inode *inode; 1196 struct inode *inode;
1194 struct gfs2_inode *dip = get_gl2ip(ghs->gh_gl); 1197 struct gfs2_inode *dip = get_gl2ip(ghs->gh_gl);
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h
index 8ef85f5feb1b..069f0e21db6d 100644
--- a/fs/gfs2/inode.h
+++ b/fs/gfs2/inode.h
@@ -46,7 +46,8 @@ int gfs2_inode_dealloc(struct gfs2_sbd *sdp, struct gfs2_unlinked *ul);
46int gfs2_change_nlink(struct gfs2_inode *ip, int diff); 46int gfs2_change_nlink(struct gfs2_inode *ip, int diff);
47int gfs2_lookupi(struct inode *dir, struct qstr *name, int is_root, 47int gfs2_lookupi(struct inode *dir, struct qstr *name, int is_root,
48 struct inode **ipp); 48 struct inode **ipp);
49struct inode *gfs2_createi(struct gfs2_holder *ghs, struct qstr *name, unsigned int mode); 49struct inode *gfs2_createi(struct gfs2_holder *ghs, struct qstr *name,
50 unsigned int mode);
50int gfs2_unlinki(struct gfs2_inode *dip, struct qstr *name, 51int gfs2_unlinki(struct gfs2_inode *dip, struct qstr *name,
51 struct gfs2_inode *ip, struct gfs2_unlinked *ul); 52 struct gfs2_inode *ip, struct gfs2_unlinked *ul);
52int gfs2_rmdiri(struct gfs2_inode *dip, struct qstr *name, 53int gfs2_rmdiri(struct gfs2_inode *dip, struct qstr *name,
diff --git a/fs/gfs2/lm.c b/fs/gfs2/lm.c
index f86f11f39738..3df8fa00442d 100644
--- a/fs/gfs2/lm.c
+++ b/fs/gfs2/lm.c
@@ -80,7 +80,8 @@ int gfs2_lm_mount(struct gfs2_sbd *sdp, int silent)
80void gfs2_lm_others_may_mount(struct gfs2_sbd *sdp) 80void gfs2_lm_others_may_mount(struct gfs2_sbd *sdp)
81{ 81{
82 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) 82 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
83 sdp->sd_lockstruct.ls_ops->lm_others_may_mount(sdp->sd_lockstruct.ls_lockspace); 83 sdp->sd_lockstruct.ls_ops->lm_others_may_mount(
84 sdp->sd_lockstruct.ls_lockspace);
84} 85}
85 86
86void gfs2_lm_unmount(struct gfs2_sbd *sdp) 87void gfs2_lm_unmount(struct gfs2_sbd *sdp)
@@ -124,7 +125,8 @@ int gfs2_lm_get_lock(struct gfs2_sbd *sdp, struct lm_lockname *name,
124 if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) 125 if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
125 error = -EIO; 126 error = -EIO;
126 else 127 else
127 error = sdp->sd_lockstruct.ls_ops->lm_get_lock(sdp->sd_lockstruct.ls_lockspace, name, lockp); 128 error = sdp->sd_lockstruct.ls_ops->lm_get_lock(
129 sdp->sd_lockstruct.ls_lockspace, name, lockp);
128 return error; 130 return error;
129} 131}
130 132
@@ -230,6 +232,7 @@ void gfs2_lm_recovery_done(struct gfs2_sbd *sdp, unsigned int jid,
230 unsigned int message) 232 unsigned int message)
231{ 233{
232 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) 234 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
233 sdp->sd_lockstruct.ls_ops->lm_recovery_done(sdp->sd_lockstruct.ls_lockspace, jid, message); 235 sdp->sd_lockstruct.ls_ops->lm_recovery_done(
236 sdp->sd_lockstruct.ls_lockspace, jid, message);
234} 237}
235 238
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 2483f0c2c50e..0e31d46edd4d 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -74,10 +74,12 @@ unsigned int gfs2_struct2blk(struct gfs2_sbd *sdp, unsigned int nstruct,
74 unsigned int first, second; 74 unsigned int first, second;
75 75
76 blks = 1; 76 blks = 1;
77 first = (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_log_descriptor)) / ssize; 77 first = (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_log_descriptor)) /
78 ssize;
78 79
79 if (nstruct > first) { 80 if (nstruct > first) {
80 second = (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_meta_header)) / ssize; 81 second = (sdp->sd_sb.sb_bsize -
82 sizeof(struct gfs2_meta_header)) / ssize;
81 blks += DIV_RU(nstruct - first, second); 83 blks += DIV_RU(nstruct - first, second);
82 } 84 }
83 85
@@ -255,7 +257,8 @@ static uint64_t log_bmap(struct gfs2_sbd *sdp, unsigned int lbn)
255 uint64_t dbn; 257 uint64_t dbn;
256 int error; 258 int error;
257 259
258 error = gfs2_block_map(get_v2ip(sdp->sd_jdesc->jd_inode), lbn, &new, &dbn, NULL); 260 error = gfs2_block_map(get_v2ip(sdp->sd_jdesc->jd_inode),
261 lbn, &new, &dbn, NULL);
259 gfs2_assert_withdraw(sdp, !error && dbn); 262 gfs2_assert_withdraw(sdp, !error && dbn);
260 263
261 return dbn; 264 return dbn;
@@ -554,7 +557,8 @@ static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
554 gfs2_assert_withdraw(sdp, ((int)sdp->sd_log_commited_revoke) >= 0); 557 gfs2_assert_withdraw(sdp, ((int)sdp->sd_log_commited_revoke) >= 0);
555 558
556 if (sdp->sd_log_commited_buf) 559 if (sdp->sd_log_commited_buf)
557 reserved += 1 + sdp->sd_log_commited_buf + sdp->sd_log_commited_buf/503; 560 reserved += 1 + sdp->sd_log_commited_buf +
561 sdp->sd_log_commited_buf/503;
558 if (sdp->sd_log_commited_revoke) 562 if (sdp->sd_log_commited_revoke)
559 reserved += gfs2_struct2blk(sdp, sdp->sd_log_commited_revoke, 563 reserved += gfs2_struct2blk(sdp, sdp->sd_log_commited_revoke,
560 sizeof(uint64_t)); 564 sizeof(uint64_t));
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 3d792f81e48c..4bd89c0781e7 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -137,7 +137,8 @@ static void buf_lo_before_commit(struct gfs2_sbd *sdp)
137 memset(ld->ld_reserved, 0, sizeof(ld->ld_reserved)); 137 memset(ld->ld_reserved, 0, sizeof(ld->ld_reserved));
138 138
139 n = 0; 139 n = 0;
140 list_for_each_entry_continue(bd1, &sdp->sd_log_le_buf, bd_le.le_list) { 140 list_for_each_entry_continue(bd1, &sdp->sd_log_le_buf,
141 bd_le.le_list) {
141 *ptr++ = cpu_to_be64(bd1->bd_bh->b_blocknr); 142 *ptr++ = cpu_to_be64(bd1->bd_bh->b_blocknr);
142 if (++n >= num) 143 if (++n >= num)
143 break; 144 break;
@@ -147,7 +148,8 @@ static void buf_lo_before_commit(struct gfs2_sbd *sdp)
147 ll_rw_block(WRITE, 1, &bh); 148 ll_rw_block(WRITE, 1, &bh);
148 149
149 n = 0; 150 n = 0;
150 list_for_each_entry_continue(bd2, &sdp->sd_log_le_buf, bd_le.le_list) { 151 list_for_each_entry_continue(bd2, &sdp->sd_log_le_buf,
152 bd_le.le_list) {
151 bh = gfs2_log_fake_buf(sdp, bd2->bd_bh); 153 bh = gfs2_log_fake_buf(sdp, bd2->bd_bh);
152 set_buffer_dirty(bh); 154 set_buffer_dirty(bh);
153 ll_rw_block(WRITE, 1, &bh); 155 ll_rw_block(WRITE, 1, &bh);
@@ -239,7 +241,8 @@ static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass)
239 struct gfs2_sbd *sdp = get_v2ip(jd->jd_inode)->i_sbd; 241 struct gfs2_sbd *sdp = get_v2ip(jd->jd_inode)->i_sbd;
240 242
241 if (error) { 243 if (error) {
242 gfs2_meta_sync(get_v2ip(jd->jd_inode)->i_gl, DIO_START | DIO_WAIT); 244 gfs2_meta_sync(get_v2ip(jd->jd_inode)->i_gl,
245 DIO_START | DIO_WAIT);
243 return; 246 return;
244 } 247 }
245 if (pass != 1) 248 if (pass != 1)
@@ -283,7 +286,8 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp)
283 ld->ld_header.mh_type = cpu_to_be16(GFS2_METATYPE_LD); 286 ld->ld_header.mh_type = cpu_to_be16(GFS2_METATYPE_LD);
284 ld->ld_header.mh_format = cpu_to_be16(GFS2_FORMAT_LD); 287 ld->ld_header.mh_format = cpu_to_be16(GFS2_FORMAT_LD);
285 ld->ld_type = cpu_to_be32(GFS2_LOG_DESC_REVOKE); 288 ld->ld_type = cpu_to_be32(GFS2_LOG_DESC_REVOKE);
286 ld->ld_length = cpu_to_be32(gfs2_struct2blk(sdp, sdp->sd_log_num_revoke, sizeof(uint64_t))); 289 ld->ld_length = cpu_to_be32(gfs2_struct2blk(sdp, sdp->sd_log_num_revoke,
290 sizeof(uint64_t)));
287 ld->ld_data1 = cpu_to_be32(sdp->sd_log_num_revoke); 291 ld->ld_data1 = cpu_to_be32(sdp->sd_log_num_revoke);
288 ld->ld_data2 = cpu_to_be32(0); 292 ld->ld_data2 = cpu_to_be32(0);
289 memset(ld->ld_reserved, 0, sizeof(ld->ld_reserved)); 293 memset(ld->ld_reserved, 0, sizeof(ld->ld_reserved));
@@ -515,19 +519,24 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
515 * into the log along with a header 519 * into the log along with a header
516 */ 520 */
517 gfs2_log_lock(sdp); 521 gfs2_log_lock(sdp);
518 bd2 = bd1 = list_prepare_entry(bd1, &sdp->sd_log_le_databuf, bd_le.le_list); 522 bd2 = bd1 = list_prepare_entry(bd1, &sdp->sd_log_le_databuf,
523 bd_le.le_list);
519 while(total_dbuf) { 524 while(total_dbuf) {
520 num = total_jdata; 525 num = total_jdata;
521 if (num > limit) 526 if (num > limit)
522 num = limit; 527 num = limit;
523 n = 0; 528 n = 0;
524 list_for_each_entry_safe_continue(bd1, bdt, &sdp->sd_log_le_databuf, bd_le.le_list) { 529 list_for_each_entry_safe_continue(bd1, bdt,
530 &sdp->sd_log_le_databuf,
531 bd_le.le_list) {
525 /* An ordered write buffer */ 532 /* An ordered write buffer */
526 if (bd1->bd_bh && !buffer_pinned(bd1->bd_bh)) { 533 if (bd1->bd_bh && !buffer_pinned(bd1->bd_bh)) {
527 list_move(&bd1->bd_le.le_list, &started); 534 list_move(&bd1->bd_le.le_list, &started);
528 if (bd1 == bd2) { 535 if (bd1 == bd2) {
529 bd2 = NULL; 536 bd2 = NULL;
530 bd2 = list_prepare_entry(bd2, &sdp->sd_log_le_databuf, bd_le.le_list); 537 bd2 = list_prepare_entry(bd2,
538 &sdp->sd_log_le_databuf,
539 bd_le.le_list);
531 } 540 }
532 total_dbuf--; 541 total_dbuf--;
533 if (bd1->bd_bh) { 542 if (bd1->bd_bh) {
@@ -535,7 +544,8 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
535 if (buffer_dirty(bd1->bd_bh)) { 544 if (buffer_dirty(bd1->bd_bh)) {
536 gfs2_log_unlock(sdp); 545 gfs2_log_unlock(sdp);
537 wait_on_buffer(bd1->bd_bh); 546 wait_on_buffer(bd1->bd_bh);
538 ll_rw_block(WRITE, 1, &bd1->bd_bh); 547 ll_rw_block(WRITE, 1,
548 &bd1->bd_bh);
539 gfs2_log_lock(sdp); 549 gfs2_log_lock(sdp);
540 } 550 }
541 brelse(bd1->bd_bh); 551 brelse(bd1->bd_bh);
@@ -547,12 +557,17 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
547 gfs2_log_unlock(sdp); 557 gfs2_log_unlock(sdp);
548 if (!bh) { 558 if (!bh) {
549 bh = gfs2_log_get_buf(sdp); 559 bh = gfs2_log_get_buf(sdp);
550 ld = (struct gfs2_log_descriptor *)bh->b_data; 560 ld = (struct gfs2_log_descriptor *)
561 bh->b_data;
551 ptr = (__be64 *)(bh->b_data + offset); 562 ptr = (__be64 *)(bh->b_data + offset);
552 ld->ld_header.mh_magic = cpu_to_be32(GFS2_MAGIC); 563 ld->ld_header.mh_magic =
553 ld->ld_header.mh_type = cpu_to_be16(GFS2_METATYPE_LD); 564 cpu_to_be32(GFS2_MAGIC);
554 ld->ld_header.mh_format = cpu_to_be16(GFS2_FORMAT_LD); 565 ld->ld_header.mh_type =
555 ld->ld_type = cpu_to_be32(GFS2_LOG_DESC_JDATA); 566 cpu_to_be16(GFS2_METATYPE_LD);
567 ld->ld_header.mh_format =
568 cpu_to_be16(GFS2_FORMAT_LD);
569 ld->ld_type =
570 cpu_to_be32(GFS2_LOG_DESC_JDATA);
556 ld->ld_length = cpu_to_be32(num + 1); 571 ld->ld_length = cpu_to_be32(num + 1);
557 ld->ld_data1 = cpu_to_be32(num); 572 ld->ld_data1 = cpu_to_be32(num);
558 ld->ld_data2 = cpu_to_be32(0); 573 ld->ld_data2 = cpu_to_be32(0);
@@ -577,7 +592,8 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
577 } 592 }
578 n = 0; 593 n = 0;
579 gfs2_log_lock(sdp); 594 gfs2_log_lock(sdp);
580 list_for_each_entry_continue(bd2, &sdp->sd_log_le_databuf, bd_le.le_list) { 595 list_for_each_entry_continue(bd2, &sdp->sd_log_le_databuf,
596 bd_le.le_list) {
581 if (!bd2->bd_bh) 597 if (!bd2->bd_bh)
582 continue; 598 continue;
583 /* copy buffer if it needs escaping */ 599 /* copy buffer if it needs escaping */
@@ -587,7 +603,9 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
587 struct page *page = bd2->bd_bh->b_page; 603 struct page *page = bd2->bd_bh->b_page;
588 bh = gfs2_log_get_buf(sdp); 604 bh = gfs2_log_get_buf(sdp);
589 kaddr = kmap_atomic(page, KM_USER0); 605 kaddr = kmap_atomic(page, KM_USER0);
590 memcpy(bh->b_data, kaddr + bh_offset(bd2->bd_bh), sdp->sd_sb.sb_bsize); 606 memcpy(bh->b_data,
607 kaddr + bh_offset(bd2->bd_bh),
608 sdp->sd_sb.sb_bsize);
591 kunmap_atomic(page, KM_USER0); 609 kunmap_atomic(page, KM_USER0);
592 *(__be32 *)bh->b_data = 0; 610 *(__be32 *)bh->b_data = 0;
593 } else { 611 } else {
@@ -608,7 +626,8 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
608 /* Wait on all ordered buffers */ 626 /* Wait on all ordered buffers */
609 while (!list_empty(&started)) { 627 while (!list_empty(&started)) {
610 gfs2_log_lock(sdp); 628 gfs2_log_lock(sdp);
611 bd1 = list_entry(started.next, struct gfs2_bufdata, bd_le.le_list); 629 bd1 = list_entry(started.next, struct gfs2_bufdata,
630 bd_le.le_list);
612 list_del(&bd1->bd_le.le_list); 631 list_del(&bd1->bd_le.le_list);
613 sdp->sd_log_num_databuf--; 632 sdp->sd_log_num_databuf--;
614 633
@@ -685,7 +704,8 @@ static void databuf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass)
685 struct gfs2_sbd *sdp = get_v2ip(jd->jd_inode)->i_sbd; 704 struct gfs2_sbd *sdp = get_v2ip(jd->jd_inode)->i_sbd;
686 705
687 if (error) { 706 if (error) {
688 gfs2_meta_sync(get_v2ip(jd->jd_inode)->i_gl, DIO_START | DIO_WAIT); 707 gfs2_meta_sync(get_v2ip(jd->jd_inode)->i_gl,
708 DIO_START | DIO_WAIT);
689 return; 709 return;
690 } 710 }
691 if (pass != 1) 711 if (pass != 1)
diff --git a/fs/gfs2/lvb.c b/fs/gfs2/lvb.c
index 8af62568a3f4..ca959ebb80c1 100644
--- a/fs/gfs2/lvb.c
+++ b/fs/gfs2/lvb.c
@@ -16,7 +16,8 @@
16 16
17#include "gfs2.h" 17#include "gfs2.h"
18 18
19#define pv(struct, member, fmt) printk(" "#member" = "fmt"\n", struct->member); 19#define pv(struct, member, fmt) printk(KERN_INFO " "#member" = "fmt"\n", \
20 struct->member);
20 21
21void gfs2_quota_lvb_in(struct gfs2_quota_lvb *qb, char *lvb) 22void gfs2_quota_lvb_in(struct gfs2_quota_lvb *qb, char *lvb)
22{ 23{
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index f4c4dfbf6986..53f33fa899f9 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -542,7 +542,8 @@ int gfs2_meta_reread(struct gfs2_sbd *sdp, struct buffer_head *bh, int flags)
542 * @meta: Flag to indicate whether its metadata or not 542 * @meta: Flag to indicate whether its metadata or not
543 */ 543 */
544 544
545void gfs2_attach_bufdata(struct gfs2_glock *gl, struct buffer_head *bh, int meta) 545void gfs2_attach_bufdata(struct gfs2_glock *gl, struct buffer_head *bh,
546 int meta)
546{ 547{
547 struct gfs2_bufdata *bd; 548 struct gfs2_bufdata *bd;
548 549
@@ -818,7 +819,8 @@ void gfs2_meta_ra(struct gfs2_glock *gl, uint64_t dblock, uint32_t extlen)
818 struct gfs2_sbd *sdp = gl->gl_sbd; 819 struct gfs2_sbd *sdp = gl->gl_sbd;
819 struct inode *aspace = gl->gl_aspace; 820 struct inode *aspace = gl->gl_aspace;
820 struct buffer_head *first_bh, *bh; 821 struct buffer_head *first_bh, *bh;
821 uint32_t max_ra = gfs2_tune_get(sdp, gt_max_readahead) >> sdp->sd_sb.sb_bsize_shift; 822 uint32_t max_ra = gfs2_tune_get(sdp, gt_max_readahead) >>
823 sdp->sd_sb.sb_bsize_shift;
822 int error; 824 int error;
823 825
824 if (!extlen || !max_ra) 826 if (!extlen || !max_ra)
diff --git a/fs/gfs2/meta_io.h b/fs/gfs2/meta_io.h
index 887cac302c1b..d72144d5d727 100644
--- a/fs/gfs2/meta_io.h
+++ b/fs/gfs2/meta_io.h
@@ -64,7 +64,8 @@ int gfs2_meta_read(struct gfs2_glock *gl, uint64_t blkno,
64 int flags, struct buffer_head **bhp); 64 int flags, struct buffer_head **bhp);
65int gfs2_meta_reread(struct gfs2_sbd *sdp, struct buffer_head *bh, int flags); 65int gfs2_meta_reread(struct gfs2_sbd *sdp, struct buffer_head *bh, int flags);
66 66
67void gfs2_attach_bufdata(struct gfs2_glock *gl, struct buffer_head *bh, int meta); 67void gfs2_attach_bufdata(struct gfs2_glock *gl, struct buffer_head *bh,
68 int meta);
68void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh); 69void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh);
69void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh, 70void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh,
70 struct gfs2_ail *ai); 71 struct gfs2_ail *ai);
diff --git a/fs/gfs2/ondisk.c b/fs/gfs2/ondisk.c
index 964abd2760ff..5a0bdc22a1f4 100644
--- a/fs/gfs2/ondisk.c
+++ b/fs/gfs2/ondisk.c
@@ -17,7 +17,8 @@
17#include "gfs2.h" 17#include "gfs2.h"
18#include <linux/gfs2_ondisk.h> 18#include <linux/gfs2_ondisk.h>
19 19
20#define pv(struct, member, fmt) printk(KERN_INFO " "#member" = "fmt"\n", struct->member); 20#define pv(struct, member, fmt) printk(KERN_INFO " "#member" = "fmt"\n", \
21 struct->member);
21#define pa(struct, member, count) print_array(#member, struct->member, count); 22#define pa(struct, member, count) print_array(#member, struct->member, count);
22 23
23/** 24/**
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index 8f839120a473..89a8b8fad2e7 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -357,7 +357,8 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
357 357
358 if (gfs2_is_stuffed(ip)) { 358 if (gfs2_is_stuffed(ip)) {
359 if (end > sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode)) { 359 if (end > sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode)) {
360 error = gfs2_unstuff_dinode(ip, gfs2_unstuffer_page, page); 360 error = gfs2_unstuff_dinode(ip, gfs2_unstuffer_page,
361 page);
361 if (error == 0) 362 if (error == 0)
362 goto prepare_write; 363 goto prepare_write;
363 } else if (!PageUptodate(page)) 364 } else if (!PageUptodate(page))
@@ -432,7 +433,8 @@ static int gfs2_commit_write(struct file *file, struct page *page,
432 if (inode->i_size < file_size) 433 if (inode->i_size < file_size)
433 i_size_write(inode, file_size); 434 i_size_write(inode, file_size);
434 } else { 435 } else {
435 if (sdp->sd_args.ar_data == GFS2_DATA_ORDERED || gfs2_is_jdata(ip)) 436 if (sdp->sd_args.ar_data == GFS2_DATA_ORDERED ||
437 gfs2_is_jdata(ip))
436 gfs2_page_add_databufs(ip, page, from, to); 438 gfs2_page_add_databufs(ip, page, from, to);
437 error = generic_commit_write(file, page, from, to); 439 error = generic_commit_write(file, page, from, to);
438 if (error) 440 if (error)
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index 989f0f70fc2e..e6ae2551b0cb 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -531,7 +531,8 @@ static int gfs2_readdir(struct file *file, void *dirent, filldir_t filldir)
531static int gfs2_ioctl_flags(struct gfs2_inode *ip, unsigned int cmd, 531static int gfs2_ioctl_flags(struct gfs2_inode *ip, unsigned int cmd,
532 unsigned long arg) 532 unsigned long arg)
533{ 533{
534 unsigned int lmode = (cmd == GFS2_IOCTL_SETFLAGS) ? LM_ST_EXCLUSIVE : LM_ST_SHARED; 534 unsigned int lmode = (cmd == GFS2_IOCTL_SETFLAGS) ?
535 LM_ST_EXCLUSIVE : LM_ST_SHARED;
535 struct buffer_head *dibh; 536 struct buffer_head *dibh;
536 struct gfs2_holder i_gh; 537 struct gfs2_holder i_gh;
537 int error; 538 int error;
@@ -559,7 +560,8 @@ static int gfs2_ioctl_flags(struct gfs2_inode *ip, unsigned int cmd,
559 if (!S_ISREG(ip->i_di.di_mode)) 560 if (!S_ISREG(ip->i_di.di_mode))
560 goto out; 561 goto out;
561 } 562 }
562 if (flags & (GFS2_DIF_INHERIT_JDATA|GFS2_DIF_INHERIT_DIRECTIO)) { 563 if (flags &
564 (GFS2_DIF_INHERIT_JDATA|GFS2_DIF_INHERIT_DIRECTIO)) {
563 if (!S_ISDIR(ip->i_di.di_mode)) 565 if (!S_ISDIR(ip->i_di.di_mode))
564 goto out; 566 goto out;
565 } 567 }
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index a85f1a2676f6..535f020f1e0c 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -128,7 +128,8 @@ static void init_vfs(struct gfs2_sbd *sdp)
128 to allow us to read-in the on-disk superblock. */ 128 to allow us to read-in the on-disk superblock. */
129 sdp->sd_sb.sb_bsize = sb_min_blocksize(sb, GFS2_BASIC_BLOCK); 129 sdp->sd_sb.sb_bsize = sb_min_blocksize(sb, GFS2_BASIC_BLOCK);
130 sdp->sd_sb.sb_bsize_shift = sb->s_blocksize_bits; 130 sdp->sd_sb.sb_bsize_shift = sb->s_blocksize_bits;
131 sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift - GFS2_BASIC_BLOCK_SHIFT; 131 sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift -
132 GFS2_BASIC_BLOCK_SHIFT;
132 sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift; 133 sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift;
133} 134}
134 135
@@ -435,7 +436,8 @@ static int init_journal(struct gfs2_sbd *sdp, int undo)
435 goto fail_jindex; 436 goto fail_jindex;
436 } 437 }
437 438
438 error = gfs2_glock_nq_init(get_v2ip(sdp->sd_jdesc->jd_inode)->i_gl, 439 error = gfs2_glock_nq_init(
440 get_v2ip(sdp->sd_jdesc->jd_inode)->i_gl,
439 LM_ST_SHARED, 441 LM_ST_SHARED,
440 LM_FLAG_NOEXP | GL_EXACT, 442 LM_FLAG_NOEXP | GL_EXACT,
441 &sdp->sd_jinode_gh); 443 &sdp->sd_jinode_gh);
diff --git a/fs/gfs2/ops_vm.c b/fs/gfs2/ops_vm.c
index 808110e3ec5e..bfeb920dccee 100644
--- a/fs/gfs2/ops_vm.c
+++ b/fs/gfs2/ops_vm.c
@@ -68,7 +68,8 @@ static int alloc_page_backing(struct gfs2_inode *ip, struct page *page)
68{ 68{
69 struct gfs2_sbd *sdp = ip->i_sbd; 69 struct gfs2_sbd *sdp = ip->i_sbd;
70 unsigned long index = page->index; 70 unsigned long index = page->index;
71 uint64_t lblock = index << (PAGE_CACHE_SHIFT - sdp->sd_sb.sb_bsize_shift); 71 uint64_t lblock = index << (PAGE_CACHE_SHIFT -
72 sdp->sd_sb.sb_bsize_shift);
72 unsigned int blocks = PAGE_CACHE_SIZE >> sdp->sd_sb.sb_bsize_shift; 73 unsigned int blocks = PAGE_CACHE_SIZE >> sdp->sd_sb.sb_bsize_shift;
73 struct gfs2_alloc *al; 74 struct gfs2_alloc *al;
74 unsigned int data_blocks, ind_blocks; 75 unsigned int data_blocks, ind_blocks;
@@ -143,7 +144,8 @@ static struct page *gfs2_sharewrite_nopage(struct vm_area_struct *area,
143 struct gfs2_inode *ip = get_v2ip(area->vm_file->f_mapping->host); 144 struct gfs2_inode *ip = get_v2ip(area->vm_file->f_mapping->host);
144 struct gfs2_holder i_gh; 145 struct gfs2_holder i_gh;
145 struct page *result = NULL; 146 struct page *result = NULL;
146 unsigned long index = ((address - area->vm_start) >> PAGE_CACHE_SHIFT) + area->vm_pgoff; 147 unsigned long index = ((address - area->vm_start) >> PAGE_CACHE_SHIFT) +
148 area->vm_pgoff;
147 int alloc_required; 149 int alloc_required;
148 int error; 150 int error;
149 151
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index c0352cf330a3..40c7cf87eb44 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -395,7 +395,8 @@ static int qd_trylock(struct gfs2_quota_data *qd)
395 395
396static void qd_unlock(struct gfs2_quota_data *qd) 396static void qd_unlock(struct gfs2_quota_data *qd)
397{ 397{
398 gfs2_assert_warn(qd->qd_gl->gl_sbd, test_bit(QDF_LOCKED, &qd->qd_flags)); 398 gfs2_assert_warn(qd->qd_gl->gl_sbd,
399 test_bit(QDF_LOCKED, &qd->qd_flags));
399 clear_bit(QDF_LOCKED, &qd->qd_flags); 400 clear_bit(QDF_LOCKED, &qd->qd_flags);
400 bh_put(qd); 401 bh_put(qd);
401 slot_put(qd); 402 slot_put(qd);
@@ -715,7 +716,8 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
715 qd = qda[x]; 716 qd = qda[x];
716 offset = qd2offset(qd); 717 offset = qd2offset(qd);
717 error = gfs2_adjust_quota(ip, offset, qd->qd_change_sync, 718 error = gfs2_adjust_quota(ip, offset, qd->qd_change_sync,
718 (struct gfs2_quota_data *)qd->qd_gl->gl_lvb); 719 (struct gfs2_quota_data *)
720 qd->qd_gl->gl_lvb);
719 if (error) 721 if (error)
720 goto out_end_trans; 722 goto out_end_trans;
721 723
@@ -932,7 +934,8 @@ static int print_message(struct gfs2_quota_data *qd, char *type)
932 if (!line) 934 if (!line)
933 return -ENOMEM; 935 return -ENOMEM;
934 936
935 len = snprintf(line, MAX_LINE-1, "GFS2: fsid=%s: quota %s for %s %u\r\n", 937 len = snprintf(line, MAX_LINE-1,
938 "GFS2: fsid=%s: quota %s for %s %u\r\n",
936 sdp->sd_fsname, type, 939 sdp->sd_fsname, type,
937 (test_bit(QDF_USER, &qd->qd_flags)) ? "user" : "group", 940 (test_bit(QDF_USER, &qd->qd_flags)) ? "user" : "group",
938 qd->qd_id); 941 qd->qd_id);
@@ -981,7 +984,8 @@ int gfs2_quota_check(struct gfs2_inode *ip, uint32_t uid, uint32_t gid)
981 } else if (qd->qd_qb.qb_warn && 984 } else if (qd->qd_qb.qb_warn &&
982 (int64_t)qd->qd_qb.qb_warn < value && 985 (int64_t)qd->qd_qb.qb_warn < value &&
983 time_after_eq(jiffies, qd->qd_last_warn + 986 time_after_eq(jiffies, qd->qd_last_warn +
984 gfs2_tune_get(sdp, gt_quota_warn_period) * HZ)) { 987 gfs2_tune_get(sdp,
988 gt_quota_warn_period) * HZ)) {
985 error = print_message(qd, "warning"); 989 error = print_message(qd, "warning");
986 qd->qd_last_warn = jiffies; 990 qd->qd_last_warn = jiffies;
987 } 991 }
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
index bcb81c768c8b..e5f2b284fa54 100644
--- a/fs/gfs2/recovery.c
+++ b/fs/gfs2/recovery.c
@@ -33,7 +33,8 @@ int gfs2_replay_read_block(struct gfs2_jdesc *jd, unsigned int blk,
33 uint32_t extlen; 33 uint32_t extlen;
34 int error; 34 int error;
35 35
36 error = gfs2_block_map(get_v2ip(jd->jd_inode), blk, &new, &dblock, &extlen); 36 error = gfs2_block_map(get_v2ip(jd->jd_inode), blk, &new, &dblock,
37 &extlen);
37 if (error) 38 if (error)
38 return error; 39 return error;
39 if (!dblock) { 40 if (!dblock) {
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 2e69e5cda967..9525b176f502 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -233,7 +233,8 @@ static int compute_bitstructs(struct gfs2_rgrpd *rgd)
233 bi->bi_len = bytes; 233 bi->bi_len = bytes;
234 /* other blocks */ 234 /* other blocks */
235 } else { 235 } else {
236 bytes = sdp->sd_sb.sb_bsize - sizeof(struct gfs2_meta_header); 236 bytes = sdp->sd_sb.sb_bsize -
237 sizeof(struct gfs2_meta_header);
237 bi->bi_offset = sizeof(struct gfs2_meta_header); 238 bi->bi_offset = sizeof(struct gfs2_meta_header);
238 bi->bi_start = rgd->rd_ri.ri_bitbytes - bytes_left; 239 bi->bi_start = rgd->rd_ri.ri_bitbytes - bytes_left;
239 bi->bi_len = bytes; 240 bi->bi_len = bytes;
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 60e266618729..2c1c6aa1c077 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -110,36 +110,43 @@ int gfs2_check_sb(struct gfs2_sbd *sdp, struct gfs2_sb *sb, int silent)
110 break; 110 break;
111 111
112 if (!gfs2_old_fs_formats[x]) { 112 if (!gfs2_old_fs_formats[x]) {
113 printk(KERN_WARNING "GFS2: code version (%u, %u) is incompatible " 113 printk(KERN_WARNING
114 "GFS2: code version (%u, %u) is incompatible "
114 "with ondisk format (%u, %u)\n", 115 "with ondisk format (%u, %u)\n",
115 GFS2_FORMAT_FS, GFS2_FORMAT_MULTI, 116 GFS2_FORMAT_FS, GFS2_FORMAT_MULTI,
116 sb->sb_fs_format, sb->sb_multihost_format); 117 sb->sb_fs_format, sb->sb_multihost_format);
117 printk(KERN_WARNING "GFS2: I don't know how to upgrade this FS\n"); 118 printk(KERN_WARNING
119 "GFS2: I don't know how to upgrade this FS\n");
118 return -EINVAL; 120 return -EINVAL;
119 } 121 }
120 } 122 }
121 123
122 if (sb->sb_multihost_format != GFS2_FORMAT_MULTI) { 124 if (sb->sb_multihost_format != GFS2_FORMAT_MULTI) {
123 for (x = 0; gfs2_old_multihost_formats[x]; x++) 125 for (x = 0; gfs2_old_multihost_formats[x]; x++)
124 if (gfs2_old_multihost_formats[x] == sb->sb_multihost_format) 126 if (gfs2_old_multihost_formats[x] ==
127 sb->sb_multihost_format)
125 break; 128 break;
126 129
127 if (!gfs2_old_multihost_formats[x]) { 130 if (!gfs2_old_multihost_formats[x]) {
128 printk(KERN_WARNING "GFS2: code version (%u, %u) is incompatible " 131 printk(KERN_WARNING
132 "GFS2: code version (%u, %u) is incompatible "
129 "with ondisk format (%u, %u)\n", 133 "with ondisk format (%u, %u)\n",
130 GFS2_FORMAT_FS, GFS2_FORMAT_MULTI, 134 GFS2_FORMAT_FS, GFS2_FORMAT_MULTI,
131 sb->sb_fs_format, sb->sb_multihost_format); 135 sb->sb_fs_format, sb->sb_multihost_format);
132 printk(KERN_WARNING "GFS2: I don't know how to upgrade this FS\n"); 136 printk(KERN_WARNING
137 "GFS2: I don't know how to upgrade this FS\n");
133 return -EINVAL; 138 return -EINVAL;
134 } 139 }
135 } 140 }
136 141
137 if (!sdp->sd_args.ar_upgrade) { 142 if (!sdp->sd_args.ar_upgrade) {
138 printk(KERN_WARNING "GFS2: code version (%u, %u) is incompatible " 143 printk(KERN_WARNING
144 "GFS2: code version (%u, %u) is incompatible "
139 "with ondisk format (%u, %u)\n", 145 "with ondisk format (%u, %u)\n",
140 GFS2_FORMAT_FS, GFS2_FORMAT_MULTI, 146 GFS2_FORMAT_FS, GFS2_FORMAT_MULTI,
141 sb->sb_fs_format, sb->sb_multihost_format); 147 sb->sb_fs_format, sb->sb_multihost_format);
142 printk(KERN_INFO "GFS2: Use the \"upgrade\" mount option to upgrade " 148 printk(KERN_INFO
149 "GFS2: Use the \"upgrade\" mount option to upgrade "
143 "the FS\n"); 150 "the FS\n");
144 printk(KERN_INFO "GFS2: See the manual for more details\n"); 151 printk(KERN_INFO "GFS2: See the manual for more details\n");
145 return -EINVAL; 152 return -EINVAL;
@@ -289,7 +296,8 @@ int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
289 296
290 name.len = sprintf(buf, "journal%u", sdp->sd_journals); 297 name.len = sprintf(buf, "journal%u", sdp->sd_journals);
291 298
292 error = gfs2_dir_search(get_v2ip(sdp->sd_jindex), &name, NULL, NULL); 299 error = gfs2_dir_search(get_v2ip(sdp->sd_jindex),
300 &name, NULL, NULL);
293 if (error == -ENOENT) { 301 if (error == -ENOENT) {
294 error = 0; 302 error = 0;
295 break; 303 break;
@@ -445,7 +453,8 @@ int gfs2_lookup_master_dir(struct gfs2_sbd *sdp)
445 sdp->sd_sb.sb_master_dir.no_addr, 453 sdp->sd_sb.sb_master_dir.no_addr,
446 &gfs2_inode_glops, CREATE, &gl); 454 &gfs2_inode_glops, CREATE, &gl);
447 if (!error) { 455 if (!error) {
448 error = gfs2_lookup_simple(sdp->sd_root_dir, ".gfs2_admin", &inode); 456 error = gfs2_lookup_simple(sdp->sd_root_dir, ".gfs2_admin",
457 &inode);
449 sdp->sd_master_dir = inode; 458 sdp->sd_master_dir = inode;
450 gfs2_glock_put(gl); 459 gfs2_glock_put(gl);
451 } 460 }
@@ -854,7 +863,8 @@ int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp, struct gfs2_holder *t_gh)
854 error = -ENOMEM; 863 error = -ENOMEM;
855 goto out; 864 goto out;
856 } 865 }
857 error = gfs2_glock_nq_init(get_v2ip(jd->jd_inode)->i_gl, LM_ST_SHARED, 0, 866 error = gfs2_glock_nq_init(get_v2ip(jd->jd_inode)->i_gl,
867 LM_ST_SHARED, 0,
858 &lfcc->gh); 868 &lfcc->gh);
859 if (error) { 869 if (error) {
860 kfree(lfcc); 870 kfree(lfcc);