From: Dave Chinner <david@fromorbit.com>
To: Jan Tulak <jtulak@redhat.com>
Cc: hch@infradead.org, xfs@oss.sgi.com
Subject: Re: [PATCH v3 10/11] xfsprogs: replace obsolete memalign with posix_memalign
Date: Thu, 6 Aug 2015 08:57:03 +1000 [thread overview]
Message-ID: <20150805225703.GY16638@dastard> (raw)
In-Reply-To: <1438612789-17486-11-git-send-email-jtulak@redhat.com>
On Mon, Aug 03, 2015 at 04:39:48PM +0200, Jan Tulak wrote:
> Memalign from <malloc.h> was marked obsolete in favor of a posix
> variant from <stdlib.h>. So replace all calls and remove <malloc.h>
> includes. This also enhances support on other posix platforms,
> which doesn't have <malloc.h>.
>
> Because posix_memalign returns any error as a return code, not in
> errno, change relevant checks in code (and add a missing one).
....
> @@ -74,12 +74,18 @@ libxfs_device_zero(struct xfs_buftarg *btp, xfs_daddr_t start, uint len)
> ssize_t zsize, bytes;
> char *z;
> int fd;
> + int ret;
>
> zsize = min(BDSTRAT_SIZE, BBTOB(len));
> - if ((z = memalign(libxfs_device_alignment(), zsize)) == NULL) {
> + ret = posix_memalign(
> + (void **)&z,
> + libxfs_device_alignment(),
> + zsize
> + );
Unusual function call formatting. Please use the form the rest of
the code uses. i.e:
ret = posix_memalign((void **)&z, libxfs_device_alignment(), zsize);
(same for the rest of the patch).
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2015-08-05 22:57 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-03 14:39 [PATCH v3 00/11] xfsprogs: OS X partial support Jan Tulak
2015-08-03 14:39 ` [PATCH v2 01/11] xfsprogs: Don't Make .po files with gettext disabled Jan Tulak
2015-08-03 14:39 ` [PATCH v2 02/11] xfsprogs: Use glibtoolize on osx Jan Tulak
2015-08-03 14:39 ` [PATCH v3 03/11] xfsprogs: undefined variable fix Jan Tulak
2015-08-04 8:41 ` Christoph Hellwig
2015-08-03 14:39 ` [PATCH v3 04/11] xfsprogs: Add ifdef dirent checks where it was missing Jan Tulak
2015-08-04 8:46 ` Christoph Hellwig
2015-08-04 9:21 ` Jan Tulak
2015-08-04 9:25 ` [PATCH v4 " Jan Tulak
2015-08-04 11:18 ` Christoph Hellwig
2015-08-04 14:19 ` Jan Tulak
2015-08-04 23:00 ` Dave Chinner
2015-08-05 9:49 ` Jan Tulak
2015-08-05 9:48 ` [PATCH v5 " Jan Tulak
2015-08-03 14:39 ` [PATCH v3 05/11] xfsprogs: Change OS X-specific CFLAGS/LDFLAGS Jan Tulak
2015-08-04 11:17 ` Christoph Hellwig
2015-08-03 14:39 ` [PATCH v3 06/11] xfsprogs: Add includes required for OS X builds Jan Tulak
2015-08-04 11:18 ` Christoph Hellwig
2015-08-13 14:07 ` [PATCH " Jan Tulak
2015-08-03 14:39 ` [PATCH v3 07/11] xfsprogs: missing and dummy calls for OS X support Jan Tulak
2015-08-03 14:39 ` [PATCH v3 08/11] xfsprogs: Add fls check into autoconf Jan Tulak
2015-08-04 11:21 ` Christoph Hellwig
2015-08-04 12:12 ` Jan Tulak
2015-08-14 12:59 ` Jan Tulak
2015-08-17 15:02 ` [PATCH v4 03/11] " Jan Tulak
2015-08-03 14:39 ` [PATCH v3 09/11] xfsprogs: Add mntent.h " Jan Tulak
2015-08-04 11:21 ` Christoph Hellwig
2015-08-17 15:01 ` [PATCH v4 " Jan Tulak
2015-08-17 15:04 ` Christoph Hellwig
2015-08-17 15:15 ` Jan Tulak
2015-08-03 14:39 ` [PATCH v3 10/11] xfsprogs: replace obsolete memalign with posix_memalign Jan Tulak
2015-08-05 22:57 ` Dave Chinner [this message]
2015-08-13 14:08 ` [PATCH " Jan Tulak
2015-08-03 14:39 ` [PATCH v2 11/11] xfsprogs: Prefix LIST_... macros to XFS_LIST_ Jan Tulak
2015-08-04 9:01 ` [PATCH v4 11/11] xfsprogs: prevent LIST_ macros conflicts Jan Tulak
2015-08-04 11:22 ` Christoph Hellwig
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=20150805225703.GY16638@dastard \
--to=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=jtulak@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