public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: xfs@oss.sgi.com
Subject: Re: [PATCH 01/49] xfs: separate out log format definitions
Date: Tue, 23 Jul 2013 10:00:36 -0400	[thread overview]
Message-ID: <51EE8C84.70507@redhat.com> (raw)
In-Reply-To: <1374215120-7271-2-git-send-email-david@fromorbit.com>

On 07/19/2013 02:24 AM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> The on-disk format definitions for the log are spread randoms
> through a couple of header files. Consolidate it all in a single
> file that can be shared easily with userspace. This means that
> xfs_log.h and xfs_log_priv.h no longer need to be shared with
> userspace.
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_log.h         |  89 ++++++------------------
>  fs/xfs/xfs_log_format.h  | 178 +++++++++++++++++++++++++++++++++++++++++++++++
>  fs/xfs/xfs_log_priv.h    | 146 ++------------------------------------
>  fs/xfs/xfs_log_recover.c |   2 +
>  4 files changed, 207 insertions(+), 208 deletions(-)
>  create mode 100644 fs/xfs/xfs_log_format.h
> 
> diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h
> index fb630e4..e63d9e1 100644
> --- a/fs/xfs/xfs_log.h
> +++ b/fs/xfs/xfs_log.h
> @@ -18,14 +18,29 @@
>  #ifndef	__XFS_LOG_H__
>  #define __XFS_LOG_H__
>  
> -/* get lsn fields */
> -#define CYCLE_LSN(lsn) ((uint)((lsn)>>32))
> -#define BLOCK_LSN(lsn) ((uint)(lsn))
> +#include "xfs_log_format.h"
>  
> -/* this is used in a spot where we might otherwise double-endian-flip */
> -#define CYCLE_LSN_DISK(lsn) (((__be32 *)&(lsn))[0])
> +struct xfs_log_vec {
> +	struct xfs_log_vec	*lv_next;	/* next lv in build list */
> +	int			lv_niovecs;	/* number of iovecs in lv */
> +	struct xfs_log_iovec	*lv_iovecp;	/* iovec array */
> +	struct xfs_log_item	*lv_item;	/* owner */
> +	char			*lv_buf;	/* formatted buffer */
> +	int			lv_buf_len;	/* size of formatted buffer */
> +};
> +
> +#define XFS_LOG_VEC_ORDERED	(-1)
> +
> +/*
> + * Structure used to pass callback function and the function's argument
> + * to the log manager.
> + */
> +typedef struct xfs_log_callback {
> +	struct xfs_log_callback	*cb_next;
> +	void			(*cb_func)(void *, int);
> +	void			*cb_arg;
> +} xfs_log_callback_t;
>  
> -#ifdef __KERNEL__
>  /*
>   * By comparing each component, we don't have to worry about extra
>   * endian issues in treating two 32 bit numbers as one 64 bit number
> @@ -59,67 +74,6 @@ static inline xfs_lsn_t	_lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2)
>   */
>  #define XFS_LOG_SYNC		0x1
>  
> -#endif	/* __KERNEL__ */
> -
> -
> -/* Log Clients */
> -#define XFS_TRANSACTION		0x69
> -#define XFS_VOLUME		0x2
> -#define XFS_LOG			0xaa
> -
> -
> -/* Region types for iovec's i_type */
> -#define XLOG_REG_TYPE_BFORMAT		1
> -#define XLOG_REG_TYPE_BCHUNK		2
> -#define XLOG_REG_TYPE_EFI_FORMAT	3
> -#define XLOG_REG_TYPE_EFD_FORMAT	4
> -#define XLOG_REG_TYPE_IFORMAT		5
> -#define XLOG_REG_TYPE_ICORE		6
> -#define XLOG_REG_TYPE_IEXT		7
> -#define XLOG_REG_TYPE_IBROOT		8
> -#define XLOG_REG_TYPE_ILOCAL		9
> -#define XLOG_REG_TYPE_IATTR_EXT		10
> -#define XLOG_REG_TYPE_IATTR_BROOT	11
> -#define XLOG_REG_TYPE_IATTR_LOCAL	12
> -#define XLOG_REG_TYPE_QFORMAT		13
> -#define XLOG_REG_TYPE_DQUOT		14
> -#define XLOG_REG_TYPE_QUOTAOFF		15
> -#define XLOG_REG_TYPE_LRHEADER		16
> -#define XLOG_REG_TYPE_UNMOUNT		17
> -#define XLOG_REG_TYPE_COMMIT		18
> -#define XLOG_REG_TYPE_TRANSHDR		19
> -#define XLOG_REG_TYPE_ICREATE		20
> -#define XLOG_REG_TYPE_MAX		20
> -
> -typedef struct xfs_log_iovec {
> -	void		*i_addr;	/* beginning address of region */
> -	int		i_len;		/* length in bytes of region */
> -	uint		i_type;		/* type of region */
> -} xfs_log_iovec_t;
> -
> -struct xfs_log_vec {
> -	struct xfs_log_vec	*lv_next;	/* next lv in build list */
> -	int			lv_niovecs;	/* number of iovecs in lv */
> -	struct xfs_log_iovec	*lv_iovecp;	/* iovec array */
> -	struct xfs_log_item	*lv_item;	/* owner */
> -	char			*lv_buf;	/* formatted buffer */
> -	int			lv_buf_len;	/* size of formatted buffer */
> -};
> -
> -#define XFS_LOG_VEC_ORDERED	(-1)
> -
> -/*
> - * Structure used to pass callback function and the function's argument
> - * to the log manager.
> - */
> -typedef struct xfs_log_callback {
> -	struct xfs_log_callback	*cb_next;
> -	void			(*cb_func)(void *, int);
> -	void			*cb_arg;
> -} xfs_log_callback_t;
> -
> -
> -#ifdef __KERNEL__
>  /* Log manager interfaces */
>  struct xfs_mount;
>  struct xlog_in_core;
> @@ -188,5 +142,4 @@ void	xfs_log_work_queue(struct xfs_mount *mp);
>  void	xfs_log_worker(struct work_struct *work);
>  void	xfs_log_quiesce(struct xfs_mount *mp);
>  
> -#endif
>  #endif	/* __XFS_LOG_H__ */
> diff --git a/fs/xfs/xfs_log_format.h b/fs/xfs/xfs_log_format.h
> new file mode 100644
> index 0000000..9f9aeb6
> --- /dev/null
> +++ b/fs/xfs/xfs_log_format.h
> @@ -0,0 +1,178 @@
> +/*
> + * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
> + * All Rights Reserved.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it would be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write the Free Software Foundation,
> + * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> + */
> +#ifndef	__XFS_LOG_FORMAT_H__
> +#define __XFS_LOG_FORMAT_H__
> +
> +typedef __uint32_t xlog_tid_t;
> +
> +#define XLOG_MIN_ICLOGS		2
> +#define XLOG_MAX_ICLOGS		8
> +#define XLOG_HEADER_MAGIC_NUM	0xFEEDbabe	/* Invalid cycle number */
> +#define XLOG_VERSION_1		1
> +#define XLOG_VERSION_2		2		/* Large IClogs, Log sunit */
> +#define XLOG_VERSION_OKBITS	(XLOG_VERSION_1 | XLOG_VERSION_2)
> +#define XLOG_MIN_RECORD_BSIZE	(16*1024)	/* eventually 32k */
> +#define XLOG_BIG_RECORD_BSIZE	(32*1024)	/* 32k buffers */
> +#define XLOG_MAX_RECORD_BSIZE	(256*1024)
> +#define XLOG_HEADER_CYCLE_SIZE	(32*1024)	/* cycle data in header */
> +#define XLOG_MIN_RECORD_BSHIFT	14		/* 16384 == 1 << 14 */
> +#define XLOG_BIG_RECORD_BSHIFT	15		/* 32k == 1 << 15 */
> +#define XLOG_MAX_RECORD_BSHIFT	18		/* 256k == 1 << 18 */
> +#define XLOG_BTOLSUNIT(log, b)  (((b)+(log)->l_mp->m_sb.sb_logsunit-1) / \
> +                                 (log)->l_mp->m_sb.sb_logsunit)
> +#define XLOG_LSUNITTOB(log, su) ((su) * (log)->l_mp->m_sb.sb_logsunit)
> +
> +#define XLOG_HEADER_SIZE	512
> +
> +#define XLOG_REC_SHIFT(log) \
> +	BTOBB(1 << (xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? \
> +	 XLOG_MAX_RECORD_BSHIFT : XLOG_BIG_RECORD_BSHIFT))
> +#define XLOG_TOTAL_REC_SHIFT(log) \
> +	BTOBB(XLOG_MAX_ICLOGS << (xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? \
> +	 XLOG_MAX_RECORD_BSHIFT : XLOG_BIG_RECORD_BSHIFT))
> +
> +/* get lsn fields */
> +#define CYCLE_LSN(lsn) ((uint)((lsn)>>32))
> +#define BLOCK_LSN(lsn) ((uint)(lsn))
> +
> +/* this is used in a spot where we might otherwise double-endian-flip */
> +#define CYCLE_LSN_DISK(lsn) (((__be32 *)&(lsn))[0])
> +
> +static inline xfs_lsn_t xlog_assign_lsn(uint cycle, uint block)
> +{
> +	return ((xfs_lsn_t)cycle << 32) | block;
> +}
> +
> +static inline uint xlog_get_cycle(char *ptr)
> +{
> +	if (be32_to_cpu(*(__be32 *)ptr) == XLOG_HEADER_MAGIC_NUM)
> +		return be32_to_cpu(*((__be32 *)ptr + 1));
> +	else
> +		return be32_to_cpu(*(__be32 *)ptr);
> +}
> +
> +/* Log Clients */
> +#define XFS_TRANSACTION		0x69
> +#define XFS_VOLUME		0x2
> +#define XFS_LOG			0xaa
> +
> +#define XLOG_UNMOUNT_TYPE	0x556e	/* Un for Unmount */
> +
> +/* Region types for iovec's i_type */
> +#define XLOG_REG_TYPE_BFORMAT		1
> +#define XLOG_REG_TYPE_BCHUNK		2
> +#define XLOG_REG_TYPE_EFI_FORMAT	3
> +#define XLOG_REG_TYPE_EFD_FORMAT	4
> +#define XLOG_REG_TYPE_IFORMAT		5
> +#define XLOG_REG_TYPE_ICORE		6
> +#define XLOG_REG_TYPE_IEXT		7
> +#define XLOG_REG_TYPE_IBROOT		8
> +#define XLOG_REG_TYPE_ILOCAL		9
> +#define XLOG_REG_TYPE_IATTR_EXT		10
> +#define XLOG_REG_TYPE_IATTR_BROOT	11
> +#define XLOG_REG_TYPE_IATTR_LOCAL	12
> +#define XLOG_REG_TYPE_QFORMAT		13
> +#define XLOG_REG_TYPE_DQUOT		14
> +#define XLOG_REG_TYPE_QUOTAOFF		15
> +#define XLOG_REG_TYPE_LRHEADER		16
> +#define XLOG_REG_TYPE_UNMOUNT		17
> +#define XLOG_REG_TYPE_COMMIT		18
> +#define XLOG_REG_TYPE_TRANSHDR		19
> +#define XLOG_REG_TYPE_ICREATE		20
> +#define XLOG_REG_TYPE_MAX		20
> +
> +/*
> + * Flags to log operation header
> + *
> + * The first write of a new transaction will be preceded with a start
> + * record, XLOG_START_TRANS.  Once a transaction is committed, a commit
> + * record is written, XLOG_COMMIT_TRANS.  If a single region can not fit into
> + * the remainder of the current active in-core log, it is split up into
> + * multiple regions.  Each partial region will be marked with a
> + * XLOG_CONTINUE_TRANS until the last one, which gets marked with XLOG_END_TRANS.
> + *
> + */
> +#define XLOG_START_TRANS	0x01	/* Start a new transaction */
> +#define XLOG_COMMIT_TRANS	0x02	/* Commit this transaction */
> +#define XLOG_CONTINUE_TRANS	0x04	/* Cont this trans into new region */
> +#define XLOG_WAS_CONT_TRANS	0x08	/* Cont this trans into new region */
> +#define XLOG_END_TRANS		0x10	/* End a continued transaction */
> +#define XLOG_UNMOUNT_TRANS	0x20	/* Unmount a filesystem transaction */
> +
> +
> +typedef struct xlog_op_header {
> +	__be32	   oh_tid;	/* transaction id of operation	:  4 b */
> +	__be32	   oh_len;	/* bytes in data region		:  4 b */
> +	__u8	   oh_clientid;	/* who sent me this		:  1 b */
> +	__u8	   oh_flags;	/*				:  1 b */
> +	__u16	   oh_res2;	/* 32 bit align			:  2 b */
> +} xlog_op_header_t;
> +
> +
> +/* valid values for h_fmt */
> +#define XLOG_FMT_UNKNOWN  0
> +#define XLOG_FMT_LINUX_LE 1
> +#define XLOG_FMT_LINUX_BE 2
> +#define XLOG_FMT_IRIX_BE  3
> +
> +/* our fmt */
> +#ifdef XFS_NATIVE_HOST
> +#define XLOG_FMT XLOG_FMT_LINUX_BE
> +#else
> +#define XLOG_FMT XLOG_FMT_LINUX_LE
> +#endif
> +
> +typedef struct xlog_rec_header {
> +	__be32	  h_magicno;	/* log record (LR) identifier		:  4 */
> +	__be32	  h_cycle;	/* write cycle of log			:  4 */
> +	__be32	  h_version;	/* LR version				:  4 */
> +	__be32	  h_len;	/* len in bytes; should be 64-bit aligned: 4 */
> +	__be64	  h_lsn;	/* lsn of this LR			:  8 */
> +	__be64	  h_tail_lsn;	/* lsn of 1st LR w/ buffers not committed: 8 */
> +	__le32	  h_crc;	/* crc of log record                    :  4 */
> +	__be32	  h_prev_block; /* block number to previous LR		:  4 */
> +	__be32	  h_num_logops;	/* number of log operations in this LR	:  4 */
> +	__be32	  h_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE];
> +	/* new fields */
> +	__be32    h_fmt;        /* format of log record                 :  4 */
> +	uuid_t	  h_fs_uuid;    /* uuid of FS                           : 16 */
> +	__be32	  h_size;	/* iclog size				:  4 */
> +} xlog_rec_header_t;
> +
> +typedef struct xlog_rec_ext_header {
> +	__be32	  xh_cycle;	/* write cycle of log			: 4 */
> +	__be32	  xh_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE]; /*	: 256 */
> +} xlog_rec_ext_header_t;
> +
> +/*
> + * Quite misnamed, because this union lays out the actual on-disk log buffer.
> + */
> +typedef union xlog_in_core2 {
> +	xlog_rec_header_t	hic_header;
> +	xlog_rec_ext_header_t	hic_xheader;
> +	char			hic_sector[XLOG_HEADER_SIZE];
> +} xlog_in_core_2_t;
> +
> +/* not an on-disk structure, but needed by log recovery in userspace */
> +typedef struct xfs_log_iovec {
> +	void		*i_addr;	/* beginning address of region */
> +	int		i_len;		/* length in bytes of region */
> +	uint		i_type;		/* type of region */
> +} xfs_log_iovec_t;
> +
> +#endif /* __XFS_LOG_FORMAT_H__ */
> diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
> index b9ea262..edd0964 100644
> --- a/fs/xfs/xfs_log_priv.h
> +++ b/fs/xfs/xfs_log_priv.h
> @@ -24,51 +24,13 @@ struct xlog_ticket;
>  struct xfs_mount;
>  
>  /*
> - * Macros, structures, prototypes for internal log manager use.
> + * Flags for log structure
>   */
> -
> -#define XLOG_MIN_ICLOGS		2
> -#define XLOG_MAX_ICLOGS		8
> -#define XLOG_HEADER_MAGIC_NUM	0xFEEDbabe	/* Invalid cycle number */
> -#define XLOG_VERSION_1		1
> -#define XLOG_VERSION_2		2		/* Large IClogs, Log sunit */
> -#define XLOG_VERSION_OKBITS	(XLOG_VERSION_1 | XLOG_VERSION_2)
> -#define XLOG_MIN_RECORD_BSIZE	(16*1024)	/* eventually 32k */
> -#define XLOG_BIG_RECORD_BSIZE	(32*1024)	/* 32k buffers */
> -#define XLOG_MAX_RECORD_BSIZE	(256*1024)
> -#define XLOG_HEADER_CYCLE_SIZE	(32*1024)	/* cycle data in header */
> -#define XLOG_MIN_RECORD_BSHIFT	14		/* 16384 == 1 << 14 */
> -#define XLOG_BIG_RECORD_BSHIFT	15		/* 32k == 1 << 15 */
> -#define XLOG_MAX_RECORD_BSHIFT	18		/* 256k == 1 << 18 */
> -#define XLOG_BTOLSUNIT(log, b)  (((b)+(log)->l_mp->m_sb.sb_logsunit-1) / \
> -                                 (log)->l_mp->m_sb.sb_logsunit)
> -#define XLOG_LSUNITTOB(log, su) ((su) * (log)->l_mp->m_sb.sb_logsunit)
> -
> -#define XLOG_HEADER_SIZE	512
> -
> -#define XLOG_REC_SHIFT(log) \
> -	BTOBB(1 << (xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? \
> -	 XLOG_MAX_RECORD_BSHIFT : XLOG_BIG_RECORD_BSHIFT))
> -#define XLOG_TOTAL_REC_SHIFT(log) \
> -	BTOBB(XLOG_MAX_ICLOGS << (xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? \
> -	 XLOG_MAX_RECORD_BSHIFT : XLOG_BIG_RECORD_BSHIFT))
> -
> -static inline xfs_lsn_t xlog_assign_lsn(uint cycle, uint block)
> -{
> -	return ((xfs_lsn_t)cycle << 32) | block;
> -}
> -
> -static inline uint xlog_get_cycle(char *ptr)
> -{
> -	if (be32_to_cpu(*(__be32 *)ptr) == XLOG_HEADER_MAGIC_NUM)
> -		return be32_to_cpu(*((__be32 *)ptr + 1));
> -	else
> -		return be32_to_cpu(*(__be32 *)ptr);
> -}
> -
> -#define BLK_AVG(blk1, blk2)	((blk1+blk2) >> 1)
> -
> -#ifdef __KERNEL__
> +#define XLOG_ACTIVE_RECOVERY	0x2	/* in the middle of recovery */
> +#define	XLOG_RECOVERY_NEEDED	0x4	/* log was recovered */
> +#define XLOG_IO_ERROR		0x8	/* log hit an I/O error, and being
> +					   shutdown */
> +#define XLOG_TAIL_WARN		0x10	/* log tail verify warning issued */
>  
>  /*
>   * get client id from packed copy.
> @@ -101,28 +63,8 @@ static inline uint xlog_get_client_id(__be32 i)
>  #define XLOG_STATE_IOERROR   0x0080 /* IO error happened in sync'ing log */
>  #define XLOG_STATE_ALL	     0x7FFF /* All possible valid flags */
>  #define XLOG_STATE_NOTUSED   0x8000 /* This IC log not being used */
> -#endif	/* __KERNEL__ */
>  
>  /*
> - * Flags to log operation header
> - *
> - * The first write of a new transaction will be preceded with a start
> - * record, XLOG_START_TRANS.  Once a transaction is committed, a commit
> - * record is written, XLOG_COMMIT_TRANS.  If a single region can not fit into
> - * the remainder of the current active in-core log, it is split up into
> - * multiple regions.  Each partial region will be marked with a
> - * XLOG_CONTINUE_TRANS until the last one, which gets marked with XLOG_END_TRANS.
> - *
> - */
> -#define XLOG_START_TRANS	0x01	/* Start a new transaction */
> -#define XLOG_COMMIT_TRANS	0x02	/* Commit this transaction */
> -#define XLOG_CONTINUE_TRANS	0x04	/* Cont this trans into new region */
> -#define XLOG_WAS_CONT_TRANS	0x08	/* Cont this trans into new region */
> -#define XLOG_END_TRANS		0x10	/* End a continued transaction */
> -#define XLOG_UNMOUNT_TRANS	0x20	/* Unmount a filesystem transaction */
> -
> -#ifdef __KERNEL__
> -/*
>   * Flags to log ticket
>   */
>  #define XLOG_TIC_INITED		0x1	/* has been initialized */
> @@ -132,22 +74,6 @@ static inline uint xlog_get_client_id(__be32 i)
>  	{ XLOG_TIC_INITED,	"XLOG_TIC_INITED" }, \
>  	{ XLOG_TIC_PERM_RESERV,	"XLOG_TIC_PERM_RESERV" }
>  
> -#endif	/* __KERNEL__ */
> -
> -#define XLOG_UNMOUNT_TYPE	0x556e	/* Un for Unmount */
> -
> -/*
> - * Flags for log structure
> - */
> -#define XLOG_ACTIVE_RECOVERY	0x2	/* in the middle of recovery */
> -#define	XLOG_RECOVERY_NEEDED	0x4	/* log was recovered */
> -#define XLOG_IO_ERROR		0x8	/* log hit an I/O error, and being
> -					   shutdown */
> -#define XLOG_TAIL_WARN		0x10	/* log tail verify warning issued */
> -
> -typedef __uint32_t xlog_tid_t;
> -
> -#ifdef __KERNEL__
>  /*
>   * Below are states for covering allocation transactions.
>   * By covering, we mean changing the h_tail_lsn in the last on-disk
> @@ -223,7 +149,6 @@ typedef __uint32_t xlog_tid_t;
>  
>  #define XLOG_COVER_OPS		5
>  
> -
>  /* Ticket reservation region accounting */ 
>  #define XLOG_TIC_LEN_MAX	15
>  
> @@ -258,64 +183,6 @@ typedef struct xlog_ticket {
>  	xlog_res_t	   t_res_arr[XLOG_TIC_LEN_MAX];  /* array of res : 8 * 15 */ 
>  } xlog_ticket_t;
>  
> -#endif
> -
> -
> -typedef struct xlog_op_header {
> -	__be32	   oh_tid;	/* transaction id of operation	:  4 b */
> -	__be32	   oh_len;	/* bytes in data region		:  4 b */
> -	__u8	   oh_clientid;	/* who sent me this		:  1 b */
> -	__u8	   oh_flags;	/*				:  1 b */
> -	__u16	   oh_res2;	/* 32 bit align			:  2 b */
> -} xlog_op_header_t;
> -
> -
> -/* valid values for h_fmt */
> -#define XLOG_FMT_UNKNOWN  0
> -#define XLOG_FMT_LINUX_LE 1
> -#define XLOG_FMT_LINUX_BE 2
> -#define XLOG_FMT_IRIX_BE  3
> -
> -/* our fmt */
> -#ifdef XFS_NATIVE_HOST
> -#define XLOG_FMT XLOG_FMT_LINUX_BE
> -#else
> -#define XLOG_FMT XLOG_FMT_LINUX_LE
> -#endif
> -
> -typedef struct xlog_rec_header {
> -	__be32	  h_magicno;	/* log record (LR) identifier		:  4 */
> -	__be32	  h_cycle;	/* write cycle of log			:  4 */
> -	__be32	  h_version;	/* LR version				:  4 */
> -	__be32	  h_len;	/* len in bytes; should be 64-bit aligned: 4 */
> -	__be64	  h_lsn;	/* lsn of this LR			:  8 */
> -	__be64	  h_tail_lsn;	/* lsn of 1st LR w/ buffers not committed: 8 */
> -	__le32	  h_crc;	/* crc of log record                    :  4 */
> -	__be32	  h_prev_block; /* block number to previous LR		:  4 */
> -	__be32	  h_num_logops;	/* number of log operations in this LR	:  4 */
> -	__be32	  h_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE];
> -	/* new fields */
> -	__be32    h_fmt;        /* format of log record                 :  4 */
> -	uuid_t	  h_fs_uuid;    /* uuid of FS                           : 16 */
> -	__be32	  h_size;	/* iclog size				:  4 */
> -} xlog_rec_header_t;
> -
> -typedef struct xlog_rec_ext_header {
> -	__be32	  xh_cycle;	/* write cycle of log			: 4 */
> -	__be32	  xh_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE]; /*	: 256 */
> -} xlog_rec_ext_header_t;
> -
> -#ifdef __KERNEL__
> -
> -/*
> - * Quite misnamed, because this union lays out the actual on-disk log buffer.
> - */
> -typedef union xlog_in_core2 {
> -	xlog_rec_header_t	hic_header;
> -	xlog_rec_ext_header_t	hic_xheader;
> -	char			hic_sector[XLOG_HEADER_SIZE];
> -} xlog_in_core_2_t;
> -
>  /*
>   * - A log record header is 512 bytes.  There is plenty of room to grow the
>   *	xlog_rec_header_t into the reserved space.
> @@ -686,6 +553,5 @@ static inline void xlog_wait(wait_queue_head_t *wq, spinlock_t *lock)
>  	schedule();
>  	remove_wait_queue(wq, &wait);
>  }
> -#endif	/* __KERNEL__ */
>  
>  #endif	/* __XFS_LOG_PRIV_H__ */
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index 6fcc910a..27f2572 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -55,6 +55,8 @@
>  #include "xfs_attr_leaf.h"
>  #include "xfs_attr_remote.h"
>  
> +#define BLK_AVG(blk1, blk2)	((blk1+blk2) >> 1)
> +
>  STATIC int
>  xlog_find_zeroed(
>  	struct xlog	*,
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2013-07-23 14:03 UTC|newest]

Thread overview: 158+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19  6:24 [PATCH 00/49] current patch queue for 3.12 Dave Chinner
2013-07-19  6:24 ` [PATCH 01/49] xfs: separate out log format definitions Dave Chinner
2013-07-23 14:00   ` Brian Foster [this message]
2013-07-19  6:24 ` [PATCH 02/49] xfs: split out inode log item format definition Dave Chinner
2013-07-23 14:00   ` Brian Foster
2013-07-30 16:20   ` Mark Tinguely
2013-08-01  8:50     ` Christoph Hellwig
2013-07-19  6:24 ` [PATCH 03/49] xfs: split out buf log item format definitions Dave Chinner
2013-07-23 14:01   ` Brian Foster
2013-07-19  6:24 ` [PATCH 04/49] xfs: split out inode log item format definition Dave Chinner
2013-07-23 14:01   ` Brian Foster
2013-07-19  6:24 ` [PATCH 05/49] xfs: separate dquot on disk format definitions out of xfs_quota.h Dave Chinner
2013-07-24 12:09   ` Brian Foster
2013-08-01  8:51   ` Christoph Hellwig
2013-08-02  1:44     ` Dave Chinner
2013-07-19  6:24 ` [PATCH 06/49] xfs: separate icreate log format definitions from xfs_icreate_item.h Dave Chinner
2013-07-24 12:09   ` Brian Foster
2013-07-19  6:24 ` [PATCH 07/49] xfs: split out on-disk transaction definitions Dave Chinner
2013-07-24 12:09   ` Brian Foster
2013-07-19  6:24 ` [PATCH 08/49] xfs: introduce xfs_rtalloc_defs.h Dave Chinner
2013-07-24 12:09   ` Brian Foster
2013-07-19  6:24 ` [PATCH 09/49] xfs: introduce xfs_quota_defs.h Dave Chinner
2013-07-25 12:54   ` Brian Foster
2013-07-19  6:24 ` [PATCH 10/49] xfs: sync minor header differences needed by userspace Dave Chinner
2013-07-25 12:54   ` Brian Foster
2013-07-19  6:24 ` [PATCH 11/49] xfs: split out transaction reservation code Dave Chinner
2013-07-25 12:55   ` Brian Foster
2013-07-19  6:24 ` [PATCH 12/49] xfs: move inode fork definitions to a new header file Dave Chinner
2013-07-25 20:40   ` Mark Tinguely
2013-07-19  6:24 ` [PATCH 13/49] xfs: move unrealted definitions out of xfs_inode.h Dave Chinner
2013-07-25 19:24   ` Mark Tinguely
2013-07-19  6:24 ` [PATCH 14/49] xfs: introduce xfs_inode_buf.c for inode buffer operations Dave Chinner
2013-07-25 19:17   ` Mark Tinguely
2013-07-26  0:24     ` Dave Chinner
2013-07-26 12:41   ` Brian Foster
2013-07-19  6:24 ` [PATCH 15/49] xfs: move getdents code into it's own file Dave Chinner
2013-07-26 13:00   ` Brian Foster
2013-07-19  6:24 ` [PATCH 16/49] xfs: reshuffle dir2 definitions around for userspace Dave Chinner
2013-07-26 13:18   ` Brian Foster
2013-07-19  6:24 ` [PATCH 17/49] xfs: split out attribute listing code into separate file Dave Chinner
2013-07-27 20:23   ` Mark Tinguely
2013-07-19  6:24 ` [PATCH 18/49] xfs: split out attribute fork truncation " Dave Chinner
2013-07-27 19:25   ` Mark Tinguely
2013-07-19  6:24 ` [PATCH 19/49] xfs: split out the remote symlink handling Dave Chinner
2013-07-27 19:48   ` Mark Tinguely
2013-07-19  6:24 ` [PATCH 20/49] xfs: introduce xfs_sb.c for sharing with libxfs Dave Chinner
2013-07-27 17:54   ` Mark Tinguely
2013-07-28  1:08     ` Dave Chinner
2013-07-19  6:24 ` [PATCH 21/49] xfs: create xfs_bmap_util.[ch] Dave Chinner
2013-07-27 17:57   ` Mark Tinguely
2013-07-19  6:24 ` [PATCH 22/49] xfs: minor cleanups Dave Chinner
2013-07-27 18:00   ` Mark Tinguely
2013-07-28  1:07     ` Dave Chinner
2013-07-19  6:24 ` [PATCH 23/49] xfs: fix issues that cause userspace warnings Dave Chinner
2013-07-27 18:02   ` Mark Tinguely
2013-07-19  6:24 ` [PATCH 24/49] xfs: kill xfs_vnodeops.[ch] Dave Chinner
2013-07-26 19:18   ` Mark Tinguely
2013-07-27  1:55     ` Dave Chinner
2013-07-27 18:58       ` Mark Tinguely
2013-07-19  6:24 ` [PATCH 25/49] xfs: consolidate xfs_rename.c Dave Chinner
2013-07-26 19:33   ` Mark Tinguely
2013-07-19  6:24 ` [PATCH 26/49] xfs: consolidate xfs_utils.c Dave Chinner
2013-07-26 20:16   ` Mark Tinguely
2013-07-19  6:24 ` [PATCH 27/49] xfs: consolidate extent swap code Dave Chinner
2013-07-26 21:16   ` Mark Tinguely
2013-07-19  6:24 ` [PATCH 28/49] xfs: don't special case shared superblock mounts Dave Chinner
2013-07-26 15:32   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 29/49] xfs: kill __KERNEL__ check for debug code in allocation code Dave Chinner
2013-07-26 15:07   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 30/49] xfs: remove __KERNEL__ from debug code Dave Chinner
2013-07-26 15:03   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 31/49] xfs: remove __KERNEL__ check from xfs_dir2_leaf.c Dave Chinner
2013-07-26 14:16   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 32/49] xfs: xfs_filestreams.h doesn't need __KERNEL__ Dave Chinner
2013-07-26 14:10   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 33/49] xfs: move kernel specific type definitions to xfs.h Dave Chinner
2013-07-26 13:51   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 34/49] xfs: make struct xfs_perag kernel only Dave Chinner
2013-07-26 13:32   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 35/49] xfs: Introduce a new structure to hold transaction reservation items Dave Chinner
2013-07-22 13:05   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 36/49] xfs: Introduce tr_fsyncts to m_reservation Dave Chinner
2013-07-22 13:22   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 37/49] xfs: Make writeid transaction use tr_writeid Dave Chinner
2013-07-22 13:23   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 38/49] xfs: refactor xfs_trans_reserve() interface Dave Chinner
2013-07-22 13:27   ` Mark Tinguely
2013-07-22 23:37     ` Dave Chinner
2013-07-19  6:25 ` [PATCH 39/49] xfs: Get rid of all XFS_XXX_LOG_RES() macro Dave Chinner
2013-07-22 13:31   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 40/49] xfs: Refactor xfs_ticket_alloc() to extract a new helper Dave Chinner
2013-07-22 13:49   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 41/49] xfs: Add xfs_log_rlimit.c Dave Chinner
2013-07-23 15:15   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 42/49] xfs: Validate log space at mount time Dave Chinner
2013-07-22 13:55   ` Mark Tinguely
2013-07-25  4:11   ` Dave Chinner
2013-07-19  6:25 ` [PATCH 43/49] xfs: return log item size in IOP_SIZE Dave Chinner
2013-07-23 18:22   ` Mark Tinguely
2013-08-01  8:18   ` Christoph Hellwig
2013-07-19  6:25 ` [PATCH 44/49] xfs: Reduce allocations during CIL insertion Dave Chinner
2013-07-23 21:15   ` Mark Tinguely
2013-07-23 21:44     ` Michael L. Semon
2013-07-24 13:28       ` Mark Tinguely
2013-07-24 19:20         ` Michael L. Semon
2013-07-25  0:21         ` Dave Chinner
2013-07-25 15:02           ` Mark Tinguely
2013-07-26  0:32             ` Dave Chinner
2013-07-26 20:46         ` Michael L. Semon
2013-07-26 21:06           ` Mark Tinguely
2013-07-26 22:19             ` Michael L. Semon
2013-07-27  1:58             ` Dave Chinner
2013-07-27 18:32               ` Mark Tinguely
2013-07-28  1:12                 ` Dave Chinner
2013-07-29 14:15                   ` Mark Tinguely
2013-07-30  0:30                     ` Dave Chinner
2013-07-30 13:31                       ` Mark Tinguely
2013-07-30 22:19                         ` Dave Chinner
2013-07-19  6:25 ` [PATCH 45/49] xfs: avoid CIL allocation during insert Dave Chinner
2013-07-29 18:13   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 46/49] xfs: Combine CIL insert and prepare passes Dave Chinner
2013-07-23 21:21   ` Mark Tinguely
2013-07-25  0:23     ` Dave Chinner
2013-07-29 21:07   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 47/49] xfs: split the CIL lock Dave Chinner
2013-07-29 22:24   ` Mark Tinguely
2013-07-19  6:25 ` [PATCH 48/49] xfs: Add read-only support for dirent filetype field Dave Chinner
2013-07-30 19:10   ` Mark Tinguely
2013-08-12  0:59     ` ***** SUSPECTED SPAM ***** " Dave Chinner
2013-08-12 13:25       ` Mark Tinguely
2013-08-13  0:50         ` Dave Chinner
2013-08-13 15:42           ` Mark Tinguely
2013-08-13 15:57             ` Christoph Hellwig
2013-08-14  7:50             ` Dave Chinner
2013-08-14 18:47               ` Geoffrey Wehrman
2013-08-15  4:22                 ` Dave Chinner
2013-08-15 17:39                   ` Geoffrey Wehrman
2013-08-15  5:59                 ` Ric Wheeler
2013-08-15 18:04                   ` Geoffrey Wehrman
2013-08-15 21:41                     ` Ric Wheeler
2013-08-16 14:08                       ` Geoffrey Wehrman
2013-08-19  5:28                         ` Dave Chinner
2013-08-19 18:48                           ` Geoffrey Wehrman
2013-08-20  2:23                             ` Dave Chinner
2013-08-20 14:30                               ` Geoffrey Wehrman
2013-08-20 18:27                                 ` Ric Wheeler
2013-08-20 19:47                         ` Eric Sandeen
2013-08-15 16:50                 ` Eric Sandeen
2013-08-15 18:32                   ` Geoffrey Wehrman
2013-08-15 18:41                     ` Eric Sandeen
2013-08-15 19:06                       ` Geoffrey Wehrman
2013-08-15 18:54                   ` Ben Myers
2013-08-15 22:40   ` Ben Myers
2013-07-19  6:25 ` [PATCH 49/49] xfs: Add write " Dave Chinner
2013-07-21  6:23 ` [PATCH 00/49] current patch queue for 3.12 Michael L. Semon
2013-07-22 23:43   ` Dave Chinner
2013-07-23  1:00     ` Michael L. Semon
2013-08-01 21:21 ` Ben Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51EE8C84.70507@redhat.com \
    --to=bfoster@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox