diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 14a97194b34b..70e61b58baaf 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -929,7 +929,7 @@ static inline struct file *get_file(struct file *f) | |||
929 | /* Page cache limit. The filesystems should put that into their s_maxbytes | 929 | /* Page cache limit. The filesystems should put that into their s_maxbytes |
930 | limits, otherwise bad things can happen in VM. */ | 930 | limits, otherwise bad things can happen in VM. */ |
931 | #if BITS_PER_LONG==32 | 931 | #if BITS_PER_LONG==32 |
932 | #define MAX_LFS_FILESIZE (((loff_t)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) | 932 | #define MAX_LFS_FILESIZE (((loff_t)PAGE_SIZE << (BITS_PER_LONG-1))-1) |
933 | #elif BITS_PER_LONG==64 | 933 | #elif BITS_PER_LONG==64 |
934 | #define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffffLL) | 934 | #define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffffLL) |
935 | #endif | 935 | #endif |
@@ -1241,6 +1241,16 @@ static inline struct inode *file_inode(const struct file *f) | |||
1241 | return f->f_inode; | 1241 | return f->f_inode; |
1242 | } | 1242 | } |
1243 | 1243 | ||
1244 | static inline struct dentry *file_dentry(const struct file *file) | ||
1245 | { | ||
1246 | struct dentry *dentry = file->f_path.dentry; | ||
1247 | |||
1248 | if (unlikely(dentry->d_flags & DCACHE_OP_REAL)) | ||
1249 | return dentry->d_op->d_real(dentry, file_inode(file)); | ||
1250 | else | ||
1251 | return dentry; | ||
1252 | } | ||
1253 | |||
1244 | static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) | 1254 | static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) |
1245 | { | 1255 | { |
1246 | return locks_lock_inode_wait(file_inode(filp), fl); | 1256 | return locks_lock_inode_wait(file_inode(filp), fl); |
@@ -2067,7 +2077,7 @@ extern int generic_update_time(struct inode *, struct timespec *, int); | |||
2067 | /* /sys/fs */ | 2077 | /* /sys/fs */ |
2068 | extern struct kobject *fs_kobj; | 2078 | extern struct kobject *fs_kobj; |
2069 | 2079 | ||
2070 | #define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK) | 2080 | #define MAX_RW_COUNT (INT_MAX & PAGE_MASK) |
2071 | 2081 | ||
2072 | #ifdef CONFIG_MANDATORY_FILE_LOCKING | 2082 | #ifdef CONFIG_MANDATORY_FILE_LOCKING |
2073 | extern int locks_mandatory_locked(struct file *); | 2083 | extern int locks_mandatory_locked(struct file *); |