All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: dm-devel@redhat.com, "Alasdair G. Kergon" <agk@redhat.com>
Subject: Re: [PATCH v2] dm: Fix alignment stacking on partitioned devices
Date: Tue, 5 Jan 2010 22:03:57 -0500	[thread overview]
Message-ID: <20100106030357.GB16154@redhat.com> (raw)
In-Reply-To: <20100106025731.GA16154@redhat.com>

On Tue, Jan 05 2010 at  9:57pm -0500,
Mike Snitzer <snitzer@redhat.com> wrote:

> On Tue, Jan 05 2010 at  9:23pm -0500,
> Martin K. Petersen <martin.petersen@oracle.com> wrote:
> 
> > >>>>> "Alasdair" == Alasdair G Kergon <agk@redhat.com> writes:
> > 
> > Alasdair> extern int blk_stack_limits(struct queue_limits *t, struct
> > Alasdair> queue_limits *b,
> > Alasdair>                             sector_t offset);
> > 
> > Alasdair> This function is asking for the offset to be supplied as
> > Alasdair> sector_t i.e.  in units of sectors, but this patch uses bytes.
> > Alasdair> Please either change that to sectors as per the prototype, or
> > Alasdair> if it really does want bytes, fix the prototype to make that
> > Alasdair> clear.
> > 
> > It is sector_t because we don't have an existing type that fits the bill
> > (i.e. >= sector_t and dependent on whether LBD is on or not).  We're
> > trying to move away from counting in sectors because the notion is
> > confusing in the light of the logical vs. physical block size, device
> > alignment reporting, etc.
> > 
> > So maybe something like this?
> > 
> > 
> > block: Introduce blk_off_t
> > 
> > There are several places we want to communicate alignment and offsets in
> > bytes to avoid confusion with regards to underlying physical and logical
> > block sizes.  Introduce blk_off_t for block device byte offsets.
> > 
> > Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> ...
> > diff --git a/include/linux/types.h b/include/linux/types.h
> > index c42724f..729f87a 100644
> > --- a/include/linux/types.h
> > +++ b/include/linux/types.h
> > @@ -134,9 +134,11 @@ typedef		__s64		int64_t;
> >  #ifdef CONFIG_LBDAF
> >  typedef u64 sector_t;
> >  typedef u64 blkcnt_t;
> > +typedef u64 blk_off_t;
> >  #else
> >  typedef unsigned long sector_t;
> >  typedef unsigned long blkcnt_t;
> > +typedef unsigned long blk_off_t;
> >  #endif
> >  
> >  /*
> 
> After looking closer there seems to be various type inconsistencies in
> the alignment_offset and discard_alignment related routines (returning
> 'int' in places, etc).
> 
> The following patch is what I found; I have no problem with switching
> from 'unsigned long' to blk_off_t for LBD though.
> 
> Martin, would like to carry forward with this?  Have I gone overboard
> with this patch?

I missed fixing disk_stack_limits()'s 'offset' though...

Mike

  reply	other threads:[~2010-01-06  3:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-23 18:07 [PATCH v2] dm: Fix alignment stacking on partitioned devices Mike Snitzer
2009-12-23 19:21 ` Mike Snitzer
2010-01-05 18:04 ` Alasdair G Kergon
2010-01-05 18:27 ` Alasdair G Kergon
2010-01-06  2:23   ` Martin K. Petersen
2010-01-06  2:57     ` Mike Snitzer
2010-01-06  3:03       ` Mike Snitzer [this message]
2010-01-06  3:24       ` Martin K. Petersen
2010-01-06  4:10         ` Mike Snitzer
2010-01-06  4:16           ` Martin K. Petersen
2010-01-06  5:16             ` Mike Snitzer
2010-01-06  8:39               ` Martin K. Petersen
2010-01-06 13:25                 ` Mike Snitzer
2010-01-07 17:15                   ` Martin K. Petersen
2010-01-07 18:55                     ` Mike Snitzer
2010-01-08 18:41                       ` Martin K. Petersen
2010-01-08 20:28                         ` Mike Snitzer
2010-01-09  0:01                   ` [PATCH] block: bdev_stack_limits wrapper and DM topology fixes Mike Snitzer
2010-01-06 13:55                 ` [PATCH v2] dm: Fix alignment stacking on partitioned devices Alasdair G Kergon

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=20100106030357.GB16154@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=martin.petersen@oracle.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.