diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-09-02 15:28:45 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-10-21 07:47:06 -0400 |
commit | aeb5d727062a0238a2f96c9c380fbd2be4640c6f (patch) | |
tree | 51dae8a071fcf42e4431a66d37c5b843c8e99cf6 /include | |
parent | 2515ddc6db8eb49a79f0fe5e67ff09ac7c81eab4 (diff) |
[PATCH] introduce fmode_t, do annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blkdev.h | 3 | ||||
-rw-r--r-- | include/linux/device-mapper.h | 8 | ||||
-rw-r--r-- | include/linux/file.h | 4 | ||||
-rw-r--r-- | include/linux/fs.h | 16 | ||||
-rw-r--r-- | include/linux/fsnotify.h | 2 | ||||
-rw-r--r-- | include/linux/types.h | 1 |
6 files changed, 18 insertions, 16 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index b4fe68fe3a57..a4413ec3cb3a 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -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 |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 08d783592b73..3f8d4e763672 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -85,7 +85,7 @@ void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev); | |||
85 | 85 | ||
86 | struct dm_dev { | 86 | struct dm_dev { |
87 | struct block_device *bdev; | 87 | struct block_device *bdev; |
88 | int mode; | 88 | fmode_t mode; |
89 | char name[16]; | 89 | char name[16]; |
90 | }; | 90 | }; |
91 | 91 | ||
@@ -95,7 +95,7 @@ struct dm_dev { | |||
95 | * FIXME: too many arguments. | 95 | * FIXME: too many arguments. |
96 | */ | 96 | */ |
97 | int dm_get_device(struct dm_target *ti, const char *path, sector_t start, | 97 | int dm_get_device(struct dm_target *ti, const char *path, sector_t start, |
98 | sector_t len, int mode, struct dm_dev **result); | 98 | sector_t len, fmode_t mode, struct dm_dev **result); |
99 | void dm_put_device(struct dm_target *ti, struct dm_dev *d); | 99 | void dm_put_device(struct dm_target *ti, struct dm_dev *d); |
100 | 100 | ||
101 | /* | 101 | /* |
@@ -223,7 +223,7 @@ int dm_set_geometry(struct mapped_device *md, struct hd_geometry *geo); | |||
223 | /* | 223 | /* |
224 | * First create an empty table. | 224 | * First create an empty table. |
225 | */ | 225 | */ |
226 | int dm_table_create(struct dm_table **result, int mode, | 226 | int dm_table_create(struct dm_table **result, fmode_t mode, |
227 | unsigned num_targets, struct mapped_device *md); | 227 | unsigned num_targets, struct mapped_device *md); |
228 | 228 | ||
229 | /* | 229 | /* |
@@ -254,7 +254,7 @@ void dm_table_put(struct dm_table *t); | |||
254 | */ | 254 | */ |
255 | sector_t dm_table_get_size(struct dm_table *t); | 255 | sector_t dm_table_get_size(struct dm_table *t); |
256 | unsigned int dm_table_get_num_targets(struct dm_table *t); | 256 | unsigned int dm_table_get_num_targets(struct dm_table *t); |
257 | int dm_table_get_mode(struct dm_table *t); | 257 | fmode_t dm_table_get_mode(struct dm_table *t); |
258 | struct mapped_device *dm_table_get_md(struct dm_table *t); | 258 | struct mapped_device *dm_table_get_md(struct dm_table *t); |
259 | 259 | ||
260 | /* | 260 | /* |
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 a6a625be13fc..60a7a581ba91 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -63,18 +63,18 @@ 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 | 78 | ||
79 | #define RW_MASK 1 | 79 | #define RW_MASK 1 |
80 | #define RWA_MASK 2 | 80 | #define RWA_MASK 2 |
@@ -825,7 +825,7 @@ struct file { | |||
825 | const struct file_operations *f_op; | 825 | const struct file_operations *f_op; |
826 | atomic_long_t f_count; | 826 | atomic_long_t f_count; |
827 | unsigned int f_flags; | 827 | unsigned int f_flags; |
828 | mode_t f_mode; | 828 | fmode_t f_mode; |
829 | loff_t f_pos; | 829 | loff_t f_pos; |
830 | struct fown_struct f_owner; | 830 | struct fown_struct f_owner; |
831 | unsigned int f_uid, f_gid; | 831 | unsigned int f_uid, f_gid; |
@@ -1714,7 +1714,7 @@ extern struct block_device *bdget(dev_t); | |||
1714 | extern void bd_set_size(struct block_device *, loff_t size); | 1714 | extern void bd_set_size(struct block_device *, loff_t size); |
1715 | extern void bd_forget(struct inode *inode); | 1715 | extern void bd_forget(struct inode *inode); |
1716 | extern void bdput(struct block_device *); | 1716 | extern void bdput(struct block_device *); |
1717 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1717 | extern struct block_device *open_by_devnum(dev_t, fmode_t); |
1718 | #else | 1718 | #else |
1719 | static inline void bd_forget(struct inode *inode) {} | 1719 | static inline void bd_forget(struct inode *inode) {} |
1720 | #endif | 1720 | #endif |
@@ -1729,7 +1729,7 @@ extern int blkdev_driver_ioctl(struct inode *inode, struct file *file, | |||
1729 | struct gendisk *disk, unsigned cmd, | 1729 | struct gendisk *disk, unsigned cmd, |
1730 | unsigned long arg); | 1730 | unsigned long arg); |
1731 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1731 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
1732 | extern int blkdev_get(struct block_device *, mode_t, unsigned); | 1732 | extern int blkdev_get(struct block_device *, fmode_t, unsigned); |
1733 | extern int blkdev_put(struct block_device *); | 1733 | extern int blkdev_put(struct block_device *); |
1734 | extern int bd_claim(struct block_device *, void *); | 1734 | extern int bd_claim(struct block_device *, void *); |
1735 | extern void bd_release(struct block_device *); | 1735 | extern void bd_release(struct block_device *); |
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/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; |