All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Cc: hch@lst.de, linux-nvme@lists.infradead.org, sagi@grimberg.me
Subject: Re: [PATCH 1/3] nvmet: add helper to revalidate bdev and file ns
Date: Wed, 6 May 2020 09:11:18 +0200	[thread overview]
Message-ID: <20200506071118.GA12145@lst.de> (raw)
In-Reply-To: <20200506014629.39509-2-chaitanya.kulkarni@wdc.com>

On Tue, May 05, 2020 at 06:46:27PM -0700, Chaitanya Kulkarni wrote:
> -int nvmet_file_ns_revalidate(struct nvmet_ns *ns)
> +bool nvmet_file_ns_revalidate(struct nvmet_ns *ns, int *retp)
>  {
> +	loff_t oldsize = ns->size;
>  	struct kstat stat;
>  	int ret;
>  
> @@ -22,7 +23,11 @@ int nvmet_file_ns_revalidate(struct nvmet_ns *ns)
>  			  AT_STATX_FORCE_SYNC);
>  	if (!ret)
>  		ns->size = stat.size;
> -	return ret;
> +
> +	if (retp)
> +		*retp = ret;
> +
> +	return oldsize != ns->size ? true : false;

I find the calling convention really weird.  I'd always return the
error over the bool, as a bool *size_changed is a lot more descriptive.

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2020-05-06  7:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06  1:46 [PATCH 0/3] nvmet: add target ns revalidate support Chaitanya Kulkarni
2020-05-06  1:46 ` [PATCH 1/3] nvmet: add helper to revalidate bdev and file ns Chaitanya Kulkarni
2020-05-06  7:11   ` Christoph Hellwig [this message]
2020-05-06 23:41     ` Chaitanya Kulkarni
2020-05-06  1:46 ` [PATCH 2/3] nvmet: on ns size change generate AEN from configfs Chaitanya Kulkarni
2020-05-06  7:13   ` Christoph Hellwig
2020-05-06 23:42     ` Chaitanya Kulkarni
2020-05-06  1:46 ` [PATCH 3/3] nvmet: add async event tracing support Chaitanya Kulkarni
2020-05-06  7:14   ` Christoph Hellwig
2020-05-06 23:43     ` Chaitanya Kulkarni

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=20200506071118.GA12145@lst.de \
    --to=hch@lst.de \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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.