public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Getting HDD serial in kernel space
@ 2009-11-14 11:34 Andrey Polovov
  2009-11-14 15:28 ` Alan Cox
  2009-11-15 14:03 ` Andrey Polovov
  0 siblings, 2 replies; 4+ messages in thread
From: Andrey Polovov @ 2009-11-14 11:34 UTC (permalink / raw)
  To: linux-kernel

Hello.

I had a necessity to get HDD serial number in my kernel module.
In user space I can do it so:

    fd = open( "/dev/sda", O_RDONLY|O_NONBLOCK );
    ioctl( fd, HDIO_GET_IDENTITY, &id );
    printf( "Serial: %s", id.serial_no );

How can I do it in kernel space (it is one hdd in machine, plugged with
SATA)?


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-15 17:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-14 11:34 Getting HDD serial in kernel space Andrey Polovov
2009-11-14 15:28 ` Alan Cox
2009-11-15 14:03 ` Andrey Polovov
2009-11-15 17:05   ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox