public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Roger Gammans <roger@computer-surgery.co.uk>
Cc: Randy Dunlap <rdunlap@xenotime.net>, Zach Brown <zab@zabbo.net>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: fs/bio.c - Hardcoded sector size ?
Date: Sat, 30 Sep 2006 21:31:59 +0200	[thread overview]
Message-ID: <20060930193158.GA5670@kernel.dk> (raw)
In-Reply-To: <20060929172558.GB4478@julia.computer-surgery.co.uk>

On Fri, Sep 29 2006, Roger Gammans wrote:
> On Fri, Sep 29, 2006 at 01:32:05PM -0700, Randy Dunlap wrote:
> > > How about adding kerneldoc for sector_t itself?
> > 
> > Good idea, but afaik it would have to be added for the entire
> > struct, not just one field.
> 
> sector_t 's a simple typedef from unsigned long or u64 depending on
> config rather than a struct - will kerneldoc still pick up the comments
> on theese?
> 
> Assuming it will I suggest the following. I've kept my shorter text in
> the bi_sector field as it is now more fully explained with sector_t.
> 
> 
> Signed-Off-By: Roger Gammans <rgammans@computer-surgery.co.uk>
> 
> diff --git a/include/linux/bio.h b/include/linux/bio.h
> index 76bdaea..77a8e6b 100644
> --- a/include/linux/bio.h
> +++ b/include/linux/bio.h
> @@ -70,7 +70,8 @@ typedef void (bio_destructor_t) (struct
>   * stacking drivers)
>   */
>  struct bio {
> -       sector_t                bi_sector;
> +       sector_t                bi_sector;      /* device address in 512 byte
> +                                                  sectors */
>         struct bio              *bi_next;       /* request queue link */
>         struct block_device     *bi_bdev;
>         unsigned long           bi_flags;       /* status, command, etc
> */
> diff --git a/include/linux/types.h b/include/linux/types.h
> index 3f23566..0ddfa1a 100644
> --- a/include/linux/types.h
> +++ b/include/linux/types.h
> @@ -127,8 +127,12 @@ #endif
>  /* this is a special 64bit data type that is 8-byte aligned */
>  #define aligned_u64 unsigned long long __attribute__((aligned(8)))
> 
> -/*
> +/**
>   * The type used for indexing onto a disc or disc partition.
> + *
> + * Linux always considers sectors to be 512 bytes long independently
> + * of the devices real block size.
> + *
>   * If required, asm/types.h can override it and define
>   * HAVE_SECTOR_T
>   */

Looks fine to me, I'll add it (although I tend to prefer disk :-)

-- 
Jens Axboe


      reply	other threads:[~2006-09-30 19:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-28 18:22 fs/bio.c - Hardcoded sector size ? Roger Gammans
2006-09-29 18:38 ` Randy Dunlap
2006-09-28 18:58   ` linux-kernel-owner
2006-09-29 19:11     ` Randy Dunlap
2006-09-28 19:19       ` Roger Gammans
2006-09-29 19:37         ` Randy Dunlap
2006-09-28 19:56           ` Roger Gammans
2006-09-29 20:17             ` Randy Dunlap
2006-09-29 20:22               ` Zach Brown
2006-09-29 20:32                 ` Randy Dunlap
2006-09-29 17:25                   ` Roger Gammans
2006-09-30 19:31                     ` Jens Axboe [this message]

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=20060930193158.GA5670@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=roger@computer-surgery.co.uk \
    --cc=zab@zabbo.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