diff options
Diffstat (limited to 'include/linux/jbd2.h')
| -rw-r--r-- | include/linux/jbd2.h | 42 | 
1 files changed, 21 insertions, 21 deletions
| diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index f619bae1dcc5..d860499e15e4 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -265,8 +265,10 @@ typedef struct journal_superblock_s  	__u8	s_padding2[3];  /* 0x0054 */  	__be32	s_num_fc_blks;		/* Number of fast commit blocks */ -/* 0x0058 */ -	__u32	s_padding[41]; +	__be32	s_head;			/* blocknr of head of log, only uptodate +					 * while the filesystem is clean */ +/* 0x005C */ +	__u32	s_padding[40];  	__be32	s_checksum;		/* crc32c(superblock) */  /* 0x0100 */ @@ -274,17 +276,6 @@ typedef struct journal_superblock_s  /* 0x0400 */  } journal_superblock_t; -/* Use the jbd2_{has,set,clear}_feature_* helpers; these will be removed */ -#define JBD2_HAS_COMPAT_FEATURE(j,mask)					\ -	((j)->j_format_version >= 2 &&					\ -	 ((j)->j_superblock->s_feature_compat & cpu_to_be32((mask)))) -#define JBD2_HAS_RO_COMPAT_FEATURE(j,mask)				\ -	((j)->j_format_version >= 2 &&					\ -	 ((j)->j_superblock->s_feature_ro_compat & cpu_to_be32((mask)))) -#define JBD2_HAS_INCOMPAT_FEATURE(j,mask)				\ -	((j)->j_format_version >= 2 &&					\ -	 ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask)))) -  #define JBD2_FEATURE_COMPAT_CHECKSUM		0x00000001  #define JBD2_FEATURE_INCOMPAT_REVOKE		0x00000001 @@ -804,11 +795,6 @@ struct journal_s  	journal_superblock_t	*j_superblock;  	/** -	 * @j_format_version: Version of the superblock format. -	 */ -	int			j_format_version; - -	/**  	 * @j_state_lock: Protect the various scalars in the journal.  	 */  	rwlock_t		j_state_lock; @@ -1324,11 +1310,22 @@ struct journal_s  		rwsem_release(&j->j_trans_commit_map, _THIS_IP_); \  	} while (0) +/* + * We can support any known requested features iff the + * superblock is not in version 1.  Otherwise we fail to support any + * extended sb features. + */ +static inline bool jbd2_format_support_feature(journal_t *j) +{ +	return j->j_superblock->s_header.h_blocktype != +					cpu_to_be32(JBD2_SUPERBLOCK_V1); +} +  /* journal feature predicate functions */  #define JBD2_FEATURE_COMPAT_FUNCS(name, flagname) \  static inline bool jbd2_has_feature_##name(journal_t *j) \  { \ -	return ((j)->j_format_version >= 2 && \ +	return (jbd2_format_support_feature(j) && \  		((j)->j_superblock->s_feature_compat & \  		 cpu_to_be32(JBD2_FEATURE_COMPAT_##flagname)) != 0); \  } \ @@ -1346,7 +1343,7 @@ static inline void jbd2_clear_feature_##name(journal_t *j) \  #define JBD2_FEATURE_RO_COMPAT_FUNCS(name, flagname) \  static inline bool jbd2_has_feature_##name(journal_t *j) \  { \ -	return ((j)->j_format_version >= 2 && \ +	return (jbd2_format_support_feature(j) && \  		((j)->j_superblock->s_feature_ro_compat & \  		 cpu_to_be32(JBD2_FEATURE_RO_COMPAT_##flagname)) != 0); \  } \ @@ -1364,7 +1361,7 @@ static inline void jbd2_clear_feature_##name(journal_t *j) \  #define JBD2_FEATURE_INCOMPAT_FUNCS(name, flagname) \  static inline bool jbd2_has_feature_##name(journal_t *j) \  { \ -	return ((j)->j_format_version >= 2 && \ +	return (jbd2_format_support_feature(j) && \  		((j)->j_superblock->s_feature_incompat & \  		 cpu_to_be32(JBD2_FEATURE_INCOMPAT_##flagname)) != 0); \  } \ @@ -1400,6 +1397,9 @@ JBD2_FEATURE_INCOMPAT_FUNCS(fast_commit,	FAST_COMMIT)  #define JBD2_ABORT_ON_SYNCDATA_ERR	0x040	/* Abort the journal on file  						 * data write error in ordered  						 * mode */ +#define JBD2_CYCLE_RECORD		0x080	/* Journal cycled record log on +						 * clean and empty filesystem +						 * logging area */  #define JBD2_FAST_COMMIT_ONGOING	0x100	/* Fast commit is ongoing */  #define JBD2_FULL_COMMIT_ONGOING	0x200	/* Full commit is ongoing */  #define JBD2_JOURNAL_FLUSH_DISCARD	0x0001 |