aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy_proc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-15 13:01:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-15 13:01:16 -0400
commit0cb583fd2862f19ea88b02eb307d11c09e51e2f8 (patch)
tree740769ab145ed72af4d00ea8e4d55ebcef337fce /drivers/ide/ide-floppy_proc.c
parent723e9db7a46e328527cc3da2b478b831184fe828 (diff)
parenta2d10568fd3965fffeb29a3a6f29966dd3801727 (diff)
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.c30
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 @@
1#include <linux/kernel.h> 1#include <linux/kernel.h>
2#include <linux/ide.h> 2#include <linux/ide.h>
3#include <linux/seq_file.h>
3 4
4#include "ide-floppy.h" 5#include "ide-floppy.h"
5 6
6static int proc_idefloppy_read_capacity(char *page, char **start, off_t off, 7static int idefloppy_capacity_proc_show(struct seq_file *m, void *v)
7 int count, int *eof, void *data)
8{ 8{
9 ide_drive_t*drive = (ide_drive_t *)data; 9 ide_drive_t*drive = (ide_drive_t *)m->private;
10 int len;
11 10
12 len = sprintf(page, "%llu\n", (long long)ide_gd_capacity(drive)); 11 seq_printf(m, "%llu\n", (long long)ide_gd_capacity(drive));
13 PROC_IDE_READ_RETURN(page, start, off, count, eof, len); 12 return 0;
14} 13}
15 14
15static int idefloppy_capacity_proc_open(struct inode *inode, struct file *file)
16{
17 return single_open(file, idefloppy_capacity_proc_show, PDE(inode)->data);
18}
19
20static const struct file_operations idefloppy_capacity_proc_fops = {
21 .owner = THIS_MODULE,
22 .open = idefloppy_capacity_proc_open,
23 .read = seq_read,
24 .llseek = seq_lseek,
25 .release = single_release,
26};
27
16ide_proc_entry_t ide_floppy_proc[] = { 28ide_proc_entry_t ide_floppy_proc[] = {
17 { "capacity", S_IFREG|S_IRUGO, proc_idefloppy_read_capacity, NULL }, 29 { "capacity", S_IFREG|S_IRUGO, &idefloppy_capacity_proc_fops },
18 { "geometry", S_IFREG|S_IRUGO, proc_ide_read_geometry, NULL }, 30 { "geometry", S_IFREG|S_IRUGO, &ide_geometry_proc_fops },
19 { NULL, 0, NULL, NULL } 31 {}
20}; 32};
21 33
22ide_devset_rw_field(bios_cyl, bios_cyl); 34ide_devset_rw_field(bios_cyl, bios_cyl);