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.h60
1 files changed, 34 insertions, 26 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5adf32b90f36..408fe89498f4 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -252,9 +252,6 @@ extern void __init files_init(unsigned long);
252struct buffer_head; 252struct buffer_head;
253typedef int (get_block_t)(struct inode *inode, sector_t iblock, 253typedef int (get_block_t)(struct inode *inode, sector_t iblock,
254 struct buffer_head *bh_result, int create); 254 struct buffer_head *bh_result, int create);
255typedef int (get_blocks_t)(struct inode *inode, sector_t iblock,
256 unsigned long max_blocks,
257 struct buffer_head *bh_result, int create);
258typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, 255typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
259 ssize_t bytes, void *private); 256 ssize_t bytes, void *private);
260 257
@@ -350,7 +347,7 @@ struct writeback_control;
350struct address_space_operations { 347struct address_space_operations {
351 int (*writepage)(struct page *page, struct writeback_control *wbc); 348 int (*writepage)(struct page *page, struct writeback_control *wbc);
352 int (*readpage)(struct file *, struct page *); 349 int (*readpage)(struct file *, struct page *);
353 int (*sync_page)(struct page *); 350 void (*sync_page)(struct page *);
354 351
355 /* Write back some dirty pages from this mapping. */ 352 /* Write back some dirty pages from this mapping. */
356 int (*writepages)(struct address_space *, struct writeback_control *); 353 int (*writepages)(struct address_space *, struct writeback_control *);
@@ -369,7 +366,7 @@ struct address_space_operations {
369 int (*commit_write)(struct file *, struct page *, unsigned, unsigned); 366 int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
370 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ 367 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */
371 sector_t (*bmap)(struct address_space *, sector_t); 368 sector_t (*bmap)(struct address_space *, sector_t);
372 int (*invalidatepage) (struct page *, unsigned long); 369 void (*invalidatepage) (struct page *, unsigned long);
373 int (*releasepage) (struct page *, gfp_t); 370 int (*releasepage) (struct page *, gfp_t);
374 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, 371 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
375 loff_t offset, unsigned long nr_segs); 372 loff_t offset, unsigned long nr_segs);
@@ -413,6 +410,9 @@ struct block_device {
413 struct list_head bd_inodes; 410 struct list_head bd_inodes;
414 void * bd_holder; 411 void * bd_holder;
415 int bd_holders; 412 int bd_holders;
413#ifdef CONFIG_SYSFS
414 struct list_head bd_holder_list;
415#endif
416 struct block_device * bd_contains; 416 struct block_device * bd_contains;
417 unsigned bd_block_size; 417 unsigned bd_block_size;
418 struct hd_struct * bd_part; 418 struct hd_struct * bd_part;
@@ -490,13 +490,13 @@ struct inode {
490 unsigned int i_blkbits; 490 unsigned int i_blkbits;
491 unsigned long i_blksize; 491 unsigned long i_blksize;
492 unsigned long i_version; 492 unsigned long i_version;
493 unsigned long i_blocks; 493 blkcnt_t i_blocks;
494 unsigned short i_bytes; 494 unsigned short i_bytes;
495 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 495 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
496 struct mutex i_mutex; 496 struct mutex i_mutex;
497 struct rw_semaphore i_alloc_sem; 497 struct rw_semaphore i_alloc_sem;
498 struct inode_operations *i_op; 498 struct inode_operations *i_op;
499 struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 499 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
500 struct super_block *i_sb; 500 struct super_block *i_sb;
501 struct file_lock *i_flock; 501 struct file_lock *i_flock;
502 struct address_space *i_mapping; 502 struct address_space *i_mapping;
@@ -636,7 +636,7 @@ struct file {
636 } f_u; 636 } f_u;
637 struct dentry *f_dentry; 637 struct dentry *f_dentry;
638 struct vfsmount *f_vfsmnt; 638 struct vfsmount *f_vfsmnt;
639 struct file_operations *f_op; 639 const struct file_operations *f_op;
640 atomic_t f_count; 640 atomic_t f_count;
641 unsigned int f_flags; 641 unsigned int f_flags;
642 mode_t f_mode; 642 mode_t f_mode;
@@ -763,6 +763,7 @@ extern void locks_copy_lock(struct file_lock *, struct file_lock *);
763extern void locks_remove_posix(struct file *, fl_owner_t); 763extern void locks_remove_posix(struct file *, fl_owner_t);
764extern void locks_remove_flock(struct file *); 764extern void locks_remove_flock(struct file *);
765extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *); 765extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *);
766extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_lock *);
766extern int posix_lock_file(struct file *, struct file_lock *); 767extern int posix_lock_file(struct file *, struct file_lock *);
767extern int posix_lock_file_wait(struct file *, struct file_lock *); 768extern int posix_lock_file_wait(struct file *, struct file_lock *);
768extern int posix_unblock_lock(struct file *, struct file_lock *); 769extern int posix_unblock_lock(struct file *, struct file_lock *);
@@ -1389,11 +1390,11 @@ extern void bd_set_size(struct block_device *, loff_t size);
1389extern void bd_forget(struct inode *inode); 1390extern void bd_forget(struct inode *inode);
1390extern void bdput(struct block_device *); 1391extern void bdput(struct block_device *);
1391extern struct block_device *open_by_devnum(dev_t, unsigned); 1392extern struct block_device *open_by_devnum(dev_t, unsigned);
1392extern struct file_operations def_blk_fops; 1393extern const struct file_operations def_blk_fops;
1393extern struct address_space_operations def_blk_aops; 1394extern struct address_space_operations def_blk_aops;
1394extern struct file_operations def_chr_fops; 1395extern const struct file_operations def_chr_fops;
1395extern struct file_operations bad_sock_fops; 1396extern const struct file_operations bad_sock_fops;
1396extern struct file_operations def_fifo_fops; 1397extern const struct file_operations def_fifo_fops;
1397extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); 1398extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
1398extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); 1399extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
1399extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1400extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
@@ -1401,12 +1402,19 @@ extern int blkdev_get(struct block_device *, mode_t, unsigned);
1401extern int blkdev_put(struct block_device *); 1402extern int blkdev_put(struct block_device *);
1402extern int bd_claim(struct block_device *, void *); 1403extern int bd_claim(struct block_device *, void *);
1403extern void bd_release(struct block_device *); 1404extern void bd_release(struct block_device *);
1405#ifdef CONFIG_SYSFS
1406extern int bd_claim_by_disk(struct block_device *, void *, struct gendisk *);
1407extern void bd_release_from_disk(struct block_device *, struct gendisk *);
1408#else
1409#define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder)
1410#define bd_release_from_disk(bdev, disk) bd_release(bdev)
1411#endif
1404 1412
1405/* fs/char_dev.c */ 1413/* fs/char_dev.c */
1406extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); 1414extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
1407extern int register_chrdev_region(dev_t, unsigned, const char *); 1415extern int register_chrdev_region(dev_t, unsigned, const char *);
1408extern int register_chrdev(unsigned int, const char *, 1416extern int register_chrdev(unsigned int, const char *,
1409 struct file_operations *); 1417 const struct file_operations *);
1410extern int unregister_chrdev(unsigned int, const char *); 1418extern int unregister_chrdev(unsigned int, const char *);
1411extern void unregister_chrdev_region(dev_t, unsigned); 1419extern void unregister_chrdev_region(dev_t, unsigned);
1412extern int chrdev_open(struct inode *, struct file *); 1420extern int chrdev_open(struct inode *, struct file *);
@@ -1436,9 +1444,9 @@ extern void init_special_inode(struct inode *, umode_t, dev_t);
1436extern void make_bad_inode(struct inode *); 1444extern void make_bad_inode(struct inode *);
1437extern int is_bad_inode(struct inode *); 1445extern int is_bad_inode(struct inode *);
1438 1446
1439extern struct file_operations read_fifo_fops; 1447extern const struct file_operations read_fifo_fops;
1440extern struct file_operations write_fifo_fops; 1448extern const struct file_operations write_fifo_fops;
1441extern struct file_operations rdwr_fifo_fops; 1449extern const struct file_operations rdwr_fifo_fops;
1442 1450
1443extern int fs_may_remount_ro(struct super_block *); 1451extern int fs_may_remount_ro(struct super_block *);
1444 1452
@@ -1644,7 +1652,7 @@ static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
1644 1652
1645ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 1653ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
1646 struct block_device *bdev, const struct iovec *iov, loff_t offset, 1654 struct block_device *bdev, const struct iovec *iov, loff_t offset,
1647 unsigned long nr_segs, get_blocks_t get_blocks, dio_iodone_t end_io, 1655 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
1648 int lock_type); 1656 int lock_type);
1649 1657
1650enum { 1658enum {
@@ -1655,32 +1663,32 @@ enum {
1655 1663
1656static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, 1664static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
1657 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 1665 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
1658 loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks, 1666 loff_t offset, unsigned long nr_segs, get_block_t get_block,
1659 dio_iodone_t end_io) 1667 dio_iodone_t end_io)
1660{ 1668{
1661 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 1669 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
1662 nr_segs, get_blocks, end_io, DIO_LOCKING); 1670 nr_segs, get_block, end_io, DIO_LOCKING);
1663} 1671}
1664 1672
1665static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb, 1673static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb,
1666 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 1674 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
1667 loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks, 1675 loff_t offset, unsigned long nr_segs, get_block_t get_block,
1668 dio_iodone_t end_io) 1676 dio_iodone_t end_io)
1669{ 1677{
1670 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 1678 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
1671 nr_segs, get_blocks, end_io, DIO_NO_LOCKING); 1679 nr_segs, get_block, end_io, DIO_NO_LOCKING);
1672} 1680}
1673 1681
1674static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, 1682static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb,
1675 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 1683 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
1676 loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks, 1684 loff_t offset, unsigned long nr_segs, get_block_t get_block,
1677 dio_iodone_t end_io) 1685 dio_iodone_t end_io)
1678{ 1686{
1679 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 1687 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
1680 nr_segs, get_blocks, end_io, DIO_OWN_LOCKING); 1688 nr_segs, get_block, end_io, DIO_OWN_LOCKING);
1681} 1689}
1682 1690
1683extern struct file_operations generic_ro_fops; 1691extern const struct file_operations generic_ro_fops;
1684 1692
1685#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) 1693#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
1686 1694
@@ -1736,9 +1744,9 @@ extern int simple_commit_write(struct file *file, struct page *page,
1736 1744
1737extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); 1745extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
1738extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); 1746extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
1739extern struct file_operations simple_dir_operations; 1747extern const struct file_operations simple_dir_operations;
1740extern struct inode_operations simple_dir_inode_operations; 1748extern struct inode_operations simple_dir_inode_operations;
1741struct tree_descr { char *name; struct file_operations *ops; int mode; }; 1749struct tree_descr { char *name; const struct file_operations *ops; int mode; };
1742struct dentry *d_alloc_name(struct dentry *, const char *); 1750struct dentry *d_alloc_name(struct dentry *, const char *);
1743extern int simple_fill_super(struct super_block *, int, struct tree_descr *); 1751extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
1744extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); 1752extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count);