diff options
author | Andrew Price <anprice@redhat.com> | 2017-12-12 11:40:05 -0600 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2017-12-12 11:43:36 -0600 |
commit | 166725d96322473305e35f9d580591a01697ab29 (patch) | |
tree | 4648063f93f787811392d995736b6672c0d6b2ef /fs | |
parent | 65adc27375a85beb57c3869cedb2a410fad9c288 (diff) | |
download | linux-stable-166725d96322473305e35f9d580591a01697ab29.tar.gz linux-stable-166725d96322473305e35f9d580591a01697ab29.tar.bz2 linux-stable-166725d96322473305e35f9d580591a01697ab29.zip |
gfs2: Add rindex fields to rgrp headers
Add rg_data0, rg_data and rg_bitbytes to struct gfs2_rgrp. The fields
are identical to their counterparts in struct gfs2_rindex and are
intended to reduce the use of the rindex. For now the fields are only
written back as the in-memory equivalents in struct gfs2_rgrpd are set
using values from the rindex. However, they are needed at this point so
that userspace can make use of them, allowing a migration away from the
rindex over time.
The new fields take up previously reserved space which was explicitly
zeroed on write so, in clusters with mixed kernels, these fields could
get zeroed after being set and this should not be treated as an error.
Signed-off-by: Andrew Price <anprice@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/rgrp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index be2fc26029e4..a9184903a9f5 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -1040,6 +1040,7 @@ static void gfs2_rgrp_in(struct gfs2_rgrpd *rgd, const void *buf) rgd->rd_free = be32_to_cpu(str->rg_free); rgd->rd_dinodes = be32_to_cpu(str->rg_dinodes); rgd->rd_igeneration = be64_to_cpu(str->rg_igeneration); + /* rd_data0, rd_data and rd_bitbytes already set from rindex */ } static void gfs2_rgrp_out(struct gfs2_rgrpd *rgd, void *buf) @@ -1055,6 +1056,10 @@ static void gfs2_rgrp_out(struct gfs2_rgrpd *rgd, void *buf) else if (next->rd_addr > rgd->rd_addr) str->rg_skip = cpu_to_be32(next->rd_addr - rgd->rd_addr); str->rg_igeneration = cpu_to_be64(rgd->rd_igeneration); + str->rg_data0 = cpu_to_be64(rgd->rd_data0); + str->rg_data = cpu_to_be32(rgd->rd_data); + str->rg_bitbytes = cpu_to_be32(rgd->rd_bitbytes); + memset(&str->rg_reserved, 0, sizeof(str->rg_reserved)); } |