diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 27cfa723b92a..a6a625be13fc 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -86,7 +86,9 @@ extern int dir_notify_enable; | |||
86 | #define READ_META (READ | (1 << BIO_RW_META)) | 86 | #define READ_META (READ | (1 << BIO_RW_META)) |
87 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) | 87 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) |
88 | #define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNC)) | 88 | #define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNC)) |
89 | #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) | 89 | #define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER)) |
90 | #define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD) | ||
91 | #define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER)) | ||
90 | 92 | ||
91 | #define SEL_IN 1 | 93 | #define SEL_IN 1 |
92 | #define SEL_OUT 2 | 94 | #define SEL_OUT 2 |
@@ -222,6 +224,7 @@ extern int dir_notify_enable; | |||
222 | #define BLKTRACESTART _IO(0x12,116) | 224 | #define BLKTRACESTART _IO(0x12,116) |
223 | #define BLKTRACESTOP _IO(0x12,117) | 225 | #define BLKTRACESTOP _IO(0x12,117) |
224 | #define BLKTRACETEARDOWN _IO(0x12,118) | 226 | #define BLKTRACETEARDOWN _IO(0x12,118) |
227 | #define BLKDISCARD _IO(0x12,119) | ||
225 | 228 | ||
226 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ | 229 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ |
227 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 230 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
@@ -231,6 +234,7 @@ extern int dir_notify_enable; | |||
231 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) | 234 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) |
232 | #define FS_IOC_GETVERSION _IOR('v', 1, long) | 235 | #define FS_IOC_GETVERSION _IOR('v', 1, long) |
233 | #define FS_IOC_SETVERSION _IOW('v', 2, long) | 236 | #define FS_IOC_SETVERSION _IOW('v', 2, long) |
237 | #define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap) | ||
234 | #define FS_IOC32_GETFLAGS _IOR('f', 1, int) | 238 | #define FS_IOC32_GETFLAGS _IOR('f', 1, int) |
235 | #define FS_IOC32_SETFLAGS _IOW('f', 2, int) | 239 | #define FS_IOC32_SETFLAGS _IOW('f', 2, int) |
236 | #define FS_IOC32_GETVERSION _IOR('v', 1, int) | 240 | #define FS_IOC32_GETVERSION _IOR('v', 1, int) |
@@ -291,6 +295,7 @@ extern int dir_notify_enable; | |||
291 | #include <linux/mutex.h> | 295 | #include <linux/mutex.h> |
292 | #include <linux/capability.h> | 296 | #include <linux/capability.h> |
293 | #include <linux/semaphore.h> | 297 | #include <linux/semaphore.h> |
298 | #include <linux/fiemap.h> | ||
294 | 299 | ||
295 | #include <asm/atomic.h> | 300 | #include <asm/atomic.h> |
296 | #include <asm/byteorder.h> | 301 | #include <asm/byteorder.h> |
@@ -1220,6 +1225,20 @@ extern void dentry_unhash(struct dentry *dentry); | |||
1220 | extern int file_permission(struct file *, int); | 1225 | extern int file_permission(struct file *, int); |
1221 | 1226 | ||
1222 | /* | 1227 | /* |
1228 | * VFS FS_IOC_FIEMAP helper definitions. | ||
1229 | */ | ||
1230 | struct fiemap_extent_info { | ||
1231 | unsigned int fi_flags; /* Flags as passed from user */ | ||
1232 | unsigned int fi_extents_mapped; /* Number of mapped extents */ | ||
1233 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ | ||
1234 | struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent | ||
1235 | * array */ | ||
1236 | }; | ||
1237 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, | ||
1238 | u64 phys, u64 len, u32 flags); | ||
1239 | int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); | ||
1240 | |||
1241 | /* | ||
1223 | * File types | 1242 | * File types |
1224 | * | 1243 | * |
1225 | * NOTE! These match bits 12..15 of stat.st_mode | 1244 | * NOTE! These match bits 12..15 of stat.st_mode |
@@ -1328,6 +1347,8 @@ struct inode_operations { | |||
1328 | void (*truncate_range)(struct inode *, loff_t, loff_t); | 1347 | void (*truncate_range)(struct inode *, loff_t, loff_t); |
1329 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, | 1348 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, |
1330 | loff_t len); | 1349 | loff_t len); |
1350 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | ||
1351 | u64 len); | ||
1331 | }; | 1352 | }; |
1332 | 1353 | ||
1333 | struct seq_file; | 1354 | struct seq_file; |
@@ -1733,6 +1754,7 @@ extern void chrdev_show(struct seq_file *,off_t); | |||
1733 | 1754 | ||
1734 | /* fs/block_dev.c */ | 1755 | /* fs/block_dev.c */ |
1735 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 1756 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
1757 | #define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ | ||
1736 | 1758 | ||
1737 | #ifdef CONFIG_BLOCK | 1759 | #ifdef CONFIG_BLOCK |
1738 | #define BLKDEV_MAJOR_HASH_SIZE 255 | 1760 | #define BLKDEV_MAJOR_HASH_SIZE 255 |
@@ -1769,6 +1791,9 @@ extern int fs_may_remount_ro(struct super_block *); | |||
1769 | */ | 1791 | */ |
1770 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) | 1792 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) |
1771 | 1793 | ||
1794 | extern void check_disk_size_change(struct gendisk *disk, | ||
1795 | struct block_device *bdev); | ||
1796 | extern int revalidate_disk(struct gendisk *); | ||
1772 | extern int check_disk_change(struct block_device *); | 1797 | extern int check_disk_change(struct block_device *); |
1773 | extern int __invalidate_device(struct block_device *); | 1798 | extern int __invalidate_device(struct block_device *); |
1774 | extern int invalidate_partition(struct gendisk *, int); | 1799 | extern int invalidate_partition(struct gendisk *, int); |
@@ -2031,6 +2056,9 @@ extern int vfs_fstat(unsigned int, struct kstat *); | |||
2031 | 2056 | ||
2032 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | 2057 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, |
2033 | unsigned long arg); | 2058 | unsigned long arg); |
2059 | extern int generic_block_fiemap(struct inode *inode, | ||
2060 | struct fiemap_extent_info *fieinfo, u64 start, | ||
2061 | u64 len, get_block_t *get_block); | ||
2034 | 2062 | ||
2035 | extern void get_filesystem(struct file_system_type *fs); | 2063 | extern void get_filesystem(struct file_system_type *fs); |
2036 | extern void put_filesystem(struct file_system_type *fs); | 2064 | extern void put_filesystem(struct file_system_type *fs); |