All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Andrey Albershteyn <aalbersh@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH 1/2] libblkid: add interface for FSSIZE field
Date: Mon, 25 Apr 2022 15:40:39 +0200	[thread overview]
Message-ID: <20220425134039.4gmgdudcbdhftc7k@ws.net.home> (raw)
In-Reply-To: <20220421130946.318737-2-aalbersh@redhat.com>

On Thu, Apr 21, 2022 at 03:09:45PM +0200, Andrey Albershteyn wrote:
> +int blkid_probe_set_fssize(blkid_probe pr, unsigned long long size)

I'd prefer uint64_t  rather than unsigned long long


> +{
> +	struct blkid_chain *chn = blkid_probe_get_chain(pr);
> +	char u[20];
> +
> +	if (!(chn->flags & BLKID_SUBLKS_FSSIZE))
> +		return 0;
> +
> +	snprintf(u, sizeof(u), "%llu", size);
> +
> +	return blkid_probe_set_value(pr, "FSSIZE", (unsigned char *) u, strlen(u) + 1);
> +}

  return blkid_probe_sprintf_value(pr, "FSSIZE", "%" PRIu64, size);

and you not need snprintf(), etc.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


  reply	other threads:[~2022-04-25 13:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 13:09 [PATCH 0/2] libblkid: add FSSIZE with XFS implementation Andrey Albershteyn
2022-04-21 13:09 ` [PATCH 1/2] libblkid: add interface for FSSIZE field Andrey Albershteyn
2022-04-25 13:40   ` Karel Zak [this message]
2022-04-21 13:09 ` [PATCH 2/2] libblkid: implement FSSIZE calculation for XFS Andrey Albershteyn
2022-04-25 13:43 ` [PATCH 0/2] libblkid: add FSSIZE with XFS implementation Karel Zak
2022-04-25 15:38   ` Eric Sandeen
2022-04-26  8:21     ` Karel Zak
     [not found]       ` <YmfPPbgZtZi1iSXv@aalbersh.remote.csb>
2022-04-27  4:10         ` Eric Sandeen
2022-04-29  8:43           ` Karel Zak

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=20220425134039.4gmgdudcbdhftc7k@ws.net.home \
    --to=kzak@redhat.com \
    --cc=aalbersh@redhat.com \
    --cc=util-linux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.