Skip to content

Commit

Permalink
[GFS2] Don't copy meta_header for rgrp in and out
Browse files Browse the repository at this point in the history
The meta_header for an ondisk rgrp never changes, so there is no point
copying it in and back out to disk. Also there is no reason to keep
a copy for each rgrp in memory.

The code already checks to ensure that the header is correct before
it calls the routine to copy the data in, so that we don't even need
to check whether its correct on disk in the functions in ondisk.c

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Steven Whitehouse committed Nov 30, 2006
1 parent 294caaa commit f6e58f0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
11 changes: 0 additions & 11 deletions fs/gfs2/ondisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@ static void gfs2_meta_header_in(struct gfs2_meta_header_host *mh, const void *bu
mh->mh_format = be32_to_cpu(str->mh_format);
}

static void gfs2_meta_header_out(const struct gfs2_meta_header_host *mh, void *buf)
{
struct gfs2_meta_header *str = buf;

str->mh_magic = cpu_to_be32(mh->mh_magic);
str->mh_type = cpu_to_be32(mh->mh_type);
str->mh_format = cpu_to_be32(mh->mh_format);
}

void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf)
{
const struct gfs2_sb *str = buf;
Expand Down Expand Up @@ -119,7 +110,6 @@ void gfs2_rgrp_in(struct gfs2_rgrp_host *rg, const void *buf)
{
const struct gfs2_rgrp *str = buf;

gfs2_meta_header_in(&rg->rg_header, buf);
rg->rg_flags = be32_to_cpu(str->rg_flags);
rg->rg_free = be32_to_cpu(str->rg_free);
rg->rg_dinodes = be32_to_cpu(str->rg_dinodes);
Expand All @@ -130,7 +120,6 @@ void gfs2_rgrp_out(const struct gfs2_rgrp_host *rg, void *buf)
{
struct gfs2_rgrp *str = buf;

gfs2_meta_header_out(&rg->rg_header, buf);
str->rg_flags = cpu_to_be32(rg->rg_flags);
str->rg_free = cpu_to_be32(rg->rg_free);
str->rg_dinodes = cpu_to_be32(rg->rg_dinodes);
Expand Down
2 changes: 0 additions & 2 deletions include/linux/gfs2_ondisk.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ struct gfs2_rgrp {
};

struct gfs2_rgrp_host {
struct gfs2_meta_header_host rg_header;

__u32 rg_flags;
__u32 rg_free;
__u32 rg_dinodes;
Expand Down

0 comments on commit f6e58f0

Please sign in to comment.