Re: Linux kernel API about sector count

2013-11-11 Thread Davidlohr Bueso
On Tue, 2013-11-12 at 10:52 +0800, 韩磊 wrote: > I need a API in linux kernel about the disk's total count of > sector,not the sector size. > thank you! Have you even tried searching through the code? Take a look at how fdisk or blockdev or any other tool that deals with devices get the total secto

Re: Linux kernel API about sector count

2013-11-11 Thread 韩磊
I need a API in linux kernel about the disk's total count of sector,not the sector size. thank you! 2013/11/11 韩磊 : > Thank you! I need disk's total count of sector,not the sector size. > > 2013/11/11 Mihai Donțu : >> On Mon, 11 Nov 2013 20:31:14 +0800 韩磊 wrote: >>> Can you tell me the API about

Re: Linux kernel API about sector count

2013-11-11 Thread 韩磊
Thank you! I need disk's total count of sector,not the sector size. 2013/11/11 Mihai Donțu : > 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

Re: Linux kernel API about sector count

2013-11-11 Thread Mihai Donțu
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 Th

Linux kernel API about sector count

2013-11-11 Thread 韩磊
Can you tell me the API about the count of sector in linux kernel? which .h file and function? Thank you! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info