From: "Mihai Donțu" <mihai.dontu@gmail.com>
To: 韩磊 <bonben1989@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Linux kernel API about sector count
Date: Mon, 11 Nov 2013 15:05:07 +0200 [thread overview]
Message-ID: <20131111150507.0bb1083e@mdontu-l> (raw)
In-Reply-To: <CAK2Ky6yh6U1wiAAPC9TgWduzO4NS9Km0FGgRvMntTm=qYkWt7A@mail.gmail.com>
On Mon, 11 Nov 2013 20:31:14 +0800 韩磊 wrote:
> Can you tell me the API about the count of sector in linux kernel?
>
> which .h file and function?
>
Looking at fdisk (util-linux) there are several ioctls:
* HDIO_GETGEO (linux/hdreg.h)
* BLKGETSIZE64 (linux/fs.h), sector size is assumed 512
The HDIO interface *seems* to be legacy:
http://www.mjmwired.net/kernel/Documentation/ioctl/hdio.txt
Also see:
https://git.kernel.org/cgit/utils/util-linux/util-linux.git/tree/fdisks/fdisk.c
I hope this helps a bit.
--
Mihai Donțu
next prev parent reply other threads:[~2013-11-11 13:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-11 12:31 韩磊
2013-11-11 13:05 ` Mihai Donțu [this message]
2013-11-11 13:17 ` 韩磊
2013-11-12 2:52 ` 韩磊
2013-11-12 4:54 ` Davidlohr Bueso
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=20131111150507.0bb1083e@mdontu-l \
--to=mihai.dontu@gmail.com \
--cc=bonben1989@gmail.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®