Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Cluster Development (http://www.linux-archive.org/cluster-development/)
-   -   GFS2: Add structure to contain rgrp, bitmap, offset tuple (http://www.linux-archive.org/cluster-development/690297-gfs2-add-structure-contain-rgrp-bitmap-offset-tuple.html)

Steven Whitehouse 08-03-2012 02:10 PM

GFS2: Add structure to contain rgrp, bitmap, offset tuple
 
Hi,

On Fri, 2012-08-03 at 10:08 -0400, Bob Peterson wrote:
> ----- Original Message -----
> |
> | This patch introduces a new structure, gfs2_rbm, which is a
> | tuple of a resource group, a bitmap within the resource group
> | and an offset within that bitmap. This is designed to make
> | manipulating these sets of variables easier. There is also a
> | new helper function which converts this representation back
> | to a disk block address.
> |
> | In addition, the rbtree nodes which are used for the reservations
> | were not being correctly initialised, which is now fixed. Also,
> | the tracing was not passing through the inode where it should
> | have been. That is mostly fixed aside from one corner case. This
> | needs to be revisited since there can also be a NULL rgrp in
> | some cases which results in the device being incorrect in the
> | trace.
> |
> | This is intended to be the first step towards cleaning up some
> | of the allocation code, and some further bug fixes.
> |
> | Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
> (snip)
> | diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
> | index a2b43bb..eaa4188 100644
> | --- a/fs/gfs2/rgrp.c
> | +++ b/fs/gfs2/rgrp.c
> (snip)
> | @@ -499,8 +501,8 @@ int gfs2_rs_alloc(struct gfs2_inode *ip)
> | static void dump_rs(struct seq_file *seq, struct gfs2_blkreserv *rs)
> | {
> | gfs2_print_dbg(seq, " r: %llu s:%llu b:%u f:%u
",
> | - rs->rs_rgd->rd_addr, gfs2_rs_startblk(rs), rs->rs_biblk,
> | - rs->rs_free);
> | + rs->rs_rbm.rgd->rd_addr, gfs2_rbm_to_block(&rs->rs_rbm),
>
> Hm, just fyi: When I copied the patch, I see an extra space (resulting in a
> whitespace warning from git) at the end of this last line. On my reply, I don't
> see it, so I'm not sure what's going on there.
>
> Regards,
>
> Bob Peterson
> Red Hat File Systems

Looks like there is a space there in my git tree. I'll fix that in the
next patch. I wonder why git didn't warn me....

Steve.

Andrew Price 08-03-2012 03:06 PM

GFS2: Add structure to contain rgrp, bitmap, offset tuple
 
On 08/03/2012 03:10 PM, Steven Whitehouse wrote:

Looks like there is a space there in my git tree. I'll fix that in the
next patch. I wonder why git didn't warn me....


By default git only warns about trailing whitespace when you're applying
a patch. If you do:


$ cp .git/hooks/pre-commit.sample .git/hooks/pre-commit

Then it'll warn on commit, too:

$ git commit -a
gfs2/mkfs/main_mkfs.c:209: trailing whitespace.
+ strncpy(sdp->device_name, argv[optind++], PATH_MAX - 1);

Andy


All times are GMT. The time now is 05:58 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.