aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 13:23:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 13:23:07 -0400
commit22484856402bfa1ff3defe47f6029ab0418240d9 (patch)
tree140c67bf59674da350a7b51765d6ff7eb101b597 /include/linux/fs.h
parent5ed487bc2c44ca4e9668ef9cb54c830e2a9fac47 (diff)
parent56b26add02b4bdea81d5e0ebda60db1fe3311ad4 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/viro/bdev
* git://git.kernel.org/pub/scm/linux/kernel/git/viro/bdev: (66 commits) [PATCH] kill the rest of struct file propagation in block ioctls [PATCH] get rid of struct file use in blkdev_ioctl() BLKBSZSET [PATCH] get rid of blkdev_locked_ioctl() [PATCH] get rid of blkdev_driver_ioctl() [PATCH] sanitize blkdev_get() and friends [PATCH] remember mode of reiserfs journal [PATCH] propagate mode through swsusp_close() [PATCH] propagate mode through open_bdev_excl/close_bdev_excl [PATCH] pass fmode_t to blkdev_put() [PATCH] kill the unused bsize on the send side of /dev/loop [PATCH] trim file propagation in block/compat_ioctl.c [PATCH] end of methods switch: remove the old ones [PATCH] switch sr [PATCH] switch sd [PATCH] switch ide-scsi [PATCH] switch tape_block [PATCH] switch dcssblk [PATCH] switch dasd [PATCH] switch mtd_blkdevs [PATCH] switch mmc ...
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h49
1 files changed, 20 insertions, 29 deletions
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 */
1268typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); 1274typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned);
1269 1275struct block_device_operations;
1270struct 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);
1713extern void bd_set_size(struct block_device *, loff_t size); 1706extern void bd_set_size(struct block_device *, loff_t size);
1714extern void bd_forget(struct inode *inode); 1707extern void bd_forget(struct inode *inode);
1715extern void bdput(struct block_device *); 1708extern void bdput(struct block_device *);
1716extern struct block_device *open_by_devnum(dev_t, unsigned); 1709extern struct block_device *open_by_devnum(dev_t, fmode_t);
1717#else 1710#else
1718static inline void bd_forget(struct inode *inode) {} 1711static inline void bd_forget(struct inode *inode) {}
1719#endif 1712#endif
@@ -1723,13 +1716,10 @@ extern const struct file_operations bad_sock_fops;
1723extern const struct file_operations def_fifo_fops; 1716extern const struct file_operations def_fifo_fops;
1724#ifdef CONFIG_BLOCK 1717#ifdef CONFIG_BLOCK
1725extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); 1718extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
1726extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); 1719extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long);
1727extern int blkdev_driver_ioctl(struct inode *inode, struct file *file,
1728 struct gendisk *disk, unsigned cmd,
1729 unsigned long arg);
1730extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1720extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
1731extern int blkdev_get(struct block_device *, mode_t, unsigned); 1721extern int blkdev_get(struct block_device *, fmode_t);
1732extern int blkdev_put(struct block_device *); 1722extern int blkdev_put(struct block_device *, fmode_t);
1733extern int bd_claim(struct block_device *, void *); 1723extern int bd_claim(struct block_device *, void *);
1734extern void bd_release(struct block_device *); 1724extern 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);
1760extern const char *__bdevname(dev_t, char *buffer); 1750extern const char *__bdevname(dev_t, char *buffer);
1761extern const char *bdevname(struct block_device *bdev, char *buffer); 1751extern const char *bdevname(struct block_device *bdev, char *buffer);
1762extern struct block_device *lookup_bdev(const char *); 1752extern struct block_device *lookup_bdev(const char *);
1763extern struct block_device *open_bdev_excl(const char *, int, void *); 1753extern struct block_device *open_bdev_exclusive(const char *, fmode_t, void *);
1764extern void close_bdev_excl(struct block_device *); 1754extern void close_bdev_exclusive(struct block_device *, fmode_t);
1765extern void blkdev_show(struct seq_file *,off_t); 1755extern 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