[Cluster-devel] [GFS2 PATCH] GFS2: eliminate i_generation from memory
Hi, Since GFS2 doesn't rely upon generation numbers like GFS1, we do not need to copy the generation number into memory and out of memory. This patch eliminates the variable from the in-core structure and will reduce the memory requirements of GFS2. Regards, Bob Peterson Red Hat File Systems Signed-off-by: Bob Peterson rpete...@redhat.com -- diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 870a89d..2329296 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -272,7 +272,6 @@ struct gfs2_inode { struct inode i_inode; u64 i_no_addr; u64 i_no_formal_ino; - u64 i_generation; u64 i_eattr; unsigned long i_flags; /* GIF_... */ struct gfs2_glock *i_gl; /* Move into i_gh? */ diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 97d54a2..b4e416a 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -261,7 +261,6 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) ip-i_inode.i_ctime.tv_nsec = be32_to_cpu(str-di_ctime_nsec); ip-i_goal = be64_to_cpu(str-di_goal_meta); - ip-i_generation = be64_to_cpu(str-di_generation); ip-i_diskflags = be32_to_cpu(str-di_flags); gfs2_set_inode_flags(ip-i_inode); @@ -626,7 +625,6 @@ static void init_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl, di-di_major = cpu_to_be32(MAJOR(dev)); di-di_minor = cpu_to_be32(MINOR(dev)); di-di_goal_meta = di-di_goal_data = cpu_to_be64(inum-no_addr); - di-di_generation = cpu_to_be64(*generation); di-di_flags = 0; if (S_ISREG(mode)) { @@ -944,7 +942,6 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) str-di_goal_meta = cpu_to_be64(ip-i_goal); str-di_goal_data = cpu_to_be64(ip-i_goal); - str-di_generation = cpu_to_be64(ip-i_generation); str-di_flags = cpu_to_be32(ip-i_diskflags); str-di_height = cpu_to_be16(ip-i_height);
Re: [Cluster-devel] [GFS2 PATCH] GFS2: eliminate i_generation from memory
Hi, We still need that, it is the generation number for NFS. Although it is also identical to the no_formal_ino in recent kernels, Steve. On Wed, 2011-03-23 at 09:37 -0400, Bob Peterson wrote: Hi, Since GFS2 doesn't rely upon generation numbers like GFS1, we do not need to copy the generation number into memory and out of memory. This patch eliminates the variable from the in-core structure and will reduce the memory requirements of GFS2. Regards, Bob Peterson Red Hat File Systems Signed-off-by: Bob Peterson rpete...@redhat.com -- diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 870a89d..2329296 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -272,7 +272,6 @@ struct gfs2_inode { struct inode i_inode; u64 i_no_addr; u64 i_no_formal_ino; - u64 i_generation; u64 i_eattr; unsigned long i_flags; /* GIF_... */ struct gfs2_glock *i_gl; /* Move into i_gh? */ diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 97d54a2..b4e416a 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -261,7 +261,6 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) ip-i_inode.i_ctime.tv_nsec = be32_to_cpu(str-di_ctime_nsec); ip-i_goal = be64_to_cpu(str-di_goal_meta); - ip-i_generation = be64_to_cpu(str-di_generation); ip-i_diskflags = be32_to_cpu(str-di_flags); gfs2_set_inode_flags(ip-i_inode); @@ -626,7 +625,6 @@ static void init_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl, di-di_major = cpu_to_be32(MAJOR(dev)); di-di_minor = cpu_to_be32(MINOR(dev)); di-di_goal_meta = di-di_goal_data = cpu_to_be64(inum-no_addr); - di-di_generation = cpu_to_be64(*generation); di-di_flags = 0; if (S_ISREG(mode)) { @@ -944,7 +942,6 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) str-di_goal_meta = cpu_to_be64(ip-i_goal); str-di_goal_data = cpu_to_be64(ip-i_goal); - str-di_generation = cpu_to_be64(ip-i_generation); str-di_flags = cpu_to_be32(ip-i_diskflags); str-di_height = cpu_to_be16(ip-i_height);
Re: [Cluster-devel] [GFS2 PATCH] GFS2: eliminate i_generation from memory
Hi, On Wed, 2011-03-23 at 09:55 -0400, Bob Peterson wrote: - Original Message - | Hi, | | We still need that, it is the generation number for NFS. Although it | is | also identical to the no_formal_ino in recent kernels, | | Steve. Are you saying that nfs manipulates gfs2's i_generation value in the incore gfs2_inode structure? If so, that scares me; there should be an interface to do that. If not, it must be for some future development, because we don't reference the value anywhere. Regards, Bob Peterson Red Hat File Systems It is identical to the no_formal_ino in all recent kernels and we use that value for NFS generation number purposes. Really we should be using this value and not the no_formal_ino one, but the switch didn't get made when the original change was made. Both values are identical, except for very old versions of the code. I think we should retain this field though, since it can be useful for debugging, Steve.