diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 65 |
1 files changed, 58 insertions, 7 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 44e3cb2f1966..a6a625be13fc 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -947,6 +947,14 @@ struct lock_manager_operations { | |||
947 | int (*fl_change)(struct file_lock **, int); | 947 | int (*fl_change)(struct file_lock **, int); |
948 | }; | 948 | }; |
949 | 949 | ||
950 | struct lock_manager { | ||
951 | struct list_head list; | ||
952 | }; | ||
953 | |||
954 | void locks_start_grace(struct lock_manager *); | ||
955 | void locks_end_grace(struct lock_manager *); | ||
956 | int locks_in_grace(void); | ||
957 | |||
950 | /* that will die - we need it for nfs_lock_info */ | 958 | /* that will die - we need it for nfs_lock_info */ |
951 | #include <linux/nfs_fs_i.h> | 959 | #include <linux/nfs_fs_i.h> |
952 | 960 | ||
@@ -988,6 +996,13 @@ struct file_lock { | |||
988 | 996 | ||
989 | #include <linux/fcntl.h> | 997 | #include <linux/fcntl.h> |
990 | 998 | ||
999 | extern void send_sigio(struct fown_struct *fown, int fd, int band); | ||
1000 | |||
1001 | /* fs/sync.c */ | ||
1002 | extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset, | ||
1003 | loff_t endbyte, unsigned int flags); | ||
1004 | |||
1005 | #ifdef CONFIG_FILE_LOCKING | ||
991 | extern int fcntl_getlk(struct file *, struct flock __user *); | 1006 | extern int fcntl_getlk(struct file *, struct flock __user *); |
992 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int, | 1007 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int, |
993 | struct flock __user *); | 1008 | struct flock __user *); |
@@ -998,14 +1013,9 @@ extern int fcntl_setlk64(unsigned int, struct file *, unsigned int, | |||
998 | struct flock64 __user *); | 1013 | struct flock64 __user *); |
999 | #endif | 1014 | #endif |
1000 | 1015 | ||
1001 | extern void send_sigio(struct fown_struct *fown, int fd, int band); | ||
1002 | extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); | 1016 | extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); |
1003 | extern int fcntl_getlease(struct file *filp); | 1017 | extern int fcntl_getlease(struct file *filp); |
1004 | 1018 | ||
1005 | /* fs/sync.c */ | ||
1006 | extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset, | ||
1007 | loff_t endbyte, unsigned int flags); | ||
1008 | |||
1009 | /* fs/locks.c */ | 1019 | /* fs/locks.c */ |
1010 | extern void locks_init_lock(struct file_lock *); | 1020 | extern void locks_init_lock(struct file_lock *); |
1011 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); | 1021 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); |
@@ -1028,6 +1038,37 @@ extern int lease_modify(struct file_lock **, int); | |||
1028 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); | 1038 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); |
1029 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); | 1039 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); |
1030 | extern struct seq_operations locks_seq_operations; | 1040 | extern struct seq_operations locks_seq_operations; |
1041 | #else /* !CONFIG_FILE_LOCKING */ | ||
1042 | #define fcntl_getlk(a, b) ({ -EINVAL; }) | ||
1043 | #define fcntl_setlk(a, b, c, d) ({ -EACCES; }) | ||
1044 | #if BITS_PER_LONG == 32 | ||
1045 | #define fcntl_getlk64(a, b) ({ -EINVAL; }) | ||
1046 | #define fcntl_setlk64(a, b, c, d) ({ -EACCES; }) | ||
1047 | #endif | ||
1048 | #define fcntl_setlease(a, b, c) ({ 0; }) | ||
1049 | #define fcntl_getlease(a) ({ 0; }) | ||
1050 | #define locks_init_lock(a) ({ }) | ||
1051 | #define __locks_copy_lock(a, b) ({ }) | ||
1052 | #define locks_copy_lock(a, b) ({ }) | ||
1053 | #define locks_remove_posix(a, b) ({ }) | ||
1054 | #define locks_remove_flock(a) ({ }) | ||
1055 | #define posix_test_lock(a, b) ({ 0; }) | ||
1056 | #define posix_lock_file(a, b, c) ({ -ENOLCK; }) | ||
1057 | #define posix_lock_file_wait(a, b) ({ -ENOLCK; }) | ||
1058 | #define posix_unblock_lock(a, b) (-ENOENT) | ||
1059 | #define vfs_test_lock(a, b) ({ 0; }) | ||
1060 | #define vfs_lock_file(a, b, c, d) (-ENOLCK) | ||
1061 | #define vfs_cancel_lock(a, b) ({ 0; }) | ||
1062 | #define flock_lock_file_wait(a, b) ({ -ENOLCK; }) | ||
1063 | #define __break_lease(a, b) ({ 0; }) | ||
1064 | #define lease_get_mtime(a, b) ({ }) | ||
1065 | #define generic_setlease(a, b, c) ({ -EINVAL; }) | ||
1066 | #define vfs_setlease(a, b, c) ({ -EINVAL; }) | ||
1067 | #define lease_modify(a, b) ({ -EINVAL; }) | ||
1068 | #define lock_may_read(a, b, c) ({ 1; }) | ||
1069 | #define lock_may_write(a, b, c) ({ 1; }) | ||
1070 | #endif /* !CONFIG_FILE_LOCKING */ | ||
1071 | |||
1031 | 1072 | ||
1032 | struct fasync_struct { | 1073 | struct fasync_struct { |
1033 | int magic; | 1074 | int magic; |
@@ -1575,9 +1616,12 @@ extern int vfs_statfs(struct dentry *, struct kstatfs *); | |||
1575 | /* /sys/fs */ | 1616 | /* /sys/fs */ |
1576 | extern struct kobject *fs_kobj; | 1617 | extern struct kobject *fs_kobj; |
1577 | 1618 | ||
1619 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); | ||
1620 | |||
1578 | #define FLOCK_VERIFY_READ 1 | 1621 | #define FLOCK_VERIFY_READ 1 |
1579 | #define FLOCK_VERIFY_WRITE 2 | 1622 | #define FLOCK_VERIFY_WRITE 2 |
1580 | 1623 | ||
1624 | #ifdef CONFIG_FILE_LOCKING | ||
1581 | extern int locks_mandatory_locked(struct inode *); | 1625 | extern int locks_mandatory_locked(struct inode *); |
1582 | extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t); | 1626 | extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t); |
1583 | 1627 | ||
@@ -1608,8 +1652,6 @@ static inline int locks_verify_locked(struct inode *inode) | |||
1608 | return 0; | 1652 | return 0; |
1609 | } | 1653 | } |
1610 | 1654 | ||
1611 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); | ||
1612 | |||
1613 | static inline int locks_verify_truncate(struct inode *inode, | 1655 | static inline int locks_verify_truncate(struct inode *inode, |
1614 | struct file *filp, | 1656 | struct file *filp, |
1615 | loff_t size) | 1657 | loff_t size) |
@@ -1630,6 +1672,15 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1630 | return __break_lease(inode, mode); | 1672 | return __break_lease(inode, mode); |
1631 | return 0; | 1673 | return 0; |
1632 | } | 1674 | } |
1675 | #else /* !CONFIG_FILE_LOCKING */ | ||
1676 | #define locks_mandatory_locked(a) ({ 0; }) | ||
1677 | #define locks_mandatory_area(a, b, c, d, e) ({ 0; }) | ||
1678 | #define __mandatory_lock(a) ({ 0; }) | ||
1679 | #define mandatory_lock(a) ({ 0; }) | ||
1680 | #define locks_verify_locked(a) ({ 0; }) | ||
1681 | #define locks_verify_truncate(a, b, c) ({ 0; }) | ||
1682 | #define break_lease(a, b) ({ 0; }) | ||
1683 | #endif /* CONFIG_FILE_LOCKING */ | ||
1633 | 1684 | ||
1634 | /* fs/open.c */ | 1685 | /* fs/open.c */ |
1635 | 1686 | ||