diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/blkdev.h | 27 | ||||
-rw-r--r-- | include/linux/cdrom.h | 10 | ||||
-rw-r--r-- | include/linux/device-mapper.h | 11 | ||||
-rw-r--r-- | include/linux/file.h | 4 | ||||
-rw-r--r-- | include/linux/fs.h | 49 | ||||
-rw-r--r-- | include/linux/fsnotify.h | 2 | ||||
-rw-r--r-- | include/linux/ide.h | 7 | ||||
-rw-r--r-- | include/linux/reiserfs_fs_sb.h | 1 | ||||
-rw-r--r-- | include/linux/types.h | 1 |
9 files changed, 60 insertions, 52 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index b4fe68fe3a57..a135256b272c 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -717,10 +717,10 @@ extern void blk_plug_device(struct request_queue *); | |||
717 | extern void blk_plug_device_unlocked(struct request_queue *); | 717 | extern void blk_plug_device_unlocked(struct request_queue *); |
718 | extern int blk_remove_plug(struct request_queue *); | 718 | extern int blk_remove_plug(struct request_queue *); |
719 | extern void blk_recount_segments(struct request_queue *, struct bio *); | 719 | extern void blk_recount_segments(struct request_queue *, struct bio *); |
720 | extern int scsi_cmd_ioctl(struct file *, struct request_queue *, | 720 | extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t, |
721 | struct gendisk *, unsigned int, void __user *); | 721 | unsigned int, void __user *); |
722 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, | 722 | extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, |
723 | struct gendisk *, struct scsi_ioctl_command __user *); | 723 | struct scsi_ioctl_command __user *); |
724 | 724 | ||
725 | /* | 725 | /* |
726 | * Temporary export, until SCSI gets fixed up. | 726 | * Temporary export, until SCSI gets fixed up. |
@@ -910,7 +910,8 @@ static inline int sb_issue_discard(struct super_block *sb, | |||
910 | * command filter functions | 910 | * command filter functions |
911 | */ | 911 | */ |
912 | extern int blk_verify_command(struct blk_cmd_filter *filter, | 912 | extern int blk_verify_command(struct blk_cmd_filter *filter, |
913 | unsigned char *cmd, int has_write_perm); | 913 | unsigned char *cmd, fmode_t has_write_perm); |
914 | extern void blk_unregister_filter(struct gendisk *disk); | ||
914 | extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter); | 915 | extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter); |
915 | 916 | ||
916 | #define MAX_PHYS_SEGMENTS 128 | 917 | #define MAX_PHYS_SEGMENTS 128 |
@@ -1056,6 +1057,22 @@ static inline int blk_integrity_rq(struct request *rq) | |||
1056 | 1057 | ||
1057 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ | 1058 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ |
1058 | 1059 | ||
1060 | struct block_device_operations { | ||
1061 | int (*open) (struct block_device *, fmode_t); | ||
1062 | int (*release) (struct gendisk *, fmode_t); | ||
1063 | int (*locked_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | ||
1064 | int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | ||
1065 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | ||
1066 | int (*direct_access) (struct block_device *, sector_t, | ||
1067 | void **, unsigned long *); | ||
1068 | int (*media_changed) (struct gendisk *); | ||
1069 | int (*revalidate_disk) (struct gendisk *); | ||
1070 | int (*getgeo)(struct block_device *, struct hd_geometry *); | ||
1071 | struct module *owner; | ||
1072 | }; | ||
1073 | |||
1074 | extern int __blkdev_driver_ioctl(struct block_device *, fmode_t, unsigned int, | ||
1075 | unsigned long); | ||
1059 | #else /* CONFIG_BLOCK */ | 1076 | #else /* CONFIG_BLOCK */ |
1060 | /* | 1077 | /* |
1061 | * stubs for when the block layer is configured out | 1078 | * stubs for when the block layer is configured out |
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index 5db265ea60f6..0b49e08d3cb0 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h | |||
@@ -987,11 +987,11 @@ struct cdrom_device_ops { | |||
987 | }; | 987 | }; |
988 | 988 | ||
989 | /* the general block_device operations structure: */ | 989 | /* the general block_device operations structure: */ |
990 | extern int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, | 990 | extern int cdrom_open(struct cdrom_device_info *cdi, struct block_device *bdev, |
991 | struct file *fp); | 991 | fmode_t mode); |
992 | extern int cdrom_release(struct cdrom_device_info *cdi, struct file *fp); | 992 | extern void cdrom_release(struct cdrom_device_info *cdi, fmode_t mode); |
993 | extern int cdrom_ioctl(struct file *file, struct cdrom_device_info *cdi, | 993 | extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev, |
994 | struct inode *ip, unsigned int cmd, unsigned long arg); | 994 | fmode_t mode, unsigned int cmd, unsigned long arg); |
995 | extern int cdrom_media_changed(struct cdrom_device_info *); | 995 | extern int cdrom_media_changed(struct cdrom_device_info *); |
996 | 996 | ||
997 | extern int register_cdrom(struct cdrom_device_info *cdi); | 997 | extern int register_cdrom(struct cdrom_device_info *cdi); |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index dfb30db475ed..c17fd334e574 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -69,8 +69,7 @@ typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, | |||
69 | 69 | ||
70 | typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); | 70 | typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); |
71 | 71 | ||
72 | typedef int (*dm_ioctl_fn) (struct dm_target *ti, struct inode *inode, | 72 | typedef int (*dm_ioctl_fn) (struct dm_target *ti, unsigned int cmd, |
73 | struct file *filp, unsigned int cmd, | ||
74 | unsigned long arg); | 73 | unsigned long arg); |
75 | 74 | ||
76 | typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, | 75 | typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, |
@@ -85,7 +84,7 @@ void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev); | |||
85 | 84 | ||
86 | struct dm_dev { | 85 | struct dm_dev { |
87 | struct block_device *bdev; | 86 | struct block_device *bdev; |
88 | int mode; | 87 | fmode_t mode; |
89 | char name[16]; | 88 | char name[16]; |
90 | }; | 89 | }; |
91 | 90 | ||
@@ -95,7 +94,7 @@ struct dm_dev { | |||
95 | * FIXME: too many arguments. | 94 | * FIXME: too many arguments. |
96 | */ | 95 | */ |
97 | int dm_get_device(struct dm_target *ti, const char *path, sector_t start, | 96 | int dm_get_device(struct dm_target *ti, const char *path, sector_t start, |
98 | sector_t len, int mode, struct dm_dev **result); | 97 | sector_t len, fmode_t mode, struct dm_dev **result); |
99 | void dm_put_device(struct dm_target *ti, struct dm_dev *d); | 98 | void dm_put_device(struct dm_target *ti, struct dm_dev *d); |
100 | 99 | ||
101 | /* | 100 | /* |
@@ -223,7 +222,7 @@ int dm_set_geometry(struct mapped_device *md, struct hd_geometry *geo); | |||
223 | /* | 222 | /* |
224 | * First create an empty table. | 223 | * First create an empty table. |
225 | */ | 224 | */ |
226 | int dm_table_create(struct dm_table **result, int mode, | 225 | int dm_table_create(struct dm_table **result, fmode_t mode, |
227 | unsigned num_targets, struct mapped_device *md); | 226 | unsigned num_targets, struct mapped_device *md); |
228 | 227 | ||
229 | /* | 228 | /* |
@@ -254,7 +253,7 @@ void dm_table_put(struct dm_table *t); | |||
254 | */ | 253 | */ |
255 | sector_t dm_table_get_size(struct dm_table *t); | 254 | sector_t dm_table_get_size(struct dm_table *t); |
256 | unsigned int dm_table_get_num_targets(struct dm_table *t); | 255 | unsigned int dm_table_get_num_targets(struct dm_table *t); |
257 | int dm_table_get_mode(struct dm_table *t); | 256 | fmode_t dm_table_get_mode(struct dm_table *t); |
258 | struct mapped_device *dm_table_get_md(struct dm_table *t); | 257 | struct mapped_device *dm_table_get_md(struct dm_table *t); |
259 | 258 | ||
260 | /* | 259 | /* |
diff --git a/include/linux/file.h b/include/linux/file.h index a20259e248a5..335a0a5c316e 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -19,10 +19,10 @@ struct file_operations; | |||
19 | struct vfsmount; | 19 | struct vfsmount; |
20 | struct dentry; | 20 | struct dentry; |
21 | extern int init_file(struct file *, struct vfsmount *mnt, | 21 | extern int init_file(struct file *, struct vfsmount *mnt, |
22 | struct dentry *dentry, mode_t mode, | 22 | struct dentry *dentry, fmode_t mode, |
23 | const struct file_operations *fop); | 23 | const struct file_operations *fop); |
24 | extern struct file *alloc_file(struct vfsmount *, struct dentry *dentry, | 24 | extern struct file *alloc_file(struct vfsmount *, struct dentry *dentry, |
25 | mode_t mode, const struct file_operations *fop); | 25 | fmode_t mode, const struct file_operations *fop); |
26 | 26 | ||
27 | static inline void fput_light(struct file *file, int fput_needed) | 27 | static inline void fput_light(struct file *file, int fput_needed) |
28 | { | 28 | { |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 7d719c1a18e3..43659ae52e4d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -63,18 +63,23 @@ extern int dir_notify_enable; | |||
63 | #define MAY_ACCESS 16 | 63 | #define MAY_ACCESS 16 |
64 | #define MAY_OPEN 32 | 64 | #define MAY_OPEN 32 |
65 | 65 | ||
66 | #define FMODE_READ 1 | 66 | #define FMODE_READ ((__force fmode_t)1) |
67 | #define FMODE_WRITE 2 | 67 | #define FMODE_WRITE ((__force fmode_t)2) |
68 | 68 | ||
69 | /* Internal kernel extensions */ | 69 | /* Internal kernel extensions */ |
70 | #define FMODE_LSEEK 4 | 70 | #define FMODE_LSEEK ((__force fmode_t)4) |
71 | #define FMODE_PREAD 8 | 71 | #define FMODE_PREAD ((__force fmode_t)8) |
72 | #define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */ | 72 | #define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */ |
73 | 73 | ||
74 | /* File is being opened for execution. Primary users of this flag are | 74 | /* File is being opened for execution. Primary users of this flag are |
75 | distributed filesystems that can use it to achieve correct ETXTBUSY | 75 | distributed filesystems that can use it to achieve correct ETXTBUSY |
76 | behavior for cross-node execution/opening_for_writing of files */ | 76 | behavior for cross-node execution/opening_for_writing of files */ |
77 | #define FMODE_EXEC 16 | 77 | #define FMODE_EXEC ((__force fmode_t)16) |
78 | |||
79 | #define FMODE_NDELAY ((__force fmode_t)32) | ||
80 | #define FMODE_EXCL ((__force fmode_t)64) | ||
81 | #define FMODE_WRITE_IOCTL ((__force fmode_t)128) | ||
82 | #define FMODE_NDELAY_NOW ((__force fmode_t)256) | ||
78 | 83 | ||
79 | #define RW_MASK 1 | 84 | #define RW_MASK 1 |
80 | #define RWA_MASK 2 | 85 | #define RWA_MASK 2 |
@@ -825,7 +830,7 @@ struct file { | |||
825 | const struct file_operations *f_op; | 830 | const struct file_operations *f_op; |
826 | atomic_long_t f_count; | 831 | atomic_long_t f_count; |
827 | unsigned int f_flags; | 832 | unsigned int f_flags; |
828 | mode_t f_mode; | 833 | fmode_t f_mode; |
829 | loff_t f_pos; | 834 | loff_t f_pos; |
830 | struct fown_struct f_owner; | 835 | struct fown_struct f_owner; |
831 | unsigned int f_uid, f_gid; | 836 | unsigned int f_uid, f_gid; |
@@ -1152,6 +1157,7 @@ struct super_block { | |||
1152 | char s_id[32]; /* Informational name */ | 1157 | char s_id[32]; /* Informational name */ |
1153 | 1158 | ||
1154 | void *s_fs_info; /* Filesystem private info */ | 1159 | void *s_fs_info; /* Filesystem private info */ |
1160 | fmode_t s_mode; | ||
1155 | 1161 | ||
1156 | /* | 1162 | /* |
1157 | * The next field is for VFS *only*. No filesystems have any business | 1163 | * The next field is for VFS *only*. No filesystems have any business |
@@ -1266,20 +1272,7 @@ int generic_osync_inode(struct inode *, struct address_space *, int); | |||
1266 | * to have different dirent layouts depending on the binary type. | 1272 | * to have different dirent layouts depending on the binary type. |
1267 | */ | 1273 | */ |
1268 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); | 1274 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); |
1269 | 1275 | struct block_device_operations; | |
1270 | struct block_device_operations { | ||
1271 | int (*open) (struct inode *, struct file *); | ||
1272 | int (*release) (struct inode *, struct file *); | ||
1273 | int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long); | ||
1274 | long (*unlocked_ioctl) (struct file *, unsigned, unsigned long); | ||
1275 | long (*compat_ioctl) (struct file *, unsigned, unsigned long); | ||
1276 | int (*direct_access) (struct block_device *, sector_t, | ||
1277 | void **, unsigned long *); | ||
1278 | int (*media_changed) (struct gendisk *); | ||
1279 | int (*revalidate_disk) (struct gendisk *); | ||
1280 | int (*getgeo)(struct block_device *, struct hd_geometry *); | ||
1281 | struct module *owner; | ||
1282 | }; | ||
1283 | 1276 | ||
1284 | /* These macros are for out of kernel modules to test that | 1277 | /* These macros are for out of kernel modules to test that |
1285 | * the kernel supports the unlocked_ioctl and compat_ioctl | 1278 | * the kernel supports the unlocked_ioctl and compat_ioctl |
@@ -1713,7 +1706,7 @@ extern struct block_device *bdget(dev_t); | |||
1713 | extern void bd_set_size(struct block_device *, loff_t size); | 1706 | extern void bd_set_size(struct block_device *, loff_t size); |
1714 | extern void bd_forget(struct inode *inode); | 1707 | extern void bd_forget(struct inode *inode); |
1715 | extern void bdput(struct block_device *); | 1708 | extern void bdput(struct block_device *); |
1716 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1709 | extern struct block_device *open_by_devnum(dev_t, fmode_t); |
1717 | #else | 1710 | #else |
1718 | static inline void bd_forget(struct inode *inode) {} | 1711 | static inline void bd_forget(struct inode *inode) {} |
1719 | #endif | 1712 | #endif |
@@ -1723,13 +1716,10 @@ extern const struct file_operations bad_sock_fops; | |||
1723 | extern const struct file_operations def_fifo_fops; | 1716 | extern const struct file_operations def_fifo_fops; |
1724 | #ifdef CONFIG_BLOCK | 1717 | #ifdef CONFIG_BLOCK |
1725 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | 1718 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); |
1726 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); | 1719 | extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long); |
1727 | extern int blkdev_driver_ioctl(struct inode *inode, struct file *file, | ||
1728 | struct gendisk *disk, unsigned cmd, | ||
1729 | unsigned long arg); | ||
1730 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1720 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
1731 | extern int blkdev_get(struct block_device *, mode_t, unsigned); | 1721 | extern int blkdev_get(struct block_device *, fmode_t); |
1732 | extern int blkdev_put(struct block_device *); | 1722 | extern int blkdev_put(struct block_device *, fmode_t); |
1733 | extern int bd_claim(struct block_device *, void *); | 1723 | extern int bd_claim(struct block_device *, void *); |
1734 | extern void bd_release(struct block_device *); | 1724 | extern void bd_release(struct block_device *); |
1735 | #ifdef CONFIG_SYSFS | 1725 | #ifdef CONFIG_SYSFS |
@@ -1760,9 +1750,10 @@ extern void chrdev_show(struct seq_file *,off_t); | |||
1760 | extern const char *__bdevname(dev_t, char *buffer); | 1750 | extern const char *__bdevname(dev_t, char *buffer); |
1761 | extern const char *bdevname(struct block_device *bdev, char *buffer); | 1751 | extern const char *bdevname(struct block_device *bdev, char *buffer); |
1762 | extern struct block_device *lookup_bdev(const char *); | 1752 | extern struct block_device *lookup_bdev(const char *); |
1763 | extern struct block_device *open_bdev_excl(const char *, int, void *); | 1753 | extern struct block_device *open_bdev_exclusive(const char *, fmode_t, void *); |
1764 | extern void close_bdev_excl(struct block_device *); | 1754 | extern void close_bdev_exclusive(struct block_device *, fmode_t); |
1765 | extern void blkdev_show(struct seq_file *,off_t); | 1755 | extern void blkdev_show(struct seq_file *,off_t); |
1756 | |||
1766 | #else | 1757 | #else |
1767 | #define BLKDEV_MAJOR_HASH_SIZE 0 | 1758 | #define BLKDEV_MAJOR_HASH_SIZE 0 |
1768 | #endif | 1759 | #endif |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index a89513188ce7..00fbd5b245c9 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -188,7 +188,7 @@ static inline void fsnotify_close(struct file *file) | |||
188 | struct dentry *dentry = file->f_path.dentry; | 188 | struct dentry *dentry = file->f_path.dentry; |
189 | struct inode *inode = dentry->d_inode; | 189 | struct inode *inode = dentry->d_inode; |
190 | const char *name = dentry->d_name.name; | 190 | const char *name = dentry->d_name.name; |
191 | mode_t mode = file->f_mode; | 191 | fmode_t mode = file->f_mode; |
192 | u32 mask = (mode & FMODE_WRITE) ? IN_CLOSE_WRITE : IN_CLOSE_NOWRITE; | 192 | u32 mask = (mode & FMODE_WRITE) ? IN_CLOSE_WRITE : IN_CLOSE_NOWRITE; |
193 | 193 | ||
194 | if (S_ISDIR(inode->i_mode)) | 194 | if (S_ISDIR(inode->i_mode)) |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 89e53cfbc787..54525be4b5f8 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -474,8 +474,8 @@ struct ide_disk_ops { | |||
474 | ide_startstop_t (*do_request)(struct ide_drive_s *, struct request *, | 474 | ide_startstop_t (*do_request)(struct ide_drive_s *, struct request *, |
475 | sector_t); | 475 | sector_t); |
476 | int (*end_request)(struct ide_drive_s *, int, int); | 476 | int (*end_request)(struct ide_drive_s *, int, int); |
477 | int (*ioctl)(struct ide_drive_s *, struct inode *, | 477 | int (*ioctl)(struct ide_drive_s *, struct block_device *, |
478 | struct file *, unsigned int, unsigned long); | 478 | fmode_t, unsigned int, unsigned long); |
479 | }; | 479 | }; |
480 | 480 | ||
481 | /* ATAPI device flags */ | 481 | /* ATAPI device flags */ |
@@ -1158,8 +1158,7 @@ struct ide_ioctl_devset { | |||
1158 | int ide_setting_ioctl(ide_drive_t *, struct block_device *, unsigned int, | 1158 | int ide_setting_ioctl(ide_drive_t *, struct block_device *, unsigned int, |
1159 | unsigned long, const struct ide_ioctl_devset *); | 1159 | unsigned long, const struct ide_ioctl_devset *); |
1160 | 1160 | ||
1161 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, | 1161 | int generic_ide_ioctl(ide_drive_t *, struct block_device *, unsigned, unsigned long); |
1162 | unsigned, unsigned long); | ||
1163 | 1162 | ||
1164 | extern int ide_vlb_clk; | 1163 | extern int ide_vlb_clk; |
1165 | extern int ide_pci_clk; | 1164 | extern int ide_pci_clk; |
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 315517e8bfa1..bda6b562a1e0 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h | |||
@@ -178,6 +178,7 @@ struct reiserfs_journal { | |||
178 | struct reiserfs_journal_cnode *j_first; /* oldest journal block. start here for traverse */ | 178 | struct reiserfs_journal_cnode *j_first; /* oldest journal block. start here for traverse */ |
179 | 179 | ||
180 | struct block_device *j_dev_bd; | 180 | struct block_device *j_dev_bd; |
181 | fmode_t j_dev_mode; | ||
181 | int j_1st_reserved_block; /* first block on s_dev of reserved area journal */ | 182 | int j_1st_reserved_block; /* first block on s_dev of reserved area journal */ |
182 | 183 | ||
183 | unsigned long j_state; | 184 | unsigned long j_state; |
diff --git a/include/linux/types.h b/include/linux/types.h index f24f7beb47df..1d98330b1f2c 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -190,6 +190,7 @@ typedef __u32 __bitwise __wsum; | |||
190 | 190 | ||
191 | #ifdef __KERNEL__ | 191 | #ifdef __KERNEL__ |
192 | typedef unsigned __bitwise__ gfp_t; | 192 | typedef unsigned __bitwise__ gfp_t; |
193 | typedef unsigned __bitwise__ fmode_t; | ||
193 | 194 | ||
194 | #ifdef CONFIG_PHYS_ADDR_T_64BIT | 195 | #ifdef CONFIG_PHYS_ADDR_T_64BIT |
195 | typedef u64 phys_addr_t; | 196 | typedef u64 phys_addr_t; |