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.h135
1 files changed, 86 insertions, 49 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 128d0082522c..4ed7e602d703 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -65,6 +65,11 @@ extern int dir_notify_enable;
65#define FMODE_PREAD 8 65#define FMODE_PREAD 8
66#define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */ 66#define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */
67 67
68/* File is being opened for execution. Primary users of this flag are
69 distributed filesystems that can use it to achieve correct ETXTBUSY
70 behavior for cross-node execution/opening_for_writing of files */
71#define FMODE_EXEC 16
72
68#define RW_MASK 1 73#define RW_MASK 1
69#define RWA_MASK 2 74#define RWA_MASK 2
70#define READ 0 75#define READ 0
@@ -103,7 +108,9 @@ extern int dir_notify_enable;
103#define MS_BIND 4096 108#define MS_BIND 4096
104#define MS_MOVE 8192 109#define MS_MOVE 8192
105#define MS_REC 16384 110#define MS_REC 16384
106#define MS_VERBOSE 32768 111#define MS_VERBOSE 32768 /* War is peace. Verbosity is silence.
112 MS_VERBOSE is deprecated. */
113#define MS_SILENT 32768
107#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ 114#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
108#define MS_UNBINDABLE (1<<17) /* change to unbindable */ 115#define MS_UNBINDABLE (1<<17) /* change to unbindable */
109#define MS_PRIVATE (1<<18) /* change to private */ 116#define MS_PRIVATE (1<<18) /* change to private */
@@ -197,6 +204,10 @@ extern int dir_notify_enable;
197#define BLKBSZGET _IOR(0x12,112,size_t) 204#define BLKBSZGET _IOR(0x12,112,size_t)
198#define BLKBSZSET _IOW(0x12,113,size_t) 205#define BLKBSZSET _IOW(0x12,113,size_t)
199#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */ 206#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */
207#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
208#define BLKTRACESTART _IO(0x12,116)
209#define BLKTRACESTOP _IO(0x12,117)
210#define BLKTRACETEARDOWN _IO(0x12,118)
200 211
201#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ 212#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
202#define FIBMAP _IO(0x00,1) /* bmap access */ 213#define FIBMAP _IO(0x00,1) /* bmap access */
@@ -241,9 +252,6 @@ extern void __init files_init(unsigned long);
241struct buffer_head; 252struct buffer_head;
242typedef int (get_block_t)(struct inode *inode, sector_t iblock, 253typedef int (get_block_t)(struct inode *inode, sector_t iblock,
243 struct buffer_head *bh_result, int create); 254 struct buffer_head *bh_result, int create);
244typedef int (get_blocks_t)(struct inode *inode, sector_t iblock,
245 unsigned long max_blocks,
246 struct buffer_head *bh_result, int create);
247typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, 255typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
248 ssize_t bytes, void *private); 256 ssize_t bytes, void *private);
249 257
@@ -339,12 +347,12 @@ struct writeback_control;
339struct address_space_operations { 347struct address_space_operations {
340 int (*writepage)(struct page *page, struct writeback_control *wbc); 348 int (*writepage)(struct page *page, struct writeback_control *wbc);
341 int (*readpage)(struct file *, struct page *); 349 int (*readpage)(struct file *, struct page *);
342 int (*sync_page)(struct page *); 350 void (*sync_page)(struct page *);
343 351
344 /* Write back some dirty pages from this mapping. */ 352 /* Write back some dirty pages from this mapping. */
345 int (*writepages)(struct address_space *, struct writeback_control *); 353 int (*writepages)(struct address_space *, struct writeback_control *);
346 354
347 /* Set a page dirty */ 355 /* Set a page dirty. Return true if this dirtied it */
348 int (*set_page_dirty)(struct page *page); 356 int (*set_page_dirty)(struct page *page);
349 357
350 int (*readpages)(struct file *filp, struct address_space *mapping, 358 int (*readpages)(struct file *filp, struct address_space *mapping,
@@ -358,7 +366,7 @@ struct address_space_operations {
358 int (*commit_write)(struct file *, struct page *, unsigned, unsigned); 366 int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
359 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ 367 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */
360 sector_t (*bmap)(struct address_space *, sector_t); 368 sector_t (*bmap)(struct address_space *, sector_t);
361 int (*invalidatepage) (struct page *, unsigned long); 369 void (*invalidatepage) (struct page *, unsigned long);
362 int (*releasepage) (struct page *, gfp_t); 370 int (*releasepage) (struct page *, gfp_t);
363 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, 371 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
364 loff_t offset, unsigned long nr_segs); 372 loff_t offset, unsigned long nr_segs);
@@ -397,11 +405,14 @@ struct block_device {
397 dev_t bd_dev; /* not a kdev_t - it's a search key */ 405 dev_t bd_dev; /* not a kdev_t - it's a search key */
398 struct inode * bd_inode; /* will die */ 406 struct inode * bd_inode; /* will die */
399 int bd_openers; 407 int bd_openers;
400 struct semaphore bd_sem; /* open/close mutex */ 408 struct mutex bd_mutex; /* open/close mutex */
401 struct semaphore bd_mount_sem; /* mount mutex */ 409 struct mutex bd_mount_mutex; /* mount mutex */
402 struct list_head bd_inodes; 410 struct list_head bd_inodes;
403 void * bd_holder; 411 void * bd_holder;
404 int bd_holders; 412 int bd_holders;
413#ifdef CONFIG_SYSFS
414 struct list_head bd_holder_list;
415#endif
405 struct block_device * bd_contains; 416 struct block_device * bd_contains;
406 unsigned bd_block_size; 417 unsigned bd_block_size;
407 struct hd_struct * bd_part; 418 struct hd_struct * bd_part;
@@ -479,13 +490,13 @@ struct inode {
479 unsigned int i_blkbits; 490 unsigned int i_blkbits;
480 unsigned long i_blksize; 491 unsigned long i_blksize;
481 unsigned long i_version; 492 unsigned long i_version;
482 unsigned long i_blocks; 493 blkcnt_t i_blocks;
483 unsigned short i_bytes; 494 unsigned short i_bytes;
484 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 495 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
485 struct mutex i_mutex; 496 struct mutex i_mutex;
486 struct rw_semaphore i_alloc_sem; 497 struct rw_semaphore i_alloc_sem;
487 struct inode_operations *i_op; 498 struct inode_operations *i_op;
488 struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 499 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
489 struct super_block *i_sb; 500 struct super_block *i_sb;
490 struct file_lock *i_flock; 501 struct file_lock *i_flock;
491 struct address_space *i_mapping; 502 struct address_space *i_mapping;
@@ -509,7 +520,7 @@ struct inode {
509 520
510#ifdef CONFIG_INOTIFY 521#ifdef CONFIG_INOTIFY
511 struct list_head inotify_watches; /* watches on this inode */ 522 struct list_head inotify_watches; /* watches on this inode */
512 struct semaphore inotify_sem; /* protects the watches list */ 523 struct mutex inotify_mutex; /* protects the watches list */
513#endif 524#endif
514 525
515 unsigned long i_state; 526 unsigned long i_state;
@@ -625,7 +636,7 @@ struct file {
625 } f_u; 636 } f_u;
626 struct dentry *f_dentry; 637 struct dentry *f_dentry;
627 struct vfsmount *f_vfsmnt; 638 struct vfsmount *f_vfsmnt;
628 struct file_operations *f_op; 639 const struct file_operations *f_op;
629 atomic_t f_count; 640 atomic_t f_count;
630 unsigned int f_flags; 641 unsigned int f_flags;
631 mode_t f_mode; 642 mode_t f_mode;
@@ -667,7 +678,6 @@ extern spinlock_t files_lock;
667#define FL_POSIX 1 678#define FL_POSIX 1
668#define FL_FLOCK 2 679#define FL_FLOCK 2
669#define FL_ACCESS 8 /* not trying to lock, just looking */ 680#define FL_ACCESS 8 /* not trying to lock, just looking */
670#define FL_LOCKD 16 /* lock held by rpc.lockd */
671#define FL_LEASE 32 /* lease held on this file */ 681#define FL_LEASE 32 /* lease held on this file */
672#define FL_SLEEP 128 /* A blocking lock */ 682#define FL_SLEEP 128 /* A blocking lock */
673 683
@@ -731,8 +741,6 @@ struct file_lock {
731#define OFFT_OFFSET_MAX INT_LIMIT(off_t) 741#define OFFT_OFFSET_MAX INT_LIMIT(off_t)
732#endif 742#endif
733 743
734extern struct list_head file_lock_list;
735
736#include <linux/fcntl.h> 744#include <linux/fcntl.h>
737 745
738extern int fcntl_getlk(struct file *, struct flock __user *); 746extern int fcntl_getlk(struct file *, struct flock __user *);
@@ -749,15 +757,22 @@ extern void send_sigio(struct fown_struct *fown, int fd, int band);
749extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); 757extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
750extern int fcntl_getlease(struct file *filp); 758extern int fcntl_getlease(struct file *filp);
751 759
760/* fs/sync.c */
761#define SYNC_FILE_RANGE_WAIT_BEFORE 1
762#define SYNC_FILE_RANGE_WRITE 2
763#define SYNC_FILE_RANGE_WAIT_AFTER 4
764extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte,
765 int flags);
766
752/* fs/locks.c */ 767/* fs/locks.c */
753extern void locks_init_lock(struct file_lock *); 768extern void locks_init_lock(struct file_lock *);
754extern void locks_copy_lock(struct file_lock *, struct file_lock *); 769extern void locks_copy_lock(struct file_lock *, struct file_lock *);
755extern void locks_remove_posix(struct file *, fl_owner_t); 770extern void locks_remove_posix(struct file *, fl_owner_t);
756extern void locks_remove_flock(struct file *); 771extern void locks_remove_flock(struct file *);
757extern struct file_lock *posix_test_lock(struct file *, struct file_lock *); 772extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *);
773extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_lock *);
758extern int posix_lock_file(struct file *, struct file_lock *); 774extern int posix_lock_file(struct file *, struct file_lock *);
759extern int posix_lock_file_wait(struct file *, struct file_lock *); 775extern int posix_lock_file_wait(struct file *, struct file_lock *);
760extern void posix_block_lock(struct file_lock *, struct file_lock *);
761extern int posix_unblock_lock(struct file *, struct file_lock *); 776extern int posix_unblock_lock(struct file *, struct file_lock *);
762extern int posix_locks_deadlock(struct file_lock *, struct file_lock *); 777extern int posix_locks_deadlock(struct file_lock *, struct file_lock *);
763extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); 778extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
@@ -847,7 +862,7 @@ struct super_block {
847 * The next field is for VFS *only*. No filesystems have any business 862 * The next field is for VFS *only*. No filesystems have any business
848 * even looking at it. You had been warned. 863 * even looking at it. You had been warned.
849 */ 864 */
850 struct semaphore s_vfs_rename_sem; /* Kludge */ 865 struct mutex s_vfs_rename_mutex; /* Kludge */
851 866
852 /* Granuality of c/m/atime in ns. 867 /* Granuality of c/m/atime in ns.
853 Cannot be worse than a second */ 868 Cannot be worse than a second */
@@ -1024,6 +1039,8 @@ struct file_operations {
1024 int (*check_flags)(int); 1039 int (*check_flags)(int);
1025 int (*dir_notify)(struct file *filp, unsigned long arg); 1040 int (*dir_notify)(struct file *filp, unsigned long arg);
1026 int (*flock) (struct file *, int, struct file_lock *); 1041 int (*flock) (struct file *, int, struct file_lock *);
1042 ssize_t (*splice_write)(struct inode *, struct file *, size_t, unsigned int);
1043 ssize_t (*splice_read)(struct file *, struct inode *, size_t, unsigned int);
1027}; 1044};
1028 1045
1029struct inode_operations { 1046struct inode_operations {
@@ -1086,6 +1103,7 @@ struct super_operations {
1086 void (*umount_begin) (struct super_block *); 1103 void (*umount_begin) (struct super_block *);
1087 1104
1088 int (*show_options)(struct seq_file *, struct vfsmount *); 1105 int (*show_options)(struct seq_file *, struct vfsmount *);
1106 int (*show_stats)(struct seq_file *, struct vfsmount *);
1089 1107
1090 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); 1108 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
1091 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1109 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
@@ -1115,6 +1133,18 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
1115 __mark_inode_dirty(inode, I_DIRTY_SYNC); 1133 __mark_inode_dirty(inode, I_DIRTY_SYNC);
1116} 1134}
1117 1135
1136static inline void inode_inc_link_count(struct inode *inode)
1137{
1138 inode->i_nlink++;
1139 mark_inode_dirty(inode);
1140}
1141
1142static inline void inode_dec_link_count(struct inode *inode)
1143{
1144 inode->i_nlink--;
1145 mark_inode_dirty(inode);
1146}
1147
1118extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); 1148extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry);
1119static inline void file_accessed(struct file *file) 1149static inline void file_accessed(struct file *file)
1120{ 1150{
@@ -1369,11 +1399,11 @@ extern void bd_set_size(struct block_device *, loff_t size);
1369extern void bd_forget(struct inode *inode); 1399extern void bd_forget(struct inode *inode);
1370extern void bdput(struct block_device *); 1400extern void bdput(struct block_device *);
1371extern struct block_device *open_by_devnum(dev_t, unsigned); 1401extern struct block_device *open_by_devnum(dev_t, unsigned);
1372extern struct file_operations def_blk_fops; 1402extern const struct file_operations def_blk_fops;
1373extern struct address_space_operations def_blk_aops; 1403extern struct address_space_operations def_blk_aops;
1374extern struct file_operations def_chr_fops; 1404extern const struct file_operations def_chr_fops;
1375extern struct file_operations bad_sock_fops; 1405extern const struct file_operations bad_sock_fops;
1376extern struct file_operations def_fifo_fops; 1406extern const struct file_operations def_fifo_fops;
1377extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); 1407extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
1378extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); 1408extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
1379extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1409extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
@@ -1381,34 +1411,34 @@ extern int blkdev_get(struct block_device *, mode_t, unsigned);
1381extern int blkdev_put(struct block_device *); 1411extern int blkdev_put(struct block_device *);
1382extern int bd_claim(struct block_device *, void *); 1412extern int bd_claim(struct block_device *, void *);
1383extern void bd_release(struct block_device *); 1413extern void bd_release(struct block_device *);
1414#ifdef CONFIG_SYSFS
1415extern int bd_claim_by_disk(struct block_device *, void *, struct gendisk *);
1416extern void bd_release_from_disk(struct block_device *, struct gendisk *);
1417#else
1418#define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder)
1419#define bd_release_from_disk(bdev, disk) bd_release(bdev)
1420#endif
1384 1421
1385/* fs/char_dev.c */ 1422/* fs/char_dev.c */
1423#define CHRDEV_MAJOR_HASH_SIZE 255
1386extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); 1424extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
1387extern int register_chrdev_region(dev_t, unsigned, const char *); 1425extern int register_chrdev_region(dev_t, unsigned, const char *);
1388extern int register_chrdev(unsigned int, const char *, 1426extern int register_chrdev(unsigned int, const char *,
1389 struct file_operations *); 1427 const struct file_operations *);
1390extern int unregister_chrdev(unsigned int, const char *); 1428extern int unregister_chrdev(unsigned int, const char *);
1391extern void unregister_chrdev_region(dev_t, unsigned); 1429extern void unregister_chrdev_region(dev_t, unsigned);
1392extern int chrdev_open(struct inode *, struct file *); 1430extern int chrdev_open(struct inode *, struct file *);
1393extern int get_chrdev_list(char *); 1431extern void chrdev_show(struct seq_file *,off_t);
1394extern void *acquire_chrdev_list(void);
1395extern int count_chrdev_list(void);
1396extern void *get_next_chrdev(void *);
1397extern int get_chrdev_info(void *, int *, char **);
1398extern void release_chrdev_list(void *);
1399 1432
1400/* fs/block_dev.c */ 1433/* fs/block_dev.c */
1434#define BLKDEV_MAJOR_HASH_SIZE 255
1401#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ 1435#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
1402extern const char *__bdevname(dev_t, char *buffer); 1436extern const char *__bdevname(dev_t, char *buffer);
1403extern const char *bdevname(struct block_device *bdev, char *buffer); 1437extern const char *bdevname(struct block_device *bdev, char *buffer);
1404extern struct block_device *lookup_bdev(const char *); 1438extern struct block_device *lookup_bdev(const char *);
1405extern struct block_device *open_bdev_excl(const char *, int, void *); 1439extern struct block_device *open_bdev_excl(const char *, int, void *);
1406extern void close_bdev_excl(struct block_device *); 1440extern void close_bdev_excl(struct block_device *);
1407extern void *acquire_blkdev_list(void); 1441extern void blkdev_show(struct seq_file *,off_t);
1408extern int count_blkdev_list(void);
1409extern void *get_next_blkdev(void *);
1410extern int get_blkdev_info(void *, int *, char **);
1411extern void release_blkdev_list(void *);
1412 1442
1413extern void init_special_inode(struct inode *, umode_t, dev_t); 1443extern void init_special_inode(struct inode *, umode_t, dev_t);
1414 1444
@@ -1416,9 +1446,9 @@ extern void init_special_inode(struct inode *, umode_t, dev_t);
1416extern void make_bad_inode(struct inode *); 1446extern void make_bad_inode(struct inode *);
1417extern int is_bad_inode(struct inode *); 1447extern int is_bad_inode(struct inode *);
1418 1448
1419extern struct file_operations read_fifo_fops; 1449extern const struct file_operations read_fifo_fops;
1420extern struct file_operations write_fifo_fops; 1450extern const struct file_operations write_fifo_fops;
1421extern struct file_operations rdwr_fifo_fops; 1451extern const struct file_operations rdwr_fifo_fops;
1422 1452
1423extern int fs_may_remount_ro(struct super_block *); 1453extern int fs_may_remount_ro(struct super_block *);
1424 1454
@@ -1455,6 +1485,12 @@ extern int filemap_fdatawait(struct address_space *);
1455extern int filemap_write_and_wait(struct address_space *mapping); 1485extern int filemap_write_and_wait(struct address_space *mapping);
1456extern int filemap_write_and_wait_range(struct address_space *mapping, 1486extern int filemap_write_and_wait_range(struct address_space *mapping,
1457 loff_t lstart, loff_t lend); 1487 loff_t lstart, loff_t lend);
1488extern int wait_on_page_writeback_range(struct address_space *mapping,
1489 pgoff_t start, pgoff_t end);
1490extern int __filemap_fdatawrite_range(struct address_space *mapping,
1491 loff_t start, loff_t end, int sync_mode);
1492
1493extern long do_fsync(struct file *file, int datasync);
1458extern void sync_supers(void); 1494extern void sync_supers(void);
1459extern void sync_filesystems(int wait); 1495extern void sync_filesystems(int wait);
1460extern void emergency_sync(void); 1496extern void emergency_sync(void);
@@ -1534,7 +1570,6 @@ extern void destroy_inode(struct inode *);
1534extern struct inode *new_inode(struct super_block *); 1570extern struct inode *new_inode(struct super_block *);
1535extern int remove_suid(struct dentry *); 1571extern int remove_suid(struct dentry *);
1536extern void remove_dquot_ref(struct super_block *, int, struct list_head *); 1572extern void remove_dquot_ref(struct super_block *, int, struct list_head *);
1537extern struct semaphore iprune_sem;
1538 1573
1539extern void __insert_inode_hash(struct inode *, unsigned long hashval); 1574extern void __insert_inode_hash(struct inode *, unsigned long hashval);
1540extern void remove_inode_hash(struct inode *); 1575extern void remove_inode_hash(struct inode *);
@@ -1576,6 +1611,8 @@ extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor
1576extern void do_generic_mapping_read(struct address_space *mapping, 1611extern void do_generic_mapping_read(struct address_space *mapping,
1577 struct file_ra_state *, struct file *, 1612 struct file_ra_state *, struct file *,
1578 loff_t *, read_descriptor_t *, read_actor_t); 1613 loff_t *, read_descriptor_t *, read_actor_t);
1614extern ssize_t generic_file_splice_read(struct file *, struct inode *, size_t, unsigned int);
1615extern ssize_t generic_file_splice_write(struct inode *, struct file *, size_t, unsigned int);
1579extern void 1616extern void
1580file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); 1617file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
1581extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, 1618extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov,
@@ -1619,7 +1656,7 @@ static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
1619 1656
1620ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 1657ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
1621 struct block_device *bdev, const struct iovec *iov, loff_t offset, 1658 struct block_device *bdev, const struct iovec *iov, loff_t offset,
1622 unsigned long nr_segs, get_blocks_t get_blocks, dio_iodone_t end_io, 1659 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
1623 int lock_type); 1660 int lock_type);
1624 1661
1625enum { 1662enum {
@@ -1630,32 +1667,32 @@ enum {
1630 1667
1631static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, 1668static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
1632 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 1669 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
1633 loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks, 1670 loff_t offset, unsigned long nr_segs, get_block_t get_block,
1634 dio_iodone_t end_io) 1671 dio_iodone_t end_io)
1635{ 1672{
1636 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 1673 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
1637 nr_segs, get_blocks, end_io, DIO_LOCKING); 1674 nr_segs, get_block, end_io, DIO_LOCKING);
1638} 1675}
1639 1676
1640static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb, 1677static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb,
1641 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 1678 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
1642 loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks, 1679 loff_t offset, unsigned long nr_segs, get_block_t get_block,
1643 dio_iodone_t end_io) 1680 dio_iodone_t end_io)
1644{ 1681{
1645 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 1682 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
1646 nr_segs, get_blocks, end_io, DIO_NO_LOCKING); 1683 nr_segs, get_block, end_io, DIO_NO_LOCKING);
1647} 1684}
1648 1685
1649static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, 1686static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb,
1650 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 1687 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
1651 loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks, 1688 loff_t offset, unsigned long nr_segs, get_block_t get_block,
1652 dio_iodone_t end_io) 1689 dio_iodone_t end_io)
1653{ 1690{
1654 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 1691 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
1655 nr_segs, get_blocks, end_io, DIO_OWN_LOCKING); 1692 nr_segs, get_block, end_io, DIO_OWN_LOCKING);
1656} 1693}
1657 1694
1658extern struct file_operations generic_ro_fops; 1695extern const struct file_operations generic_ro_fops;
1659 1696
1660#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) 1697#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
1661 1698
@@ -1711,9 +1748,9 @@ extern int simple_commit_write(struct file *file, struct page *page,
1711 1748
1712extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); 1749extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
1713extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); 1750extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
1714extern struct file_operations simple_dir_operations; 1751extern const struct file_operations simple_dir_operations;
1715extern struct inode_operations simple_dir_inode_operations; 1752extern struct inode_operations simple_dir_inode_operations;
1716struct tree_descr { char *name; struct file_operations *ops; int mode; }; 1753struct tree_descr { char *name; const struct file_operations *ops; int mode; };
1717struct dentry *d_alloc_name(struct dentry *, const char *); 1754struct dentry *d_alloc_name(struct dentry *, const char *);
1718extern int simple_fill_super(struct super_block *, int, struct tree_descr *); 1755extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
1719extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); 1756extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count);