diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-23 17:07:38 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-22 23:31:31 -0500 |
commit | 496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch) | |
tree | 8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /mm/nommu.c | |
parent | 57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff) |
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/nommu.c')
-rw-r--r-- | mm/nommu.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/nommu.c b/mm/nommu.c index 79c3cac87afa..f87d2173d0d0 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -941,7 +941,7 @@ static int validate_mmap_request(struct file *file, | |||
941 | */ | 941 | */ |
942 | mapping = file->f_mapping; | 942 | mapping = file->f_mapping; |
943 | if (!mapping) | 943 | if (!mapping) |
944 | mapping = file->f_path.dentry->d_inode->i_mapping; | 944 | mapping = file_inode(file)->i_mapping; |
945 | 945 | ||
946 | capabilities = 0; | 946 | capabilities = 0; |
947 | if (mapping && mapping->backing_dev_info) | 947 | if (mapping && mapping->backing_dev_info) |
@@ -950,7 +950,7 @@ static int validate_mmap_request(struct file *file, | |||
950 | if (!capabilities) { | 950 | if (!capabilities) { |
951 | /* no explicit capabilities set, so assume some | 951 | /* no explicit capabilities set, so assume some |
952 | * defaults */ | 952 | * defaults */ |
953 | switch (file->f_path.dentry->d_inode->i_mode & S_IFMT) { | 953 | switch (file_inode(file)->i_mode & S_IFMT) { |
954 | case S_IFREG: | 954 | case S_IFREG: |
955 | case S_IFBLK: | 955 | case S_IFBLK: |
956 | capabilities = BDI_CAP_MAP_COPY; | 956 | capabilities = BDI_CAP_MAP_COPY; |
@@ -985,11 +985,11 @@ static int validate_mmap_request(struct file *file, | |||
985 | !(file->f_mode & FMODE_WRITE)) | 985 | !(file->f_mode & FMODE_WRITE)) |
986 | return -EACCES; | 986 | return -EACCES; |
987 | 987 | ||
988 | if (IS_APPEND(file->f_path.dentry->d_inode) && | 988 | if (IS_APPEND(file_inode(file)) && |
989 | (file->f_mode & FMODE_WRITE)) | 989 | (file->f_mode & FMODE_WRITE)) |
990 | return -EACCES; | 990 | return -EACCES; |
991 | 991 | ||
992 | if (locks_verify_locked(file->f_path.dentry->d_inode)) | 992 | if (locks_verify_locked(file_inode(file))) |
993 | return -EAGAIN; | 993 | return -EAGAIN; |
994 | 994 | ||
995 | if (!(capabilities & BDI_CAP_MAP_DIRECT)) | 995 | if (!(capabilities & BDI_CAP_MAP_DIRECT)) |
@@ -1322,8 +1322,8 @@ unsigned long do_mmap_pgoff(struct file *file, | |||
1322 | continue; | 1322 | continue; |
1323 | 1323 | ||
1324 | /* search for overlapping mappings on the same file */ | 1324 | /* search for overlapping mappings on the same file */ |
1325 | if (pregion->vm_file->f_path.dentry->d_inode != | 1325 | if (file_inode(pregion->vm_file) != |
1326 | file->f_path.dentry->d_inode) | 1326 | file_inode(file)) |
1327 | continue; | 1327 | continue; |
1328 | 1328 | ||
1329 | if (pregion->vm_pgoff >= pgend) | 1329 | if (pregion->vm_pgoff >= pgend) |