From: Chandan Babu R <chandan.babu@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 08/17] xfs: convert btree buffer log flags to unsigned.
Date: Mon, 11 Apr 2022 19:33:48 +0530 [thread overview]
Message-ID: <875ynfvhrv.fsf@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <20220411003147.2104423-9-david@fromorbit.com>
On 11 Apr 2022 at 06:01, Dave Chinner wrote:
> 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned
> fields to be unsigned.
>
> We also pass the fields to log to xfs_btree_offsets() as a uint32_t
> all cases now. I have no idea why we made that parameter a int64_t
> in the first place, but while we are fixing this up change it to
> a uint32_t field, too.
>
Looks good.
Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---
> fs/xfs/libxfs/xfs_btree.c | 10 +++++-----
> fs/xfs/libxfs/xfs_btree.h | 26 +++++++++++++-------------
> 2 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
> index c1500b238520..a8c79e760d8a 100644
> --- a/fs/xfs/libxfs/xfs_btree.c
> +++ b/fs/xfs/libxfs/xfs_btree.c
> @@ -751,20 +751,20 @@ xfs_btree_lastrec(
> */
> void
> xfs_btree_offsets(
> - int64_t fields, /* bitmask of fields */
> + uint32_t fields, /* bitmask of fields */
> const short *offsets, /* table of field offsets */
> int nbits, /* number of bits to inspect */
> int *first, /* output: first byte offset */
> int *last) /* output: last byte offset */
> {
> int i; /* current bit number */
> - int64_t imask; /* mask for current bit number */
> + uint32_t imask; /* mask for current bit number */
>
> ASSERT(fields != 0);
> /*
> * Find the lowest bit, so the first byte offset.
> */
> - for (i = 0, imask = 1LL; ; i++, imask <<= 1) {
> + for (i = 0, imask = 1u; ; i++, imask <<= 1) {
> if (imask & fields) {
> *first = offsets[i];
> break;
> @@ -773,7 +773,7 @@ xfs_btree_offsets(
> /*
> * Find the highest bit, so the last byte offset.
> */
> - for (i = nbits - 1, imask = 1LL << i; ; i--, imask >>= 1) {
> + for (i = nbits - 1, imask = 1u << i; ; i--, imask >>= 1) {
> if (imask & fields) {
> *last = offsets[i + 1] - 1;
> break;
> @@ -1456,7 +1456,7 @@ void
> xfs_btree_log_block(
> struct xfs_btree_cur *cur, /* btree cursor */
> struct xfs_buf *bp, /* buffer containing btree block */
> - int fields) /* mask of fields: XFS_BB_... */
> + uint32_t fields) /* mask of fields: XFS_BB_... */
> {
> int first; /* first byte offset logged */
> int last; /* last byte offset logged */
> diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
> index 22d9f411fde6..eef27858a013 100644
> --- a/fs/xfs/libxfs/xfs_btree.h
> +++ b/fs/xfs/libxfs/xfs_btree.h
> @@ -68,19 +68,19 @@ uint32_t xfs_btree_magic(int crc, xfs_btnum_t btnum);
> /*
> * For logging record fields.
> */
> -#define XFS_BB_MAGIC (1 << 0)
> -#define XFS_BB_LEVEL (1 << 1)
> -#define XFS_BB_NUMRECS (1 << 2)
> -#define XFS_BB_LEFTSIB (1 << 3)
> -#define XFS_BB_RIGHTSIB (1 << 4)
> -#define XFS_BB_BLKNO (1 << 5)
> -#define XFS_BB_LSN (1 << 6)
> -#define XFS_BB_UUID (1 << 7)
> -#define XFS_BB_OWNER (1 << 8)
> +#define XFS_BB_MAGIC (1u << 0)
> +#define XFS_BB_LEVEL (1u << 1)
> +#define XFS_BB_NUMRECS (1u << 2)
> +#define XFS_BB_LEFTSIB (1u << 3)
> +#define XFS_BB_RIGHTSIB (1u << 4)
> +#define XFS_BB_BLKNO (1u << 5)
> +#define XFS_BB_LSN (1u << 6)
> +#define XFS_BB_UUID (1u << 7)
> +#define XFS_BB_OWNER (1u << 8)
> #define XFS_BB_NUM_BITS 5
> -#define XFS_BB_ALL_BITS ((1 << XFS_BB_NUM_BITS) - 1)
> +#define XFS_BB_ALL_BITS ((1u << XFS_BB_NUM_BITS) - 1)
> #define XFS_BB_NUM_BITS_CRC 9
> -#define XFS_BB_ALL_BITS_CRC ((1 << XFS_BB_NUM_BITS_CRC) - 1)
> +#define XFS_BB_ALL_BITS_CRC ((1u << XFS_BB_NUM_BITS_CRC) - 1)
>
> /*
> * Generic stats interface
> @@ -345,7 +345,7 @@ xfs_btree_dup_cursor(
> */
> void
> xfs_btree_offsets(
> - int64_t fields, /* bitmask of fields */
> + uint32_t fields, /* bitmask of fields */
> const short *offsets,/* table of field offsets */
> int nbits, /* number of bits to inspect */
> int *first, /* output: first byte offset */
> @@ -435,7 +435,7 @@ bool xfs_btree_sblock_verify_crc(struct xfs_buf *);
> /*
> * Internal btree helpers also used by xfs_bmap.c.
> */
> -void xfs_btree_log_block(struct xfs_btree_cur *, struct xfs_buf *, int);
> +void xfs_btree_log_block(struct xfs_btree_cur *, struct xfs_buf *, uint32_t);
> void xfs_btree_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int);
>
> /*
--
chandan
next prev parent reply other threads:[~2022-04-11 14:04 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-11 0:31 [PATCH 00/17] xfs: unsigned flags conversion for c11 Dave Chinner
2022-04-11 0:31 ` [PATCH 01/17] xfs: convert buffer flags to unsigned Dave Chinner
2022-04-11 10:05 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 02/17] xfs: convert attr type " Dave Chinner
2022-04-11 10:23 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 03/17] xfs: convert scrub " Dave Chinner
2022-04-11 10:33 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 04/17] xfs: convert bmap extent " Dave Chinner
2022-04-11 10:42 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 05/17] xfs: convert bmapi " Dave Chinner
2022-04-11 12:53 ` Chandan Babu R
2022-04-11 13:44 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 06/17] xfs: convert AGF log " Dave Chinner
2022-04-11 13:27 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 07/17] xfs: convert AGI " Dave Chinner
2022-04-11 13:49 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 08/17] xfs: convert btree buffer " Dave Chinner
2022-04-11 14:03 ` Chandan Babu R [this message]
2022-04-11 0:31 ` [PATCH 09/17] xfs: convert buffer log item " Dave Chinner
2022-04-12 7:25 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 10/17] xfs: convert da btree operations " Dave Chinner
2022-04-12 7:25 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 11/17] xfs: convert dquot " Dave Chinner
2022-04-12 7:26 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 12/17] xfs: convert log item tracepoint " Dave Chinner
2022-04-12 7:26 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 13/17] xfs: convert inode lock " Dave Chinner
2022-04-12 7:26 ` Chandan Babu R
2022-04-12 8:43 ` Dave Chinner
2022-04-21 0:44 ` [PATCH 13/17 v2] " Dave Chinner
2022-04-21 3:07 ` Alli
2022-04-21 9:15 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 14/17] xfs: convert ptag " Dave Chinner
2022-04-12 7:26 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 15/17] xfs: convert quota options " Dave Chinner
2022-04-12 7:26 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 16/17] xfs: convert shutdown reasons " Dave Chinner
2022-04-12 7:27 ` Chandan Babu R
2022-04-11 0:31 ` [PATCH 17/17] xfs: convert log ticket and iclog flags " Dave Chinner
2022-04-12 7:27 ` Chandan Babu R
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=875ynfvhrv.fsf@debian-BULLSEYE-live-builder-AMD64 \
--to=chandan.babu@oracle.com \
--cc=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
/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