From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Nikolay Borisov <nborisov@suse.com>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/4] fiemap: Introduce get_extent_count
Date: Wed, 23 Aug 2017 10:05:33 -0700 [thread overview]
Message-ID: <20170823170533.GY4796@magnolia> (raw)
In-Reply-To: <1503501082-16983-2-git-send-email-nborisov@suse.com>
On Wed, Aug 23, 2017 at 06:11:20PM +0300, Nikolay Borisov wrote:
> This function will be used in future patches and will aid in implementing
> ranged fiemap queries
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
> io/fiemap.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/io/fiemap.c b/io/fiemap.c
> index d1584aba7818..30c49112e089 100644
> --- a/io/fiemap.c
> +++ b/io/fiemap.c
> @@ -193,6 +193,22 @@ calc_print_format(
> }
> }
>
> +/* Use ssize so that we can return also an error code in case the ioctl fails */
> +static ssize_t
> +get_extent_count(int fd, __u64 startoffset, __u64 len)
Argument indentation -- this should be:
static ssize_t
get_extent_count(
int fd
__u64 startoffset,
__u64 len)
{
to match the rest of the file.
> +{
> + struct fiemap fiemap = { 0 } ;
Needs space between variable declaration and code.
> + fiemap.fm_start = startoffset;
> + fiemap.fm_length = len;
> + if (ioctl(fd, FS_IOC_FIEMAP, (unsigned long)&fiemap) < 0) {
> + fprintf(stderr, _("%s: Failed to query fiemap extent count.\n"),
> + progname);
perror/strerror to print the exact error code?
--D
> + return -1;
> + }
> +
> + return fiemap.fm_mapped_extents;
> +}
> +
> int
> fiemap_f(
> int argc,
> --
> 2.7.4
>
> --
> 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-23 17:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 11:55 [PATCH] fiemap: Refactor fiemap + implement range parameters Nikolay Borisov
2017-08-22 6:41 ` Nikolay Borisov
2017-08-22 19:11 ` Eric Sandeen
2017-08-23 8:07 ` Nikolay Borisov
2017-08-23 15:11 ` [PATCH 1/4] fiemap: Move global variables out of function scope Nikolay Borisov
2017-08-23 15:11 ` [PATCH 2/4] fiemap: Introduce get_extent_count Nikolay Borisov
2017-08-23 17:05 ` Darrick J. Wong [this message]
2017-08-23 15:11 ` [PATCH 3/4] fiemap: Simplify internals of fiemap_f Nikolay Borisov
2017-08-23 15:51 ` Eric Sandeen
2017-08-23 17:17 ` Eric Sandeen
2017-08-23 15:11 ` [PATCH 4/4] fiemap: Add support for ranged query Nikolay Borisov
2017-08-23 19:12 ` Eric Sandeen
2017-08-23 15:49 ` [PATCH 1/4] fiemap: Move global variables out of function scope Eric Sandeen
2017-08-23 22:36 ` 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=20170823170533.GY4796@magnolia \
--to=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=nborisov@suse.com \
--cc=sandeen@sandeen.net \
/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