diff options
Diffstat (limited to 'include/linux/fs.h')
| -rw-r--r-- | include/linux/fs.h | 73 |
1 files changed, 41 insertions, 32 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 215696a0f1..408fe89498 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 |
| @@ -247,9 +252,6 @@ extern void __init files_init(unsigned long); | |||
| 247 | struct buffer_head; | 252 | struct buffer_head; |
| 248 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, | 253 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, |
| 249 | struct buffer_head *bh_result, int create); | 254 | struct buffer_head *bh_result, int create); |
| 250 | typedef int (get_blocks_t)(struct inode *inode, sector_t iblock, | ||
| 251 | unsigned long max_blocks, | ||
| 252 | struct buffer_head *bh_result, int create); | ||
| 253 | typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | 255 | typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, |
| 254 | ssize_t bytes, void *private); | 256 | ssize_t bytes, void *private); |
| 255 | 257 | ||
| @@ -345,7 +347,7 @@ struct writeback_control; | |||
| 345 | struct address_space_operations { | 347 | struct address_space_operations { |
| 346 | int (*writepage)(struct page *page, struct writeback_control *wbc); | 348 | int (*writepage)(struct page *page, struct writeback_control *wbc); |
| 347 | int (*readpage)(struct file *, struct page *); | 349 | int (*readpage)(struct file *, struct page *); |
| 348 | int (*sync_page)(struct page *); | 350 | void (*sync_page)(struct page *); |
| 349 | 351 | ||
| 350 | /* Write back some dirty pages from this mapping. */ | 352 | /* Write back some dirty pages from this mapping. */ |
| 351 | int (*writepages)(struct address_space *, struct writeback_control *); | 353 | int (*writepages)(struct address_space *, struct writeback_control *); |
| @@ -364,7 +366,7 @@ struct address_space_operations { | |||
| 364 | int (*commit_write)(struct file *, struct page *, unsigned, unsigned); | 366 | int (*commit_write)(struct file *, struct page *, unsigned, unsigned); |
| 365 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ | 367 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ |
| 366 | sector_t (*bmap)(struct address_space *, sector_t); | 368 | sector_t (*bmap)(struct address_space *, sector_t); |
| 367 | int (*invalidatepage) (struct page *, unsigned long); | 369 | void (*invalidatepage) (struct page *, unsigned long); |
| 368 | int (*releasepage) (struct page *, gfp_t); | 370 | int (*releasepage) (struct page *, gfp_t); |
| 369 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 371 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, |
| 370 | loff_t offset, unsigned long nr_segs); | 372 | loff_t offset, unsigned long nr_segs); |
| @@ -408,6 +410,9 @@ struct block_device { | |||
| 408 | struct list_head bd_inodes; | 410 | struct list_head bd_inodes; |
| 409 | void * bd_holder; | 411 | void * bd_holder; |
| 410 | int bd_holders; | 412 | int bd_holders; |
| 413 | #ifdef CONFIG_SYSFS | ||
| 414 | struct list_head bd_holder_list; | ||
| 415 | #endif | ||
| 411 | struct block_device * bd_contains; | 416 | struct block_device * bd_contains; |
| 412 | unsigned bd_block_size; | 417 | unsigned bd_block_size; |
| 413 | struct hd_struct * bd_part; | 418 | struct hd_struct * bd_part; |
| @@ -485,13 +490,13 @@ struct inode { | |||
| 485 | unsigned int i_blkbits; | 490 | unsigned int i_blkbits; |
| 486 | unsigned long i_blksize; | 491 | unsigned long i_blksize; |
| 487 | unsigned long i_version; | 492 | unsigned long i_version; |
| 488 | unsigned long i_blocks; | 493 | blkcnt_t i_blocks; |
| 489 | unsigned short i_bytes; | 494 | unsigned short i_bytes; |
| 490 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | 495 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ |
| 491 | struct mutex i_mutex; | 496 | struct mutex i_mutex; |
| 492 | struct rw_semaphore i_alloc_sem; | 497 | struct rw_semaphore i_alloc_sem; |
| 493 | struct inode_operations *i_op; | 498 | struct inode_operations *i_op; |
| 494 | struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 499 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |
| 495 | struct super_block *i_sb; | 500 | struct super_block *i_sb; |
| 496 | struct file_lock *i_flock; | 501 | struct file_lock *i_flock; |
| 497 | struct address_space *i_mapping; | 502 | struct address_space *i_mapping; |
| @@ -631,7 +636,7 @@ struct file { | |||
| 631 | } f_u; | 636 | } f_u; |
| 632 | struct dentry *f_dentry; | 637 | struct dentry *f_dentry; |
| 633 | struct vfsmount *f_vfsmnt; | 638 | struct vfsmount *f_vfsmnt; |
| 634 | struct file_operations *f_op; | 639 | const struct file_operations *f_op; |
| 635 | atomic_t f_count; | 640 | atomic_t f_count; |
| 636 | unsigned int f_flags; | 641 | unsigned int f_flags; |
| 637 | mode_t f_mode; | 642 | mode_t f_mode; |
| @@ -673,7 +678,6 @@ extern spinlock_t files_lock; | |||
| 673 | #define FL_POSIX 1 | 678 | #define FL_POSIX 1 |
| 674 | #define FL_FLOCK 2 | 679 | #define FL_FLOCK 2 |
| 675 | #define FL_ACCESS 8 /* not trying to lock, just looking */ | 680 | #define FL_ACCESS 8 /* not trying to lock, just looking */ |
| 676 | #define FL_LOCKD 16 /* lock held by rpc.lockd */ | ||
| 677 | #define FL_LEASE 32 /* lease held on this file */ | 681 | #define FL_LEASE 32 /* lease held on this file */ |
| 678 | #define FL_SLEEP 128 /* A blocking lock */ | 682 | #define FL_SLEEP 128 /* A blocking lock */ |
| 679 | 683 | ||
| @@ -737,8 +741,6 @@ struct file_lock { | |||
| 737 | #define OFFT_OFFSET_MAX INT_LIMIT(off_t) | 741 | #define OFFT_OFFSET_MAX INT_LIMIT(off_t) |
| 738 | #endif | 742 | #endif |
| 739 | 743 | ||
| 740 | extern struct list_head file_lock_list; | ||
| 741 | |||
| 742 | #include <linux/fcntl.h> | 744 | #include <linux/fcntl.h> |
| 743 | 745 | ||
| 744 | extern int fcntl_getlk(struct file *, struct flock __user *); | 746 | extern int fcntl_getlk(struct file *, struct flock __user *); |
| @@ -760,10 +762,10 @@ extern void locks_init_lock(struct file_lock *); | |||
| 760 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); | 762 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); |
| 761 | extern void locks_remove_posix(struct file *, fl_owner_t); | 763 | extern void locks_remove_posix(struct file *, fl_owner_t); |
| 762 | extern void locks_remove_flock(struct file *); | 764 | extern void locks_remove_flock(struct file *); |
| 763 | extern struct file_lock *posix_test_lock(struct file *, struct file_lock *); | 765 | extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *); |
| 766 | extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_lock *); | ||
| 764 | extern int posix_lock_file(struct file *, struct file_lock *); | 767 | extern int posix_lock_file(struct file *, struct file_lock *); |
| 765 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | 768 | extern int posix_lock_file_wait(struct file *, struct file_lock *); |
| 766 | extern void posix_block_lock(struct file_lock *, struct file_lock *); | ||
| 767 | extern int posix_unblock_lock(struct file *, struct file_lock *); | 769 | extern int posix_unblock_lock(struct file *, struct file_lock *); |
| 768 | extern int posix_locks_deadlock(struct file_lock *, struct file_lock *); | 770 | extern int posix_locks_deadlock(struct file_lock *, struct file_lock *); |
| 769 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | 771 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); |
| @@ -1092,6 +1094,7 @@ struct super_operations { | |||
| 1092 | void (*umount_begin) (struct super_block *); | 1094 | void (*umount_begin) (struct super_block *); |
| 1093 | 1095 | ||
| 1094 | int (*show_options)(struct seq_file *, struct vfsmount *); | 1096 | int (*show_options)(struct seq_file *, struct vfsmount *); |
| 1097 | int (*show_stats)(struct seq_file *, struct vfsmount *); | ||
| 1095 | 1098 | ||
| 1096 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); | 1099 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); |
| 1097 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); | 1100 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); |
| @@ -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 | ||
| @@ -1558,7 +1568,6 @@ extern void destroy_inode(struct inode *); | |||
| 1558 | extern struct inode *new_inode(struct super_block *); | 1568 | extern struct inode *new_inode(struct super_block *); |
| 1559 | extern int remove_suid(struct dentry *); | 1569 | extern int remove_suid(struct dentry *); |
| 1560 | extern void remove_dquot_ref(struct super_block *, int, struct list_head *); | 1570 | extern void remove_dquot_ref(struct super_block *, int, struct list_head *); |
| 1561 | extern struct mutex iprune_mutex; | ||
| 1562 | 1571 | ||
| 1563 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); | ||
