From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/7] xfs: remove double-underscore integer types
Date: Wed, 2 Aug 2017 09:01:12 -0700 [thread overview]
Message-ID: <20170802160112.GM4477@magnolia> (raw)
In-Reply-To: <20170802091305.oyxfyhw4eagmatq3@hades.localdomain>
On Wed, Aug 02, 2017 at 11:13:05AM +0200, Carlos Maiolino wrote:
> Hi,
>
> On Mon, Jul 31, 2017 at 02:06:54PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > This is a purely mechanical patch that removes the private
> > __{u,}int{8,16,32,64}_t typedefs in favor of using the system
> > {u,}int{8,16,32,64}_t typedefs. This is the sed script used to perform
> > the transformation and fix the resulting whitespace and indentation
> > errors:
> >
> > s/typedef\t__uint8_t/typedef __uint8_t\t/g
> > s/typedef\t__uint/typedef __uint/g
> > s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
> > s/__uint8_t\t/__uint8_t\t\t/g
> > s/__uint/uint/g
> > s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
> > s/__int/int/g
> > /^typedef.*int[0-9]*_t;$/d
> >
>
> Loos fine, with a few space X tabs cosmetic changes maybe worth to change?
>
>
> Anyway, just a suggestion, changing it or not:
>
> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
>
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >
> > diff --git a/db/bit.h b/db/bit.h
> > index 80ba24c..9fd71f4 100644
> > --- a/db/bit.h
> > +++ b/db/bit.h
> > @@ -25,5 +25,5 @@
> > #define BVUNSIGNED 0
> > #define BVSIGNED 1
> >
> > -extern __int64_t getbitval(void *obj, int bitoff, int nbits, int flags);
> > +extern int64_t getbitval(void *obj, int bitoff, int nbits, int flags);
> > extern void setbitval(void *obuf, int bitoff, int nbits, void *ibuf);
>
> ^ Maybe worth to fix this space x tabs while in this code?
Different cleanup patch, please. The double-underscore cleanup patch
should /only/ touch double underscore types, and nothing else. I think
Eric fixed a few cases of extra whitespace that drifts this patch away
from the giant sed blob, but whatever already too hot here to bikeshed
further over whitespace. :)
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> > diff --git a/db/io.h b/db/io.h
> > index 9973004..df0fdd7 100644
> > --- a/db/io.h
> > +++ b/db/io.h
> > @@ -25,7 +25,7 @@ typedef struct bbmap {
> > } bbmap_t;
> >
> > typedef struct iocur {
> > - __int64_t bb; /* BB number in filesystem of buf */
> > + int64_t bb; /* BB number in filesystem of buf */
> > int blen; /* length of "buf", bb's */
> > int boff; /* data - buf */
> > void *buf; /* base address of buffer */
> > @@ -33,7 +33,7 @@ typedef struct iocur {
> > xfs_ino_t dirino; /* current directory inode number */
> > xfs_ino_t ino; /* current inode number */
> > int len; /* length of "data", bytes */
> > - __uint16_t mode; /* current inode's mode */
> > + uint16_t mode; /* current inode's mode */
> > xfs_off_t off; /* fs offset of "data" in bytes */
> > const struct typ *typ; /* type of "data" */
> > bbmap_t *bbmap; /* map daddr if fragmented */
> > @@ -57,7 +57,7 @@ extern void off_cur(int off, int len);
> > extern void pop_cur(void);
> > extern void print_iocur(char *tag, iocur_t *ioc);
> > extern void push_cur(void);
> > -extern int read_buf(__int64_t daddr, int count, void *bufp);
> > +extern int read_buf(int64_t daddr, int count, void *bufp);
> > extern void write_cur(void);
>
> ^^
>
> >
> > diff --git a/db/sb.c b/db/sb.c
> > index 8e7722c..f19248d 100644
> > --- a/db/sb.c
> > +++ b/db/sb.c
> > @@ -606,7 +606,7 @@ version_help(void)
> > }
> >
> > static int
> > -do_version(xfs_agnumber_t agno, __uint16_t version, __uint32_t features)
> > +do_version(xfs_agnumber_t agno, uint16_t version, uint32_t features)
> > {
> > xfs_sb_t tsb;
> >
> > @@ -710,8 +710,8 @@ version_f(
> > int argc,
> > char **argv)
> > {
> > - __uint16_t version = 0;
> > - __uint32_t features = 0;
> > + uint16_t version = 0;
> > + uint32_t features = 0;
> > xfs_agnumber_t ag;
> >
> > if (argc == 2) { /* WRITE VERSION */
> > diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
> > index 517b75f..d4846a3 100644
> > --- a/fsr/xfs_fsr.c
> > +++ b/fsr/xfs_fsr.c
> > @@ -54,7 +54,7 @@ struct getbmap *outmap = NULL;
> > int outmap_size = 0;
>
> ^^^
>
> > int RealUid;
> > int tmp_agi;
> > -static __int64_t minimumfree = 2048;
> > +static int64_t minimumfree = 2048;
> >
> > #define MNTTYPE_XFS "xfs"
> >
> ^^^
>
> > diff --git a/include/xfs_arch.h b/include/xfs_arch.h
> > index 12cd43e..186cadb 100644
> > --- a/include/xfs_arch.h
> > +++ b/include/xfs_arch.h
> > @@ -244,39 +244,39 @@ static inline void be64_add_cpu(__be64 *a, __s64 b)
> > *a = cpu_to_be64(be64_to_cpu(*a) + b);
> > }
> >
> > -static inline __uint16_t get_unaligned_be16(void *p)
> > +static inline uint16_t get_unaligned_be16(void *p)
> > {
> > - __uint8_t *__p = p;
> > + uint8_t *__p = p;
> > return __p[0] << 8 | __p[1];
> > }
> >
> > -static inline __uint32_t get_unaligned_be32(void *p)
> > +static inline uint32_t get_unaligned_be32(void *p)
> > {
> > - __uint8_t *__p = p;
> > + uint8_t *__p = p;
> > return __p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3];
>
> ^^^
>
> > /*
> > diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
> > index 6c8a192..43b4f1d 100644
> > --- a/libxfs/rdwr.c
> > +++ b/libxfs/rdwr.c
> > @@ -118,9 +118,9 @@ static void unmount_record(void *p)
> > xlog_op_header_t *op = (xlog_op_header_t *)p;
> > /* the data section must be 32 bit size aligned */
> > struct {
> > - __uint16_t magic;
> > - __uint16_t pad1;
> > - __uint32_t pad2; /* may as well make it 64 bits */
> > + uint16_t magic;
> > + uint16_t pad1;
> > + uint32_t pad2; /* may as well make it 64 bits */
> > } magic = { XLOG_UNMOUNT_TYPE, 0, 0 };
>
> ^^^
> > diff --git a/logprint/log_misc.c b/logprint/log_misc.c
> > index 0dfcfd1..fe27f15 100644
> > --- a/logprint/log_misc.c
> > +++ b/logprint/log_misc.c
> > @@ -166,12 +166,12 @@ xlog_print_trans_header(char **ptr, int len)
> > {
> > xfs_trans_header_t *h;
> > char *cptr = *ptr;
> > - __uint32_t magic;
> > + uint32_t magic;
> > char *magic_c = (char *)&magic;
> >
>
> ^^^^
>
>
> > *ptr += len;
> >
> > - magic=*(__uint32_t*)cptr; /* XXX be32_to_cpu soon */
> > + magic=*(uint32_t*)cptr; /* XXX be32_to_cpu soon */
> >
> > if (len >= 4) {
> > #if __BYTE_ORDER == __LITTLE_ENDIAN
> > @@ -201,7 +201,7 @@ xlog_print_trans_buffer(char **ptr, int len, int *i, int num_ops)
> > int num, skip;
> > int super_block = 0;
> > int bucket, col, buckets;
> > - __int64_t blkno;
> > + int64_t blkno;
> > xfs_buf_log_format_t lbuf;
> > int size, blen, map_size, struct_size;
> > __be64 x, y;
>
> ^^^
>
> > --- a/repair/attr_repair.h
> > +++ b/repair/attr_repair.h
> > @@ -32,10 +32,10 @@
> > #define ACL_WRITE 02
> > #define ACL_EXECUTE 01
> >
> > */
> > #define XFS_MAC_MAX_SETS 250
> > typedef struct xfs_mac_label {
> > - __uint8_t ml_msen_type; /* MSEN label type */
> > - __uint8_t ml_mint_type; /* MINT label type */
> > - __uint8_t ml_level; /* Hierarchical level */
> > - __uint8_t ml_grade; /* Hierarchical grade */
> > - __uint16_t ml_catcount; /* Category count */
> > - __uint16_t ml_divcount; /* Division count */
> > + uint8_t ml_msen_type; /* MSEN label type */
> > + uint8_t ml_mint_type; /* MINT label type */
> > + uint8_t ml_level; /* Hierarchical level */
> > + uint8_t ml_grade; /* Hierarchical grade */
> > + uint16_t ml_catcount; /* Category count */
> > + uint16_t ml_divcount; /* Division count */
> > /* Category set, then Division set */
> > - __uint16_t ml_list[XFS_MAC_MAX_SETS];
> > + uint16_t ml_list[XFS_MAC_MAX_SETS];
>
> ^^^
> > } xfs_mac_label_t;
>
> > diff --git a/repair/avl64.c b/repair/avl64.c
> > index 51cd624..8f4a121 100644
> > --- a/repair/avl64.c
> > +++ b/repair/avl64.c
> > @@ -70,8 +70,8 @@ avl64_checktree(
> > avl64node_t *root)
> > {
> > avl64node_t *nlast, *nnext, *np;
> > - __uint64_t offset = 0;
> > - __uint64_t end;
> > + uint64_t offset = 0;
> > + uint64_t end;
> >
> > nlast = nnext = root;
> >
> > avl64node_t *
> > avl64_insert_find_growth(
> > avl64tree_desc_t *tree,
> > - __uint64_t start, /* range start at start, */
> > - __uint64_t end, /* exclusive */
> > + uint64_t start, /* range start at start, */
> > + uint64_t end, /* exclusive */
> > int *growthp) /* OUT */
> ^^^
> > {
> > avl64node_t *np = tree->avl_root;
> > @@ -1378,8 +1378,8 @@ avl64_findadjacent(
> > void
> > avl64_findranges(
> > avl64tree_desc_t *tree,
> > - __uint64_t start,
> > - __uint64_t end,
> > + uint64_t start,
> > + uint64_t end,
> > avl64node_t **startp,
>
> ^^^
>
> > avl64node_t **endp)
> > {
> > diff --git a/repair/avl64.h b/repair/avl64.h
> > index fd19321..cd079a0 100644
> > --- a/repair/avl64.h
> > +++ b/repair/avl64.h
> > @@ -32,8 +32,8 @@ typedef struct avl64node {
> > * avl-tree operations
> > */
> >
> > avl64node_t *
> > avl64_findanyrange(
> > avl64tree_desc_t *tree,
> > - __uint64_t start,
> > - __uint64_t end,
> > + uint64_t start,
> > + uint64_t end,
> > int checklen);
>
> ^^^
> >
> >
> > avl64node_t *
> > avl64_findadjacent(
> > avl64tree_desc_t *tree,
> > - __uint64_t value,
> > + uint64_t value,
> > int dir);
> >
> > void
> > avl64_findranges(
> > avl64tree_desc_t *tree,
> > - __uint64_t start,
> > - __uint64_t end,
> > + uint64_t start,
> > + uint64_t end,
> > avl64node_t **startp,
>
> ^^^
>
> > avl64node_t **endp);
> >
>
> --
> Carlos
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-08-02 16:01 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-31 21:06 [PATCH 0/7] xfsprogs: 4.13 rollup Darrick J. Wong
2017-07-31 21:06 ` [PATCH 1/7] xfs: remove double-underscore integer types Darrick J. Wong
2017-07-31 21:23 ` Eric Sandeen
2017-07-31 21:25 ` Darrick J. Wong
2017-08-02 9:13 ` Carlos Maiolino
2017-08-02 16:01 ` Darrick J. Wong [this message]
2017-07-31 21:07 ` [PATCH 2/7] xfs_repair: fix symlink target length checks by changing MAXPATHLEN to XFS_SYMLINK_MAXLEN Darrick J. Wong
2017-07-31 21:42 ` Eric Sandeen
2017-08-02 9:14 ` Carlos Maiolino
2017-07-31 21:07 ` [PATCH 3/7] xfs_db: fix metadump redirection (again) Darrick J. Wong
2017-07-31 21:57 ` Eric Sandeen
2017-08-01 16:23 ` [PATCH v2 " Darrick J. Wong
2017-08-02 9:17 ` Carlos Maiolino
2017-07-31 21:07 ` [PATCH 4/7] xfs_db: dump dir/attr btrees Darrick J. Wong
2017-07-31 22:05 ` Eric Sandeen
2017-08-01 14:59 ` Darrick J. Wong
2017-08-01 15:40 ` [PATCH v2 " Darrick J. Wong
2017-08-01 16:21 ` Eric Sandeen
2017-08-02 9:22 ` Carlos Maiolino
2017-08-02 9:24 ` Carlos Maiolino
2017-08-02 16:03 ` Darrick J. Wong
2017-07-31 21:07 ` [PATCH 5/7] xfs_db: print attribute remote value blocks Darrick J. Wong
2017-08-01 17:15 ` Eric Sandeen
2017-08-01 20:29 ` Darrick J. Wong
2017-08-01 21:04 ` [PATCH v2 " Darrick J. Wong
2017-08-02 9:36 ` Carlos Maiolino
2017-07-31 21:07 ` [PATCH 6/7] xfs_db: write values into dir/attr blocks and recalculate CRCs Darrick J. Wong
2017-08-02 9:40 ` Carlos Maiolino
2017-08-03 16:02 ` Eric Sandeen
2017-08-03 16:40 ` Darrick J. Wong
2017-07-31 21:07 ` [PATCH 7/7] xfs_db: introduce fuzz command Darrick J. Wong
2017-08-02 11:06 ` Carlos Maiolino
2017-08-03 16:47 ` [PATCH 8/7] xfs_db: use TYP_F_CRC_FUNC for inodes & dquots Eric Sandeen
2017-08-03 16:58 ` Darrick J. Wong
2017-08-03 17:15 ` [PATCH 8/7 V2] " Eric Sandeen
2017-08-03 18:05 ` Darrick J. Wong
2017-08-03 17:04 ` [PATCH 9/7] xfs_db: btdump should avoid eval for push and pop of cursor Darrick J. Wong
2017-08-03 17:18 ` Eric Sandeen
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=20170802160112.GM4477@magnolia \
--to=darrick.wong@oracle.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