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 580b513668fe..44e3cb2f1966 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> |
@@ -1179,6 +1184,20 @@ extern void dentry_unhash(struct dentry *dentry); | |||
1179 | extern int file_permission(struct file *, int); | 1184 | extern int file_permission(struct file *, int); |
1180 | 1185 | ||
1181 | /* | 1186 | /* |
1187 | * VFS FS_IOC_FIEMAP helper definitions. | ||
1188 | */ | ||
1189 | struct fiemap_extent_info { | ||
1190 | unsigned int fi_flags; /* Flags as passed from user */ | ||
1191 | unsigned int fi_extents_mapped; /* Number of mapped extents */ | ||
1192 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ | ||
1193 | struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent | ||
1194 | * array */ | ||
1195 | }; | ||
1196 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, | ||
1197 | u64 phys, u64 len, u32 flags); | ||
1198 | int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); | ||
1199 | |||
1200 | /* | ||
1182 | * File types | 1201 | * File types |
1183 | * | 1202 | * |
1184 | * NOTE! These match bits 12..15 of stat.st_mode | 1203 | * NOTE! These match bits 12..15 of stat.st_mode |
@@ -1287,6 +1306,8 @@ struct inode_operations { | |||
1287 | void (*truncate_range)(struct inode *, loff_t, loff_t); | 1306 | void (*truncate_range)(struct inode *, loff_t, loff_t); |
1288 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, | 1307 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, |
1289 | loff_t len); | 1308 | loff_t len); |
1309 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | ||
1310 | u64 len); | ||
1290 | }; | 1311 | }; |
1291 | 1312 | ||
1292 | struct seq_file; | 1313 | struct seq_file; |
@@ -1682,6 +1703,7 @@ extern void chrdev_show(struct seq_file *,off_t); | |||
1682 | 1703 | ||
1683 | /* fs/block_dev.c */ | 1704 | /* fs/block_dev.c */ |
1684 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 1705 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
1706 | #define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ | ||
1685 | 1707 | ||
1686 | #ifdef CONFIG_BLOCK | 1708 | #ifdef CONFIG_BLOCK |
1687 | #define BLKDEV_MAJOR_HASH_SIZE 255 | 1709 | #define BLKDEV_MAJOR_HASH_SIZE 255 |
@@ -1718,6 +1740,9 @@ extern int fs_may_remount_ro(struct super_block *); | |||
1718 | */ | 1740 | */ |
1719 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) | 1741 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) |
1720 | 1742 | ||
1743 | extern void check_disk_size_change(struct gendisk *disk, | ||
1744 | struct block_device *bdev); | ||
1745 | extern int revalidate_disk(struct gendisk *); | ||
1721 | extern int check_disk_change(struct block_device *); | 1746 | extern int check_disk_change(struct block_device *); |
1722 | extern int __invalidate_device(struct block_device *); | 1747 | extern int __invalidate_device(struct block_device *); |
1723 | extern int invalidate_partition(struct gendisk *, int); | 1748 | extern int invalidate_partition(struct gendisk *, int); |
@@ -1980,6 +2005,9 @@ extern int vfs_fstat(unsigned int, struct kstat *); | |||
1980 | 2005 | ||
1981 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | 2006 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, |
1982 | unsigned long arg); | 2007 | unsigned long arg); |
2008 | extern int generic_block_fiemap(struct inode *inode, | ||
2009 | struct fiemap_extent_info *fieinfo, u64 start, | ||
2010 | u64 len, get_block_t *get_block); | ||
1983 | 2011 | ||
1984 | extern void get_filesystem(struct file_system_type *fs); | 2012 | extern void get_filesystem(struct file_system_type *fs); |
1985 | extern void put_filesystem(struct file_system_type *fs); | 2013 | extern void put_filesystem(struct file_system_type *fs); |