aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h67
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);
1443extern void putname(const char *name); 1482extern void putname(const char *name);
1444#endif 1483#endif
1445 1484
1485#ifdef CONFIG_BLOCK
1446extern int register_blkdev(unsigned int, const char *); 1486extern int register_blkdev(unsigned int, const char *);
1447extern int unregister_blkdev(unsigned int, const char *); 1487extern int unregister_blkdev(unsigned int, const char *);
1448extern struct block_device *bdget(dev_t); 1488extern struct block_device *bdget(dev_t);
@@ -1451,11 +1491,15 @@ extern void bd_forget(struct inode *inode);
1451extern void bdput(struct block_device *); 1491extern void bdput(struct block_device *);
1452extern struct block_device *open_by_devnum(dev_t, unsigned); 1492extern struct block_device *open_by_devnum(dev_t, unsigned);
1453extern struct block_device *open_partition_by_devnum(dev_t, unsigned); 1493extern struct block_device *open_partition_by_devnum(dev_t, unsigned);
1454extern const struct file_operations def_blk_fops;
1455extern const struct address_space_operations def_blk_aops; 1494extern const struct address_space_operations def_blk_aops;
1495#else
1496static inline void bd_forget(struct inode *inode) {}
1497#endif
1498extern const struct file_operations def_blk_fops;
1456extern const struct file_operations def_chr_fops; 1499extern const struct file_operations def_chr_fops;
1457extern const struct file_operations bad_sock_fops; 1500extern const struct file_operations bad_sock_fops;
1458extern const struct file_operations def_fifo_fops; 1501extern const struct file_operations def_fifo_fops;
1502#ifdef CONFIG_BLOCK
1459extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); 1503extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
1460extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); 1504extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
1461extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1505extern 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 *);
1484extern void chrdev_show(struct seq_file *,off_t); 1529extern 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
1489extern const char *__bdevname(dev_t, char *buffer); 1536extern const char *__bdevname(dev_t, char *buffer);
1490extern const char *bdevname(struct block_device *bdev, char *buffer); 1537extern const char *bdevname(struct block_device *bdev, char *buffer);
1491extern struct block_device *lookup_bdev(const char *); 1538extern struct block_device *lookup_bdev(const char *);
1492extern struct block_device *open_bdev_excl(const char *, int, void *); 1539extern struct block_device *open_bdev_excl(const char *, int, void *);
1493extern void close_bdev_excl(struct block_device *); 1540extern void close_bdev_excl(struct block_device *);
1494extern void blkdev_show(struct seq_file *,off_t); 1541extern void blkdev_show(struct seq_file *,off_t);
1542#else
1543#define BLKDEV_MAJOR_HASH_SIZE 0
1544#endif
1495 1545
1496extern void init_special_inode(struct inode *, umode_t, dev_t); 1546extern 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
1506extern int fs_may_remount_ro(struct super_block *); 1556extern 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
1518extern int check_disk_change(struct block_device *); 1569extern int check_disk_change(struct block_device *);
1519extern int invalidate_inodes(struct super_block *);
1520extern int __invalidate_device(struct block_device *); 1570extern int __invalidate_device(struct block_device *);
1521extern int invalidate_partition(struct gendisk *, int); 1571extern int invalidate_partition(struct gendisk *, int);
1572#endif
1573extern int invalidate_inodes(struct super_block *);
1522unsigned long invalidate_mapping_pages(struct address_space *mapping, 1574unsigned long invalidate_mapping_pages(struct address_space *mapping,
1523 pgoff_t start, pgoff_t end); 1575 pgoff_t start, pgoff_t end);
1524unsigned long invalidate_inode_pages(struct address_space *mapping); 1576unsigned long invalidate_inode_pages(struct address_space *mapping);
@@ -1546,11 +1598,14 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping,
1546extern long do_fsync(struct file *file, int datasync); 1598extern long do_fsync(struct file *file, int datasync);
1547extern void sync_supers(void); 1599extern void sync_supers(void);
1548extern void sync_filesystems(int wait); 1600extern void sync_filesystems(int wait);
1601extern void __fsync_super(struct super_block *sb);
1549extern void emergency_sync(void); 1602extern void emergency_sync(void);
1550extern void emergency_remount(void); 1603extern void emergency_remount(void);
1551extern int do_remount_sb(struct super_block *sb, int flags, 1604extern int do_remount_sb(struct super_block *sb, int flags,
1552 void *data, int force); 1605 void *data, int force);
1606#ifdef CONFIG_BLOCK
1553extern sector_t bmap(struct inode *, sector_t); 1607extern sector_t bmap(struct inode *, sector_t);
1608#endif
1554extern int notify_change(struct dentry *, struct iattr *); 1609extern int notify_change(struct dentry *, struct iattr *);
1555extern int permission(struct inode *, int, struct nameidata *); 1610extern int permission(struct inode *, int, struct nameidata *);
1556extern int generic_permission(struct inode *, int, 1611extern int generic_permission(struct inode *, int,
@@ -1633,9 +1688,11 @@ static inline void insert_inode_hash(struct inode *inode) {
1633extern struct file * get_empty_filp(void); 1688extern struct file * get_empty_filp(void);
1634extern void file_move(struct file *f, struct list_head *list); 1689extern void file_move(struct file *f, struct list_head *list);
1635extern void file_kill(struct file *f); 1690extern void file_kill(struct file *f);
1691#ifdef CONFIG_BLOCK
1636struct bio; 1692struct bio;
1637extern void submit_bio(int, struct bio *); 1693extern void submit_bio(int, struct bio *);
1638extern int bdev_read_only(struct block_device *); 1694extern int bdev_read_only(struct block_device *);
1695#endif
1639extern int set_blocksize(struct block_device *, int); 1696extern int set_blocksize(struct block_device *, int);
1640extern int sb_set_blocksize(struct super_block *, int); 1697extern int sb_set_blocksize(struct super_block *, int);
1641extern int sb_min_blocksize(struct super_block *, int); 1698extern 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
1719ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 1777ssize_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
1757extern const struct file_operations generic_ro_fops; 1816extern const struct file_operations generic_ro_fops;
1758 1817