diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 9d9674946956..408fe89498f4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -410,6 +410,9 @@ struct block_device { | |||
410 | struct list_head bd_inodes; | 410 | struct list_head bd_inodes; |
411 | void * bd_holder; | 411 | void * bd_holder; |
412 | int bd_holders; | 412 | int bd_holders; |
413 | #ifdef CONFIG_SYSFS | ||
414 | struct list_head bd_holder_list; | ||
415 | #endif | ||
413 | struct block_device * bd_contains; | 416 | struct block_device * bd_contains; |
414 | unsigned bd_block_size; | 417 | unsigned bd_block_size; |
415 | struct hd_struct * bd_part; | 418 | struct hd_struct * bd_part; |
@@ -493,7 +496,7 @@ struct inode { | |||
493 | struct mutex i_mutex; | 496 | struct mutex i_mutex; |
494 | struct rw_semaphore i_alloc_sem; | 497 | struct rw_semaphore i_alloc_sem; |
495 | struct inode_operations *i_op; | 498 | struct inode_operations *i_op; |
496 | struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 499 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |
497 | struct super_block *i_sb; | 500 | struct super_block *i_sb; |
498 | struct file_lock *i_flock; | 501 | struct file_lock *i_flock; |
499 | struct address_space *i_mapping; | 502 | struct address_space *i_mapping; |
@@ -633,7 +636,7 @@ struct file { | |||
633 | } f_u; | 636 | } f_u; |
634 | struct dentry *f_dentry; | 637 | struct dentry *f_dentry; |
635 | struct vfsmount *f_vfsmnt; | 638 | struct vfsmount *f_vfsmnt; |
636 | struct file_operations *f_op; | 639 | const struct file_operations *f_op; |
637 | atomic_t f_count; | 640 | atomic_t f_count; |
638 | unsigned int f_flags; | 641 | unsigned int f_flags; |
639 | mode_t f_mode; | 642 | mode_t f_mode; |
@@ -1387,11 +1390,11 @@ extern void bd_set_size(struct block_device *, loff_t size); | |||
1387 | extern void bd_forget(struct inode *inode); | 1390 | extern void bd_forget(struct inode *inode); |
1388 | extern void bdput(struct block_device *); | 1391 | extern void bdput(struct block_device *); |
1389 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1392 | extern struct block_device *open_by_devnum(dev_t, unsigned); |
1390 | extern struct file_operations def_blk_fops; | 1393 | extern const struct file_operations def_blk_fops; |
1391 | extern struct address_space_operations def_blk_aops; | 1394 | extern struct address_space_operations def_blk_aops; |
1392 | extern struct file_operations def_chr_fops; | 1395 | extern const struct file_operations def_chr_fops; |
1393 | extern struct file_operations bad_sock_fops; | 1396 | extern const struct file_operations bad_sock_fops; |
1394 | extern struct file_operations def_fifo_fops; | 1397 | extern const struct file_operations def_fifo_fops; |
1395 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | 1398 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); |
1396 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); | 1399 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); |
1397 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1400 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
@@ -1399,12 +1402,19 @@ extern int blkdev_get(struct block_device *, mode_t, unsigned); | |||
1399 | extern int blkdev_put(struct block_device *); | 1402 | extern int blkdev_put(struct block_device *); |
1400 | extern int bd_claim(struct block_device *, void *); | 1403 | extern int bd_claim(struct block_device *, void *); |
1401 | extern void bd_release(struct block_device *); | 1404 | extern void bd_release(struct block_device *); |
1405 | #ifdef CONFIG_SYSFS | ||
1406 | extern int bd_claim_by_disk(struct block_device *, void *, struct gendisk *); | ||
1407 | extern 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 | ||
1402 | 1412 | ||
1403 | /* fs/char_dev.c */ | 1413 | /* fs/char_dev.c */ |
1404 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); | 1414 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); |
1405 | extern int register_chrdev_region(dev_t, unsigned, const char *); | 1415 | extern int register_chrdev_region(dev_t, unsigned, const char *); |
1406 | extern int register_chrdev(unsigned int, const char *, | 1416 | extern int register_chrdev(unsigned int, const char *, |
1407 | struct file_operations *); | 1417 | const struct file_operations *); |
1408 | extern int unregister_chrdev(unsigned int, const char *); | 1418 | extern int unregister_chrdev(unsigned int, const char *); |
1409 | extern void unregister_chrdev_region(dev_t, unsigned); | 1419 | extern void unregister_chrdev_region(dev_t, unsigned); |
1410 | extern int chrdev_open(struct inode *, struct file *); | 1420 | extern int chrdev_open(struct inode *, struct file *); |
@@ -1434,9 +1444,9 @@ extern void init_special_inode(struct inode *, umode_t, dev_t); | |||
1434 | extern void make_bad_inode(struct inode *); | 1444 | extern void make_bad_inode(struct inode *); |
1435 | extern int is_bad_inode(struct inode *); | 1445 | extern int is_bad_inode(struct inode *); |
1436 | 1446 | ||
1437 | extern struct file_operations read_fifo_fops; | 1447 | extern const struct file_operations read_fifo_fops; |
1438 | extern struct file_operations write_fifo_fops; | 1448 | extern const struct file_operations write_fifo_fops; |
1439 | extern struct file_operations rdwr_fifo_fops; | 1449 | extern const struct file_operations rdwr_fifo_fops; |
1440 | 1450 | ||
1441 | extern int fs_may_remount_ro(struct super_block *); | 1451 | extern int fs_may_remount_ro(struct super_block *); |
1442 | 1452 | ||
@@ -1678,7 +1688,7 @@ static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, | |||
1678 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); | 1688 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); |
1679 | } | 1689 | } |
1680 | 1690 | ||
1681 | extern struct file_operations generic_ro_fops; | 1691 | extern const struct file_operations generic_ro_fops; |
1682 | 1692 | ||
1683 | #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)) |
1684 | 1694 | ||
@@ -1734,9 +1744,9 @@ extern int simple_commit_write(struct file *file, struct page *page, | |||
1734 | 1744 | ||
1735 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); | 1745 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); |
1736 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); | 1746 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); |
1737 | extern struct file_operations simple_dir_operations; | 1747 | extern const struct file_operations simple_dir_operations; |
1738 | extern struct inode_operations simple_dir_inode_operations; | 1748 | extern struct inode_operations simple_dir_inode_operations; |
1739 | struct tree_descr { char *name; struct file_operations *ops; int mode; }; | 1749 | struct tree_descr { char *name; const struct file_operations *ops; int mode; }; |
1740 | struct dentry *d_alloc_name(struct dentry *, const char *); | 1750 | struct dentry *d_alloc_name(struct dentry *, const char *); |
1741 | extern int simple_fill_super(struct super_block *, int, struct tree_descr *); | 1751 | extern int simple_fill_super(struct super_block *, int, struct tree_descr *); |
1742 | extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); | 1752 | extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); |