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.h36
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);
1387extern void bd_forget(struct inode *inode); 1390extern void bd_forget(struct inode *inode);
1388extern void bdput(struct block_device *); 1391extern void bdput(struct block_device *);
1389extern struct block_device *open_by_devnum(dev_t, unsigned); 1392extern struct block_device *open_by_devnum(dev_t, unsigned);
1390extern struct file_operations def_blk_fops; 1393extern const struct file_operations def_blk_fops;
1391extern struct address_space_operations def_blk_aops; 1394extern struct address_space_operations def_blk_aops;
1392extern struct file_operations def_chr_fops; 1395extern const struct file_operations def_chr_fops;
1393extern struct file_operations bad_sock_fops; 1396extern const struct file_operations bad_sock_fops;
1394extern struct file_operations def_fifo_fops; 1397extern const struct file_operations def_fifo_fops;
1395extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); 1398extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
1396extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); 1399extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
1397extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1400extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
@@ -1399,12 +1402,19 @@ extern int blkdev_get(struct block_device *, mode_t, unsigned);
1399extern int blkdev_put(struct block_device *); 1402extern int blkdev_put(struct block_device *);
1400extern int bd_claim(struct block_device *, void *); 1403extern int bd_claim(struct block_device *, void *);
1401extern 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
1402 1412
1403/* fs/char_dev.c */ 1413/* fs/char_dev.c */
1404extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); 1414extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
1405extern int register_chrdev_region(dev_t, unsigned, const char *); 1415extern int register_chrdev_region(dev_t, unsigned, const char *);
1406extern int register_chrdev(unsigned int, const char *, 1416extern int register_chrdev(unsigned int, const char *,
1407 struct file_operations *); 1417 const struct file_operations *);
1408extern int unregister_chrdev(unsigned int, const char *); 1418extern int unregister_chrdev(unsigned int, const char *);
1409extern void unregister_chrdev_region(dev_t, unsigned); 1419extern void unregister_chrdev_region(dev_t, unsigned);
1410extern int chrdev_open(struct inode *, struct file *); 1420extern int chrdev_open(struct inode *, struct file *);
@@ -1434,9 +1444,9 @@ extern void init_special_inode(struct inode *, umode_t, dev_t);
1434extern void make_bad_inode(struct inode *); 1444extern void make_bad_inode(struct inode *);
1435extern int is_bad_inode(struct inode *); 1445extern int is_bad_inode(struct inode *);
1436 1446
1437extern struct file_operations read_fifo_fops; 1447extern const struct file_operations read_fifo_fops;
1438extern struct file_operations write_fifo_fops; 1448extern const struct file_operations write_fifo_fops;
1439extern struct file_operations rdwr_fifo_fops; 1449extern const struct file_operations rdwr_fifo_fops;
1440 1450
1441extern int fs_may_remount_ro(struct super_block *); 1451extern 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
1681extern struct file_operations generic_ro_fops; 1691extern 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
1735extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); 1745extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
1736extern 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 *);
1737extern struct file_operations simple_dir_operations; 1747extern const struct file_operations simple_dir_operations;
1738extern struct inode_operations simple_dir_inode_operations; 1748extern struct inode_operations simple_dir_inode_operations;
1739struct tree_descr { char *name; struct file_operations *ops; int mode; }; 1749struct tree_descr { char *name; const struct file_operations *ops; int mode; };
1740struct dentry *d_alloc_name(struct dentry *, const char *); 1750struct dentry *d_alloc_name(struct dentry *, const char *);
1741extern int simple_fill_super(struct super_block *, int, struct tree_descr *); 1751extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
1742extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); 1752extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count);