diff options
Diffstat (limited to 'include/linux/fs.h')
| -rw-r--r-- | include/linux/fs.h | 67 |
1 files changed, 63 insertions, 4 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 6eafbe309483..5baf3a153403 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -79,8 +79,8 @@ extern int dir_notify_enable; | |||
| 79 | #define WRITE 1 | 79 | #define WRITE 1 |
| 80 | #define READA 2 /* read-ahead - don't block if no resources */ | 80 | #define READA 2 /* read-ahead - don't block if no resources */ |
| 81 | #define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ | 81 | #define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ |
| 82 | #define SPECIAL 4 /* For non-blockdevice requests in request queue */ | ||
| 83 | #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) | 82 | #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) |
| 83 | #define READ_META (READ | (1 << BIO_RW_META)) | ||
| 84 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) | 84 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) |
| 85 | #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) | 85 | #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) |
| 86 | 86 | ||
| @@ -217,6 +217,45 @@ extern int dir_notify_enable; | |||
| 217 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 217 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
| 218 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ | 218 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ |
| 219 | 219 | ||
| 220 | #define FS_IOC_GETFLAGS _IOR('f', 1, long) | ||
| 221 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) | ||
| 222 | #define FS_IOC_GETVERSION _IOR('v', 1, long) | ||
| 223 | #define FS_IOC_SETVERSION _IOW('v', 2, long) | ||
| 224 | #define FS_IOC32_GETFLAGS _IOR('f', 1, int) | ||
| 225 | #define FS_IOC32_SETFLAGS _IOW('f', 2, int) | ||
| 226 | #define FS_IOC32_GETVERSION _IOR('v', 1, int) | ||
| 227 | #define FS_IOC32_SETVERSION _IOW('v', 2, int) | ||
| 228 | |||
| 229 | /* | ||
| 230 | * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS) | ||
| 231 | */ | ||
| 232 | #define FS_SECRM_FL 0x00000001 /* Secure deletion */ | ||
| 233 | #define FS_UNRM_FL 0x00000002 /* Undelete */ | ||
| 234 | #define FS_COMPR_FL 0x00000004 /* Compress file */ | ||
| 235 | #define FS_SYNC_FL 0x00000008 /* Synchronous updates */ | ||
| 236 | #define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */ | ||
| 237 | #define FS_APPEND_FL 0x00000020 /* writes to file may only append */ | ||
| 238 | #define FS_NODUMP_FL 0x00000040 /* do not dump file */ | ||
| 239 | #define FS_NOATIME_FL 0x00000080 /* do not update atime */ | ||
| 240 | /* Reserved for compression usage... */ | ||
| 241 | #define FS_DIRTY_FL 0x00000100 | ||
| 242 | #define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ | ||
| 243 | #define FS_NOCOMP_FL 0x00000400 /* Don't compress */ | ||
| 244 | #define FS_ECOMPR_FL 0x00000800 /* Compression error */ | ||
| 245 | /* End compression flags --- maybe not all used */ | ||
| 246 | #define FS_BTREE_FL 0x00001000 /* btree format dir */ | ||
| 247 | #define FS_INDEX_FL 0x00001000 /* hash-indexed directory */ | ||
| 248 | #define FS_IMAGIC_FL 0x00002000 /* AFS directory */ | ||
| 249 | #define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */ | ||
| 250 | #define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */ | ||
| 251 | #define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ | ||
| 252 | #define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ | ||
| 253 | #define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ | ||
| 254 | |||
| 255 | #define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ | ||
| 256 | #define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ | ||
| 257 | |||
| 258 | |||
| 220 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 | 259 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 |
| 221 | #define SYNC_FILE_RANGE_WRITE 2 | 260 | #define SYNC_FILE_RANGE_WRITE 2 |
| 222 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 | 261 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 |
| @@ -1443,6 +1482,7 @@ extern void __init vfs_caches_init(unsigned long); | |||
| 1443 | extern void putname(const char *name); | 1482 | extern void putname(const char *name); |
| 1444 | #endif | 1483 | #endif |
| 1445 | 1484 | ||
| 1485 | #ifdef CONFIG_BLOCK | ||
| 1446 | extern int register_blkdev(unsigned int, const char *); | 1486 | extern int register_blkdev(unsigned int, const char *); |
| 1447 | extern int unregister_blkdev(unsigned int, const char *); | 1487 | extern int unregister_blkdev(unsigned int, const char *); |
| 1448 | extern struct block_device *bdget(dev_t); | 1488 | extern struct block_device *bdget(dev_t); |
| @@ -1451,11 +1491,15 @@ extern void bd_forget(struct inode *inode); | |||
| 1451 | extern void bdput(struct block_device *); | 1491 | extern void bdput(struct block_device *); |
| 1452 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1492 | extern struct block_device *open_by_devnum(dev_t, unsigned); |
| 1453 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); | 1493 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); |
| 1454 | extern const struct file_operations def_blk_fops; | ||
| 1455 | extern const struct address_space_operations def_blk_aops; | 1494 | extern const struct address_space_operations def_blk_aops; |
| 1495 | #else | ||
| 1496 | static inline void bd_forget(struct inode *inode) {} | ||
| 1497 | #endif | ||
| 1498 | extern const struct file_operations def_blk_fops; | ||
| 1456 | extern const struct file_operations def_chr_fops; | 1499 | extern const struct file_operations def_chr_fops; |
| 1457 | extern const struct file_operations bad_sock_fops; | 1500 | extern const struct file_operations bad_sock_fops; |
| 1458 | extern const struct file_operations def_fifo_fops; | 1501 | extern const struct file_operations def_fifo_fops; |
| 1502 | #ifdef CONFIG_BLOCK | ||
| 1459 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | 1503 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); |
| 1460 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); | 1504 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); |
| 1461 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1505 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
| @@ -1471,6 +1515,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *); | |||
| 1471 | #define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) | 1515 | #define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) |
| 1472 | #define bd_release_from_disk(bdev, disk) bd_release(bdev) | 1516 | #define bd_release_from_disk(bdev, disk) bd_release(bdev) |
| 1473 | #endif | 1517 | #endif |
| 1518 | #endif | ||
| 1474 | 1519 | ||
| 1475 | /* fs/char_dev.c */ | 1520 | /* fs/char_dev.c */ |
| 1476 | #define CHRDEV_MAJOR_HASH_SIZE 255 | 1521 | #define CHRDEV_MAJOR_HASH_SIZE 255 |
| @@ -1484,14 +1529,19 @@ extern int chrdev_open(struct inode *, struct file *); | |||
| 1484 | extern void chrdev_show(struct seq_file *,off_t); | 1529 | extern void chrdev_show(struct seq_file *,off_t); |
| 1485 | 1530 | ||
| 1486 | /* fs/block_dev.c */ | 1531 | /* fs/block_dev.c */ |
| 1487 | #define BLKDEV_MAJOR_HASH_SIZE 255 | ||
| 1488 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 1532 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
| 1533 | |||
| 1534 | #ifdef CONFIG_BLOCK | ||
| 1535 | #define BLKDEV_MAJOR_HASH_SIZE 255 | ||
| 1489 | extern const char *__bdevname(dev_t, char *buffer); | 1536 | extern const char *__bdevname(dev_t, char *buffer); |
| 1490 | extern const char *bdevname(struct block_device *bdev, char *buffer); | 1537 | extern const char *bdevname(struct block_device *bdev, char *buffer); |
| 1491 | extern struct block_device *lookup_bdev(const char *); | 1538 | extern struct block_device *lookup_bdev(const char *); |
| 1492 | extern struct block_device *open_bdev_excl(const char *, int, void *); | 1539 | extern struct block_device *open_bdev_excl(const char *, int, void *); |
| 1493 | extern void close_bdev_excl(struct block_device *); | 1540 | extern void close_bdev_excl(struct block_device *); |
| 1494 | extern void blkdev_show(struct seq_file *,off_t); | 1541 | extern void blkdev_show(struct seq_file *,off_t); |
| 1542 | #else | ||
| 1543 | #define BLKDEV_MAJOR_HASH_SIZE 0 | ||
| 1544 | #endif | ||
| 1495 | 1545 | ||
| 1496 | extern void init_special_inode(struct inode *, umode_t, dev_t); | 1546 | extern void init_special_inode(struct inode *, umode_t, dev_t); |
| 1497 | 1547 | ||
| @@ -1505,6 +1555,7 @@ extern const struct file_operations rdwr_fifo_fops; | |||
| 1505 | 1555 | ||
| 1506 | extern int fs_may_remount_ro(struct super_block *); | 1556 | extern int fs_may_remount_ro(struct super_block *); |
| 1507 | 1557 | ||
| 1558 | #ifdef CONFIG_BLOCK | ||
| 1508 | /* | 1559 | /* |
| 1509 | * return READ, READA, or WRITE | 1560 | * return READ, READA, or WRITE |
| 1510 | */ | 1561 | */ |
| @@ -1516,9 +1567,10 @@ extern int fs_may_remount_ro(struct super_block *); | |||
| 1516 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) | 1567 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) |
| 1517 | 1568 | ||
| 1518 | extern int check_disk_change(struct block_device *); | 1569 | extern int check_disk_change(struct block_device *); |
| 1519 | extern int invalidate_inodes(struct super_block *); | ||
| 1520 | extern int __invalidate_device(struct block_device *); | 1570 | extern int __invalidate_device(struct block_device *); |
| 1521 | extern int invalidate_partition(struct gendisk *, int); | 1571 | extern int invalidate_partition(struct gendisk *, int); |
| 1572 | #endif | ||
| 1573 | extern int invalidate_inodes(struct super_block *); | ||
| 1522 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 1574 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
| 1523 | pgoff_t start, pgoff_t end); | 1575 | pgoff_t start, pgoff_t end); |
| 1524 | unsigned long invalidate_inode_pages(struct address_space *mapping); | 1576 | unsigned long invalidate_inode_pages(struct address_space *mapping); |
| @@ -1546,11 +1598,14 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping, | |||
| 1546 | extern long do_fsync(struct file *file, int datasync); | 1598 | extern long do_fsync(struct file *file, int datasync); |
| 1547 | extern void sync_supers(void); | 1599 | extern void sync_supers(void); |
| 1548 | extern void sync_filesystems(int wait); | 1600 | extern void sync_filesystems(int wait); |
| 1601 | extern void __fsync_super(struct super_block *sb); | ||
| 1549 | extern void emergency_sync(void); | 1602 | extern void emergency_sync(void); |
| 1550 | extern void emergency_remount(void); | 1603 | extern void emergency_remount(void); |
| 1551 | extern int do_remount_sb(struct super_block *sb, int flags, | 1604 | extern int do_remount_sb(struct super_block *sb, int flags, |
| 1552 | void *data, int force); | 1605 | void *data, int force); |
| 1606 | #ifdef CONFIG_BLOCK | ||
| 1553 | extern sector_t bmap(struct inode *, sector_t); | 1607 | extern sector_t bmap(struct inode *, sector_t); |
| 1608 | #endif | ||
| 1554 | extern int notify_change(struct dentry *, struct iattr *); | 1609 | extern int notify_change(struct dentry *, struct iattr *); |
| 1555 | extern int permission(struct inode *, int, struct nameidata *); | 1610 | extern int permission(struct inode *, int, struct nameidata *); |
| 1556 | extern int generic_permission(struct inode *, int, | 1611 | extern int generic_permission(struct inode *, int, |
| @@ -1633,9 +1688,11 @@ static inline void insert_inode_hash(struct inode *inode) { | |||
| 1633 | extern struct file * get_empty_filp(void); | 1688 | extern struct file * get_empty_filp(void); |
| 1634 | extern void file_move(struct file *f, struct list_head *list); | 1689 | extern void file_move(struct file *f, struct list_head *list); |
| 1635 | extern void file_kill(struct file *f); | 1690 | extern void file_kill(struct file *f); |
| 1691 | #ifdef CONFIG_BLOCK | ||
| 1636 | struct bio; | 1692 | struct bio; |
| 1637 | extern void submit_bio(int, struct bio *); | 1693 | extern void submit_bio(int, struct bio *); |
| 1638 | extern int bdev_read_only(struct block_device *); | 1694 | extern int bdev_read_only(struct block_device *); |
| 1695 | #endif | ||
| 1639 | extern int set_blocksize(struct block_device *, int); | 1696 | extern int set_blocksize(struct block_device *, int); |
| 1640 | extern int sb_set_blocksize(struct super_block *, int); | 1697 | extern int sb_set_blocksize(struct super_block *, int); |
| 1641 | extern int sb_min_blocksize(struct super_block *, int); | 1698 | extern int sb_min_blocksize(struct super_block *, int); |
| @@ -1716,6 +1773,7 @@ static inline void do_generic_file_read(struct file * filp, loff_t *ppos, | |||
| 1716 | actor); | 1773 | actor); |
| 1717 | } | 1774 | } |
| 1718 | 1775 | ||
| 1776 | #ifdef CONFIG_BLOCK | ||
| 1719 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | 1777 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, |
| 1720 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | 1778 | struct block_device *bdev, const struct iovec *iov, loff_t offset, |
| 1721 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, | 1779 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, |
| @@ -1753,6 +1811,7 @@ static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, | |||
| 1753 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | 1811 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, |
| 1754 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); | 1812 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); |
| 1755 | } | 1813 | } |
| 1814 | #endif | ||
| 1756 | 1815 | ||
| 1757 | extern const struct file_operations generic_ro_fops; | 1816 | extern const struct file_operations generic_ro_fops; |
| 1758 | 1817 | ||
