diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2009-09-01 20:52:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-01 20:52:57 -0400 |
commit | 6d703a81ad5fdd102334751ddacb053ecc6ff046 (patch) | |
tree | 1bebde3a0c34677296dc4784e800445ea02b4f0a /include/linux | |
parent | 76fbebfbb593bd66780db0a808afe1d21c7ff6d6 (diff) |
ide: convert to ->proc_fops
->read_proc, ->write_proc are going away, ->proc_fops should be used instead.
The only tricky place is IDENTIFY handling: if for some reason
taskfile_lib_get_identify() fails, buffer _is_ changed and at least
first byte is overwritten. Emulate old behaviour with returning
that first byte to userspace and reporting length=1 despite overall -E.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ide.h | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 803c1ae31237..e4135d6e0556 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -919,8 +919,7 @@ __IDE_PROC_DEVSET(_name, _min, _max, NULL, NULL) | |||
919 | typedef struct { | 919 | typedef struct { |
920 | const char *name; | 920 | const char *name; |
921 | mode_t mode; | 921 | mode_t mode; |
922 | read_proc_t *read_proc; | 922 | const struct file_operations *proc_fops; |
923 | write_proc_t *write_proc; | ||
924 | } ide_proc_entry_t; | 923 | } ide_proc_entry_t; |
925 | 924 | ||
926 | void proc_ide_create(void); | 925 | void proc_ide_create(void); |
@@ -932,24 +931,8 @@ void ide_proc_unregister_port(ide_hwif_t *); | |||
932 | void ide_proc_register_driver(ide_drive_t *, struct ide_driver *); | 931 | void ide_proc_register_driver(ide_drive_t *, struct ide_driver *); |
933 | void ide_proc_unregister_driver(ide_drive_t *, struct ide_driver *); | 932 | void ide_proc_unregister_driver(ide_drive_t *, struct ide_driver *); |
934 | 933 | ||
935 | read_proc_t proc_ide_read_capacity; | 934 | extern const struct file_operations ide_capacity_proc_fops; |
936 | read_proc_t proc_ide_read_geometry; | 935 | extern const struct file_operations ide_geometry_proc_fops; |
937 | |||
938 | /* | ||
939 | * Standard exit stuff: | ||
940 | */ | ||
941 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) \ | ||
942 | { \ | ||
943 | len -= off; \ | ||
944 | if (len < count) { \ | ||
945 | *eof = 1; \ | ||
946 | if (len <= 0) \ | ||
947 | return 0; \ | ||
948 | } else \ | ||
949 | len = count; \ | ||
950 | *start = page + off; \ | ||
951 | return len; \ | ||
952 | } | ||
953 | #else | 936 | #else |
954 | static inline void proc_ide_create(void) { ; } | 937 | static inline void proc_ide_create(void) { ; } |
955 | static inline void proc_ide_destroy(void) { ; } | 938 | static inline void proc_ide_destroy(void) { ; } |
@@ -961,7 +944,6 @@ static inline void ide_proc_register_driver(ide_drive_t *drive, | |||
961 | struct ide_driver *driver) { ; } | 944 | struct ide_driver *driver) { ; } |
962 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, | 945 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, |
963 | struct ide_driver *driver) { ; } | 946 | struct ide_driver *driver) { ; } |
964 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; | ||
965 | #endif | 947 | #endif |
966 | 948 | ||
967 | enum { | 949 | enum { |