Pārlūkot izejas kodu

GFS2: Move generation number into "proper" part of inode

This moves the generation number from the gfs2_dinode_host
into the gfs2_inode structure. Eventually the plan is to get
rid of the gfs2_dinode_host structure completely.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Steven Whitehouse 16 gadi atpakaļ
vecāks
revīzija
bcf0b5b348
2 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 1 1
      fs/gfs2/incore.h
  2. 2 2
      fs/gfs2/inode.c

+ 1 - 1
fs/gfs2/incore.h

@@ -235,7 +235,6 @@ enum {
 
 
 struct gfs2_dinode_host {
 struct gfs2_dinode_host {
 	u64 di_size;		/* number of bytes in file */
 	u64 di_size;		/* number of bytes in file */
-	u64 di_generation;	/* generation number for NFS */
 	u32 di_flags;		/* GFS2_DIF_... */
 	u32 di_flags;		/* GFS2_DIF_... */
 	/* These only apply to directories  */
 	/* These only apply to directories  */
 	u32 di_entries;		/* The number of entries in the directory */
 	u32 di_entries;		/* The number of entries in the directory */
@@ -246,6 +245,7 @@ struct gfs2_inode {
 	struct inode i_inode;
 	struct inode i_inode;
 	u64 i_no_addr;
 	u64 i_no_addr;
 	u64 i_no_formal_ino;
 	u64 i_no_formal_ino;
+	u64 i_generation;
 	unsigned long i_flags;		/* GIF_... */
 	unsigned long i_flags;		/* GIF_... */
 
 
 	struct gfs2_dinode_host i_di; /* To be replaced by ref to block */
 	struct gfs2_dinode_host i_di; /* To be replaced by ref to block */

+ 2 - 2
fs/gfs2/inode.c

@@ -286,7 +286,7 @@ 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_inode.i_ctime.tv_nsec = be32_to_cpu(str->di_ctime_nsec);
 
 
 	ip->i_goal = be64_to_cpu(str->di_goal_meta);
 	ip->i_goal = be64_to_cpu(str->di_goal_meta);
-	di->di_generation = be64_to_cpu(str->di_generation);
+	ip->i_generation = be64_to_cpu(str->di_generation);
 
 
 	di->di_flags = be32_to_cpu(str->di_flags);
 	di->di_flags = be32_to_cpu(str->di_flags);
 	gfs2_set_inode_flags(&ip->i_inode);
 	gfs2_set_inode_flags(&ip->i_inode);
@@ -1263,7 +1263,7 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf)
 
 
 	str->di_goal_meta = cpu_to_be64(ip->i_goal);
 	str->di_goal_meta = cpu_to_be64(ip->i_goal);
 	str->di_goal_data = cpu_to_be64(ip->i_goal);
 	str->di_goal_data = cpu_to_be64(ip->i_goal);
-	str->di_generation = cpu_to_be64(di->di_generation);
+	str->di_generation = cpu_to_be64(ip->i_generation);
 
 
 	str->di_flags = cpu_to_be32(di->di_flags);
 	str->di_flags = cpu_to_be32(di->di_flags);
 	str->di_height = cpu_to_be16(ip->i_height);
 	str->di_height = cpu_to_be16(ip->i_height);