From: Steve Lord Date: Wed, 6 Aug 2003 21:17:06 +0000 (+0000) Subject: Add versioning to the on disk inode which we increment on each X-Git-Tag: v2.6.0~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec783255f293cbcad0793064413ed89974b29d29;p=thirdparty%2Fxfsprogs-dev.git Add versioning to the on disk inode which we increment on each flush call. This is used during recovery to avoid replaying an older copy of the inode from the log. We can do this without versioning the filesystem as the pad space we borrowed was always zero and will be ignored by old kernels. Print out the new inode field --- diff --git a/db/inode.c b/db/inode.c index fa1e4ec5e..e69e39c26 100644 --- a/db/inode.c +++ b/db/inode.c @@ -99,6 +99,7 @@ const field_t inode_core_flds[] = { FLD_COUNT, TYP_NONE }, { "uid", FLDT_UINT32D, OI(COFF(uid)), C1, 0, TYP_NONE }, { "gid", FLDT_UINT32D, OI(COFF(gid)), C1, 0, TYP_NONE }, + { "flushiter", FLDT_UINT16D, OI(COFF(flushiter)), C1, 0, TYP_NONE }, { "atime", FLDT_TIMESTAMP, OI(COFF(atime)), C1, 0, TYP_NONE }, { "mtime", FLDT_TIMESTAMP, OI(COFF(mtime)), C1, 0, TYP_NONE }, { "ctime", FLDT_TIMESTAMP, OI(COFF(ctime)), C1, 0, TYP_NONE }, diff --git a/include/xfs_dinode.h b/include/xfs_dinode.h index 89bd040b4..0af61bc72 100644 --- a/include/xfs_dinode.h +++ b/include/xfs_dinode.h @@ -72,7 +72,8 @@ typedef struct xfs_dinode_core __uint32_t di_gid; /* owner's group id */ __uint32_t di_nlink; /* number of links to file */ __uint16_t di_projid; /* owner's project id */ - __uint8_t di_pad[10]; /* unused, zeroed space */ + __uint8_t di_pad[8]; /* unused, zeroed space */ + __uint16_t di_flushiter; /* incremented on flush */ xfs_timestamp_t di_atime; /* time last accessed */ xfs_timestamp_t di_mtime; /* time last modified */ xfs_timestamp_t di_ctime; /* time created/inode modified */ @@ -89,6 +90,8 @@ typedef struct xfs_dinode_core __uint32_t di_gen; /* generation number */ } xfs_dinode_core_t; +#define DI_MAX_FLUSH 0xffff + typedef struct xfs_dinode { xfs_dinode_core_t di_core; diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c index 7e47fe71a..850b1c05d 100644 --- a/logprint/log_print_all.c +++ b/logprint/log_print_all.c @@ -274,6 +274,7 @@ xlog_recover_print_inode_core( di->di_uid, di->di_gid, di->di_nlink, (uint)di->di_projid); printf(" atime:%d mtime:%d ctime:%d\n", di->di_atime.t_sec, di->di_mtime.t_sec, di->di_ctime.t_sec); + printf(" flushiter:%d\n", di->di_flushiter); printf(" size:0x%llx nblks:0x%llx exsize:%d " "nextents:%d anextents:%d\n", (unsigned long long) di->di_size, (unsigned long long)di->di_nblocks,