diff options
author | Linus Torvalds | 2009-09-15 19:01:16 +0200 |
---|---|---|
committer | Linus Torvalds | 2009-09-15 19:01:16 +0200 |
commit | 0cb583fd2862f19ea88b02eb307d11c09e51e2f8 (patch) | |
tree | 740769ab145ed72af4d00ea8e4d55ebcef337fce /drivers/ide/ide-floppy_proc.c | |
parent | Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/pow... (diff) | |
parent | ide: fixup for fujitsu disk (diff) | |
download | kernel-qcow2-linux-0cb583fd2862f19ea88b02eb307d11c09e51e2f8.tar.gz kernel-qcow2-linux-0cb583fd2862f19ea88b02eb307d11c09e51e2f8.tar.xz kernel-qcow2-linux-0cb583fd2862f19ea88b02eb307d11c09e51e2f8.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-next-2.6:
ide: fixup for fujitsu disk
ide: convert to ->proc_fops
at91_ide: remove headers specific for at91sam9263
IDE: palm_bk3710: convert clock usage after clkdev conversion
ide: fix races in handling of user-space SET XFER commands
ide: allow ide_dev_read_id() to be called from the IRQ context
ide: ide-taskfile.c fix style problems
drivers/ide/ide-cd.c: Use DIV_ROUND_CLOSEST
ide-tape: fix handling of postponed rqs
ide-tape: convert to ide_debug_log macro
ide-tape: fix debug call
ide: Fix annoying warning in ide_pio_bytes().
IDE: Save a call to PageHighMem()
Diffstat (limited to 'drivers/ide/ide-floppy_proc.c')
-rw-r--r-- | drivers/ide/ide-floppy_proc.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/drivers/ide/ide-floppy_proc.c b/drivers/ide/ide-floppy_proc.c index fcd4d8153df5..d711d9b883de 100644 --- a/drivers/ide/ide-floppy_proc.c +++ b/drivers/ide/ide-floppy_proc.c @@ -1,22 +1,34 @@ #include <linux/kernel.h> #include <linux/ide.h> +#include <linux/seq_file.h> #include "ide-floppy.h" -static int proc_idefloppy_read_capacity(char *page, char **start, off_t off, - int count, int *eof, void *data) +static int idefloppy_capacity_proc_show(struct seq_file *m, void *v) { - ide_drive_t*drive = (ide_drive_t *)data; - int len; + ide_drive_t*drive = (ide_drive_t *)m->private; - len = sprintf(page, "%llu\n", (long long)ide_gd_capacity(drive)); - PROC_IDE_READ_RETURN(page, start, off, count, eof, len); + seq_printf(m, "%llu\n", (long long)ide_gd_capacity(drive)); + return 0; } +static int idefloppy_capacity_proc_open(struct inode *inode, struct file *file) +{ + return single_open(file, idefloppy_capacity_proc_show, PDE(inode)->data); +} + +static const struct file_operations idefloppy_capacity_proc_fops = { + .owner = THIS_MODULE, + .open = idefloppy_capacity_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + ide_proc_entry_t ide_floppy_proc[] = { - { "capacity", S_IFREG|S_IRUGO, proc_idefloppy_read_capacity, NULL }, - { "geometry", S_IFREG|S_IRUGO, proc_ide_read_geometry, NULL }, - { NULL, 0, NULL, NULL } + { "capacity", S_IFREG|S_IRUGO, &idefloppy_capacity_proc_fops }, + { "geometry", S_IFREG|S_IRUGO, &ide_geometry_proc_fops }, + {} }; ide_devset_rw_field(bios_cyl, bios_cyl); |