All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org,
	dm-devel@redhat.com, linux-block@vger.kernel.org
Subject: Re: [RFC PATCH 1/9] block: add block_device_operations methods to set and get reserved space
Date: Tue, 22 Mar 2016 08:05:49 -0400	[thread overview]
Message-ID: <20160322120548.GA51718@bfoster.bfoster> (raw)
In-Reply-To: <20160321215333.GM11812@dastard>

Re-add dm-devel@redhat.com, linux-block@vger.kernel.org to CC.

On Tue, Mar 22, 2016 at 08:53:33AM +1100, Dave Chinner wrote:
> On Mon, Mar 21, 2016 at 01:08:29PM +0100, Carlos Maiolino wrote:
> > Hi,
> > 
> > Good news about this interface, I just have a small suggestion in this patch:
> > 
> > On Thu, Mar 17, 2016 at 10:30:29AM -0400, Brian Foster wrote:
> > > From: Mike Snitzer <snitzer@redhat.com>
> > > 
> > > Signed-off-by: Mike Snitzer <snitzer@redhat.com>
> > > ---
> > >  fs/block_dev.c         | 20 ++++++++++++++++++++
> > >  include/linux/blkdev.h |  5 +++++
> > >  2 files changed, 25 insertions(+)
> > > 
> > > diff --git a/fs/block_dev.c b/fs/block_dev.c
> > > index 826b164..375a2e4 100644
> > > --- a/fs/block_dev.c
> > > +++ b/fs/block_dev.c
> > > @@ -497,6 +497,26 @@ long bdev_direct_access(struct block_device *bdev, struct blk_dax_ctl *dax)
> > >  }
> > >  EXPORT_SYMBOL_GPL(bdev_direct_access);
> > >  
> > > +int blk_reserve_space(struct block_device *bdev, sector_t nr_sects)
> > > +{
> > > +	const struct block_device_operations *ops = bdev->bd_disk->fops;
> > > +
> > > +	if (!ops->reserve_space)
> > > +		return -EOPNOTSUPP;
> > > +	return ops->reserve_space(bdev, nr_sects);
> > > +}
> > > +EXPORT_SYMBOL_GPL(blk_reserve_space);
> > 
> > Wouldn't be better to have this function name standardized accordingly to the
> > next one? Something like blk_set_reserved_space() maybe?
> 
> Personally I see no point in wrappers like this. We don't add
> wrappers for ops methods in any other layers of the stack,
> filesystems are quite capable of checking if the method is available
> directly, so it seems pretty pointless to me...
> 

I don't have too much of a preference, personally. I think these were
slapped together fairly quickly just to get some kind of mechanism
exposed. I was thinking more of combining them into a single method that
takes a signed value for a reservation delta rather than an absolute
value and simultaneously supports the ability to adjust or retrieve the
current reservation.

Unless I hear other thoughts or objections, I can probably clean that up
and drop the wrappers for a subsequent post as I have some other fixes
pending as well.

Brian

> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Brian Foster <bfoster@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
	dm-devel@redhat.com, xfs@oss.sgi.com
Subject: Re: [RFC PATCH 1/9] block: add block_device_operations methods to set and get reserved space
Date: Tue, 22 Mar 2016 08:05:49 -0400	[thread overview]
Message-ID: <20160322120548.GA51718@bfoster.bfoster> (raw)
In-Reply-To: <20160321215333.GM11812@dastard>

Re-add dm-devel@redhat.com, linux-block@vger.kernel.org to CC.

On Tue, Mar 22, 2016 at 08:53:33AM +1100, Dave Chinner wrote:
> On Mon, Mar 21, 2016 at 01:08:29PM +0100, Carlos Maiolino wrote:
> > Hi,
> > 
> > Good news about this interface, I just have a small suggestion in this patch:
> > 
> > On Thu, Mar 17, 2016 at 10:30:29AM -0400, Brian Foster wrote:
> > > From: Mike Snitzer <snitzer@redhat.com>
> > > 
> > > Signed-off-by: Mike Snitzer <snitzer@redhat.com>
> > > ---
> > >  fs/block_dev.c         | 20 ++++++++++++++++++++
> > >  include/linux/blkdev.h |  5 +++++
> > >  2 files changed, 25 insertions(+)
> > > 
> > > diff --git a/fs/block_dev.c b/fs/block_dev.c
> > > index 826b164..375a2e4 100644
> > > --- a/fs/block_dev.c
> > > +++ b/fs/block_dev.c
> > > @@ -497,6 +497,26 @@ long bdev_direct_access(struct block_device *bdev, struct blk_dax_ctl *dax)
> > >  }
> > >  EXPORT_SYMBOL_GPL(bdev_direct_access);
> > >  
> > > +int blk_reserve_space(struct block_device *bdev, sector_t nr_sects)
> > > +{
> > > +	const struct block_device_operations *ops = bdev->bd_disk->fops;
> > > +
> > > +	if (!ops->reserve_space)
> > > +		return -EOPNOTSUPP;
> > > +	return ops->reserve_space(bdev, nr_sects);
> > > +}
> > > +EXPORT_SYMBOL_GPL(blk_reserve_space);
> > 
> > Wouldn't be better to have this function name standardized accordingly to the
> > next one? Something like blk_set_reserved_space() maybe?
> 
> Personally I see no point in wrappers like this. We don't add
> wrappers for ops methods in any other layers of the stack,
> filesystems are quite capable of checking if the method is available
> directly, so it seems pretty pointless to me...
> 

I don't have too much of a preference, personally. I think these were
slapped together fairly quickly just to get some kind of mechanism
exposed. I was thinking more of combining them into a single method that
takes a signed value for a reservation delta rather than an absolute
value and simultaneously supports the ability to adjust or retrieve the
current reservation.

Unless I hear other thoughts or objections, I can probably clean that up
and drop the wrappers for a subsequent post as I have some other fixes
pending as well.

Brian

> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2016-03-22 12:05 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17 14:30 [RFC PATCH 0/9] dm-thin/xfs: prototype a block reservation allocation model Brian Foster
2016-03-17 14:30 ` Brian Foster
2016-03-17 14:30 ` [RFC PATCH 1/9] block: add block_device_operations methods to set and get reserved space Brian Foster
2016-03-17 14:30   ` Brian Foster
2016-03-21 12:08   ` Carlos Maiolino
2016-03-21 12:08     ` Carlos Maiolino
2016-03-21 21:53     ` Dave Chinner
2016-03-21 21:53       ` Dave Chinner
2016-03-22 12:05       ` Brian Foster [this message]
2016-03-22 12:05         ` Brian Foster
2016-03-17 14:30 ` [RFC PATCH 2/9] dm: add " Brian Foster
2016-03-17 14:30   ` Brian Foster
2016-03-21 12:17   ` Carlos Maiolino
2016-03-21 12:17     ` Carlos Maiolino
2016-03-17 14:30 ` [RFC PATCH 3/9] dm thin: " Brian Foster
2016-03-17 14:30   ` Brian Foster
2016-03-17 14:30 ` [RFC PATCH 4/9] dm thin: update reserve space func to allow reduction Brian Foster
2016-03-17 14:30   ` Brian Foster
2016-03-17 14:30 ` [RFC PATCH 5/9] block: add a block_device_operations method to provision space Brian Foster
2016-03-17 14:30   ` Brian Foster
2016-03-17 14:30 ` [RFC PATCH 6/9] dm: add " Brian Foster
2016-03-17 14:30   ` Brian Foster
2016-03-17 14:30 ` [RFC PATCH 7/9] dm thin: " Brian Foster
2016-03-17 14:30   ` Brian Foster
2016-03-17 14:30 ` [RFC PATCH 8/9] xfs: thin block device reservation mechanism Brian Foster
2016-03-17 14:30   ` Brian Foster
2016-03-17 14:30 ` [RFC PATCH 9/9] xfs: adopt a reserved allocation model on dm-thin devices Brian Foster
2016-03-17 14:30   ` Brian Foster
2016-03-21 13:33 ` [RFC PATCH 0/9] dm-thin/xfs: prototype a block reservation allocation model Carlos Maiolino
2016-03-21 13:33   ` Carlos Maiolino
2016-03-21 22:36   ` Dave Chinner
2016-03-21 22:36     ` Dave Chinner
2016-03-22 12:06     ` Brian Foster
2016-03-22 12:06       ` Brian Foster

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=20160322120548.GA51718@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=david@fromorbit.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --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 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.