Skip to contentSkip to conversation

GFS2: eliminate i_generation from memory

PATCH New Bob Peterson 2 participants 4 messages Mar 23, 2011 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

--

fs/gfs2/incore.h +0 -1
index 870a89d..2329296 100644
@@ -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? */
fs/gfs2/inode.c +0 -3
index 97d54a2..b4e416a 100644
@@ -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);
#1 lore raw

PATCH 1/1 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.

Quoted 55 lines · Bob Peterson

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

--

fs/gfs2/incore.h +0 -1
index 870a89d..2329296 100644
@@ -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? */
fs/gfs2/inode.c +0 -3
index 97d54a2..b4e416a 100644
@@ -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);
#2 lore raw

PATCH 1/1 GFS2: eliminate i_generation from memory

----- 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

#3 lore raw

PATCH 1/1 GFS2: eliminate i_generation from memory

Hi,

Quoted 14 lines · Bob Peterson

----- 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.

Quoted 4 lines

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.