Commit cd81a4bac67d44742ab0aa1848f4a78e9d7e1093

Authored by Robert Peterson
Committed by Steven Whitehouse
1 parent 0507ecf50f

[GFS2] Addendum patch 2 for gfs2_grow

This addendum patch 2 corrects three things:

1. It fixes a stupid mistake in the previous addendum that broke gfs2.
   Ref: https://www.redhat.com/archives/cluster-devel/2007-May/msg00162.html
2. It fixes a problem that Dave Teigland pointed out regarding the
   external declarations in ops_address.h being in the wrong place.
3. It recasts a couple more %llu printks to (unsigned long long)
   as requested by Steve Whitehouse.

I would have loved to put this all in one revised patch, but there was
a rush to get some patches for RHEL5.	Therefore, the previous patches
were applied to the git tree "as is" and therefore, I'm posting another
addendum.  Sorry.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

Showing 5 changed files with 9 additions and 9 deletions Side-by-side Diff

... ... @@ -1823,7 +1823,8 @@
1823 1823  
1824 1824 print_dbg(gi, " Inode:\n");
1825 1825 print_dbg(gi, " num = %llu/%llu\n",
1826   - ip->i_num.no_formal_ino, ip->i_num.no_addr);
  1826 + (unsigned long long)ip->i_num.no_formal_ino,
  1827 + (unsigned long long)ip->i_num.no_addr);
1827 1828 print_dbg(gi, " type = %u\n", IF2DT(ip->i_inode.i_mode));
1828 1829 print_dbg(gi, " i_flags =");
1829 1830 for (x = 0; x < 32; x++)
... ... @@ -1909,8 +1910,8 @@
1909 1910 }
1910 1911 if (test_bit(GLF_DEMOTE, &gl->gl_flags)) {
1911 1912 print_dbg(gi, " Demotion req to state %u (%llu uS ago)\n",
1912   - gl->gl_demote_state,
1913   - (u64)(jiffies - gl->gl_demote_time)*(1000000/HZ));
  1913 + gl->gl_demote_state, (unsigned long long)
  1914 + (jiffies - gl->gl_demote_time)*(1000000/HZ));
1914 1915 }
1915 1916 if (gl->gl_ops == &gfs2_inode_glops && gl->gl_object) {
1916 1917 if (!test_bit(GLF_LOCK, &gl->gl_flags) &&
fs/gfs2/ops_address.c
... ... @@ -32,6 +32,7 @@
32 32 #include "trans.h"
33 33 #include "rgrp.h"
34 34 #include "ops_file.h"
  35 +#include "super.h"
35 36 #include "util.h"
36 37 #include "glops.h"
37 38  
fs/gfs2/ops_address.h
... ... @@ -18,9 +18,6 @@
18 18 extern int gfs2_get_block(struct inode *inode, sector_t lblock,
19 19 struct buffer_head *bh_result, int create);
20 20 extern int gfs2_releasepage(struct page *page, gfp_t gfp_mask);
21   -extern u64 gfs2_ri_total(struct gfs2_sbd *sdp);
22   -extern void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
23   - s64 dinodes);
24 21  
25 22 #endif /* __OPS_ADDRESS_DOT_H__ */
... ... @@ -527,10 +527,10 @@
527 527 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
528 528 struct inode *inode = &ip->i_inode;
529 529 struct file_ra_state ra_state;
530   - u64 junk = ip->i_di.di_size;
  530 + u64 rgrp_count = ip->i_di.di_size;
531 531 int error;
532 532  
533   - if (do_div(junk, sizeof(struct gfs2_rindex))) {
  533 + if (do_div(rgrp_count, sizeof(struct gfs2_rindex))) {
534 534 gfs2_consist_inode(ip);
535 535 return -EIO;
536 536 }
... ... @@ -538,7 +538,7 @@
538 538 clear_rgrpdi(sdp);
539 539  
540 540 file_ra_state_init(&ra_state, inode->i_mapping);
541   - for (sdp->sd_rgrps = 0;; sdp->sd_rgrps++) {
  541 + for (sdp->sd_rgrps = 0; sdp->sd_rgrps < rgrp_count; sdp->sd_rgrps++) {
542 542 error = read_rindex_entry(ip, &ra_state);
543 543 if (error) {
544 544 clear_rgrpdi(sdp);
... ... @@ -65,6 +65,7 @@
65 65 void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist, unsigned int state,
66 66 int flags);
67 67 void gfs2_rlist_free(struct gfs2_rgrp_list *rlist);
  68 +u64 gfs2_ri_total(struct gfs2_sbd *sdp);
68 69  
69 70 #endif /* __RGRP_DOT_H__ */