From: Brian Foster <bfoster@redhat.com>
To: xfs@oss.sgi.com
Subject: Re: [PATCH 03/49] xfs: split out buf log item format definitions
Date: Tue, 23 Jul 2013 10:01:27 -0400 [thread overview]
Message-ID: <51EE8CB7.2080703@redhat.com> (raw)
In-Reply-To: <1374215120-7271-4-git-send-email-david@fromorbit.com>
On 07/19/2013 02:24 AM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/xfs_buf_item.h | 100 ++----------------------------------------------
> fs/xfs/xfs_log_format.h | 97 ++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 100 insertions(+), 97 deletions(-)
>
> diff --git a/fs/xfs/xfs_buf_item.h b/fs/xfs/xfs_buf_item.h
> index 0f1c247..db63710 100644
> --- a/fs/xfs/xfs_buf_item.h
> +++ b/fs/xfs/xfs_buf_item.h
> @@ -18,101 +18,9 @@
> #ifndef __XFS_BUF_ITEM_H__
> #define __XFS_BUF_ITEM_H__
>
> -extern kmem_zone_t *xfs_buf_item_zone;
> -
> -/*
> - * This flag indicates that the buffer contains on disk inodes
> - * and requires special recovery handling.
> - */
> -#define XFS_BLF_INODE_BUF (1<<0)
> -/*
> - * This flag indicates that the buffer should not be replayed
> - * during recovery because its blocks are being freed.
> - */
> -#define XFS_BLF_CANCEL (1<<1)
> -
> -/*
> - * This flag indicates that the buffer contains on disk
> - * user or group dquots and may require special recovery handling.
> - */
> -#define XFS_BLF_UDQUOT_BUF (1<<2)
> -#define XFS_BLF_PDQUOT_BUF (1<<3)
> -#define XFS_BLF_GDQUOT_BUF (1<<4)
> -
> -#define XFS_BLF_CHUNK 128
> -#define XFS_BLF_SHIFT 7
> -#define BIT_TO_WORD_SHIFT 5
> -#define NBWORD (NBBY * sizeof(unsigned int))
> -
> -/*
> - * This is the structure used to lay out a buf log item in the
> - * log. The data map describes which 128 byte chunks of the buffer
> - * have been logged.
> - */
> -#define XFS_BLF_DATAMAP_SIZE ((XFS_MAX_BLOCKSIZE / XFS_BLF_CHUNK) / NBWORD)
> +/* kernel only definitions */
>
> -typedef struct xfs_buf_log_format {
> - unsigned short blf_type; /* buf log item type indicator */
> - unsigned short blf_size; /* size of this item */
> - ushort blf_flags; /* misc state */
> - ushort blf_len; /* number of blocks in this buf */
> - __int64_t blf_blkno; /* starting blkno of this buf */
> - unsigned int blf_map_size; /* used size of data bitmap in words */
> - unsigned int blf_data_map[XFS_BLF_DATAMAP_SIZE]; /* dirty bitmap */
> -} xfs_buf_log_format_t;
> -
> -/*
> - * All buffers now need to tell recovery where the magic number
> - * is so that it can verify and calculate the CRCs on the buffer correctly
> - * once the changes have been replayed into the buffer.
> - *
> - * The type value is held in the upper 5 bits of the blf_flags field, which is
> - * an unsigned 16 bit field. Hence we need to shift it 11 bits up and down.
> - */
> -#define XFS_BLFT_BITS 5
> -#define XFS_BLFT_SHIFT 11
> -#define XFS_BLFT_MASK (((1 << XFS_BLFT_BITS) - 1) << XFS_BLFT_SHIFT)
> -
> -enum xfs_blft {
> - XFS_BLFT_UNKNOWN_BUF = 0,
> - XFS_BLFT_UDQUOT_BUF,
> - XFS_BLFT_PDQUOT_BUF,
> - XFS_BLFT_GDQUOT_BUF,
> - XFS_BLFT_BTREE_BUF,
> - XFS_BLFT_AGF_BUF,
> - XFS_BLFT_AGFL_BUF,
> - XFS_BLFT_AGI_BUF,
> - XFS_BLFT_DINO_BUF,
> - XFS_BLFT_SYMLINK_BUF,
> - XFS_BLFT_DIR_BLOCK_BUF,
> - XFS_BLFT_DIR_DATA_BUF,
> - XFS_BLFT_DIR_FREE_BUF,
> - XFS_BLFT_DIR_LEAF1_BUF,
> - XFS_BLFT_DIR_LEAFN_BUF,
> - XFS_BLFT_DA_NODE_BUF,
> - XFS_BLFT_ATTR_LEAF_BUF,
> - XFS_BLFT_ATTR_RMT_BUF,
> - XFS_BLFT_SB_BUF,
> - XFS_BLFT_MAX_BUF = (1 << XFS_BLFT_BITS),
> -};
> -
> -static inline void
> -xfs_blft_to_flags(struct xfs_buf_log_format *blf, enum xfs_blft type)
> -{
> - ASSERT(type > XFS_BLFT_UNKNOWN_BUF && type < XFS_BLFT_MAX_BUF);
> - blf->blf_flags &= ~XFS_BLFT_MASK;
> - blf->blf_flags |= ((type << XFS_BLFT_SHIFT) & XFS_BLFT_MASK);
> -}
> -
> -static inline __uint16_t
> -xfs_blft_from_flags(struct xfs_buf_log_format *blf)
> -{
> - return (blf->blf_flags & XFS_BLFT_MASK) >> XFS_BLFT_SHIFT;
> -}
> -
> -/*
> - * buf log item flags
> - */
> +/* buf log item flags */
> #define XFS_BLI_HOLD 0x01
> #define XFS_BLI_DIRTY 0x02
> #define XFS_BLI_STALE 0x04
> @@ -133,8 +41,6 @@ xfs_blft_from_flags(struct xfs_buf_log_format *blf)
> { XFS_BLI_ORDERED, "ORDERED" }
>
>
> -#ifdef __KERNEL__
> -
> struct xfs_buf;
> struct xfs_mount;
> struct xfs_buf_log_item;
> @@ -169,6 +75,6 @@ void xfs_trans_buf_set_type(struct xfs_trans *, struct xfs_buf *,
> enum xfs_blft);
> void xfs_trans_buf_copy_type(struct xfs_buf *dst_bp, struct xfs_buf *src_bp);
>
> -#endif /* __KERNEL__ */
> +extern kmem_zone_t *xfs_buf_item_zone;
>
> #endif /* __XFS_BUF_ITEM_H__ */
> diff --git a/fs/xfs/xfs_log_format.h b/fs/xfs/xfs_log_format.h
> index fd46a7f..77a6024 100644
> --- a/fs/xfs/xfs_log_format.h
> +++ b/fs/xfs/xfs_log_format.h
> @@ -364,4 +364,101 @@ static inline uint xfs_icdinode_size(int version)
> return sizeof(struct xfs_icdinode);
> return offsetof(struct xfs_icdinode, di_next_unlinked);
> }
> +
> +/*
> + * Buffer Log Format defintions
> + *
> + * These are the physical dirty bitmap defintions for the log format structure.
> + */
> +#define XFS_BLF_CHUNK 128
> +#define XFS_BLF_SHIFT 7
> +#define BIT_TO_WORD_SHIFT 5
> +#define NBWORD (NBBY * sizeof(unsigned int))
> +
> +/*
> + * This flag indicates that the buffer contains on disk inodes
> + * and requires special recovery handling.
> + */
> +#define XFS_BLF_INODE_BUF (1<<0)
> +
> +/*
> + * This flag indicates that the buffer should not be replayed
> + * during recovery because its blocks are being freed.
> + */
> +#define XFS_BLF_CANCEL (1<<1)
> +
> +/*
> + * This flag indicates that the buffer contains on disk
> + * user or group dquots and may require special recovery handling.
> + */
> +#define XFS_BLF_UDQUOT_BUF (1<<2)
> +#define XFS_BLF_PDQUOT_BUF (1<<3)
> +#define XFS_BLF_GDQUOT_BUF (1<<4)
> +
> +/*
> + * This is the structure used to lay out a buf log item in the
> + * log. The data map describes which 128 byte chunks of the buffer
> + * have been logged.
> + */
> +#define XFS_BLF_DATAMAP_SIZE ((XFS_MAX_BLOCKSIZE / XFS_BLF_CHUNK) / NBWORD)
> +
> +typedef struct xfs_buf_log_format {
> + unsigned short blf_type; /* buf log item type indicator */
> + unsigned short blf_size; /* size of this item */
> + ushort blf_flags; /* misc state */
> + ushort blf_len; /* number of blocks in this buf */
> + __int64_t blf_blkno; /* starting blkno of this buf */
> + unsigned int blf_map_size; /* used size of data bitmap in words */
> + unsigned int blf_data_map[XFS_BLF_DATAMAP_SIZE]; /* dirty bitmap */
> +} xfs_buf_log_format_t;
> +
> +/*
> + * All buffers now need to tell recovery where the magic number
> + * is so that it can verify and calculate the CRCs on the buffer correctly
> + * once the changes have been replayed into the buffer.
> + *
> + * The type value is held in the upper 5 bits of the blf_flags field, which is
> + * an unsigned 16 bit field. Hence we need to shift it 11 bits up and down.
> + */
> +#define XFS_BLFT_BITS 5
> +#define XFS_BLFT_SHIFT 11
> +#define XFS_BLFT_MASK (((1 << XFS_BLFT_BITS) - 1) << XFS_BLFT_SHIFT)
> +
> +enum xfs_blft {
> + XFS_BLFT_UNKNOWN_BUF = 0,
> + XFS_BLFT_UDQUOT_BUF,
> + XFS_BLFT_PDQUOT_BUF,
> + XFS_BLFT_GDQUOT_BUF,
> + XFS_BLFT_BTREE_BUF,
> + XFS_BLFT_AGF_BUF,
> + XFS_BLFT_AGFL_BUF,
> + XFS_BLFT_AGI_BUF,
> + XFS_BLFT_DINO_BUF,
> + XFS_BLFT_SYMLINK_BUF,
> + XFS_BLFT_DIR_BLOCK_BUF,
> + XFS_BLFT_DIR_DATA_BUF,
> + XFS_BLFT_DIR_FREE_BUF,
> + XFS_BLFT_DIR_LEAF1_BUF,
> + XFS_BLFT_DIR_LEAFN_BUF,
> + XFS_BLFT_DA_NODE_BUF,
> + XFS_BLFT_ATTR_LEAF_BUF,
> + XFS_BLFT_ATTR_RMT_BUF,
> + XFS_BLFT_SB_BUF,
> + XFS_BLFT_MAX_BUF = (1 << XFS_BLFT_BITS),
> +};
> +
> +static inline void
> +xfs_blft_to_flags(struct xfs_buf_log_format *blf, enum xfs_blft type)
> +{
> + ASSERT(type > XFS_BLFT_UNKNOWN_BUF && type < XFS_BLFT_MAX_BUF);
> + blf->blf_flags &= ~XFS_BLFT_MASK;
> + blf->blf_flags |= ((type << XFS_BLFT_SHIFT) & XFS_BLFT_MASK);
> +}
> +
> +static inline __uint16_t
> +xfs_blft_from_flags(struct xfs_buf_log_format *blf)
> +{
> + return (blf->blf_flags & XFS_BLFT_MASK) >> XFS_BLFT_SHIFT;
> +}
> +
> #endif /* __XFS_LOG_FORMAT_H__ */
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-07-23 14:04 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
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 [this message]
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=51EE8CB7.2080703@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