diff options
Diffstat (limited to 'fs/ntfs/inode.c')
-rw-r--r-- | fs/ntfs/inode.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index f47af5e6e230..898b9949d363 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /** | 1 | /** |
2 | * inode.c - NTFS kernel inode handling. Part of the Linux-NTFS project. | 2 | * inode.c - NTFS kernel inode handling. |
3 | * | 3 | * |
4 | * Copyright (c) 2001-2007 Anton Altaparmakov | 4 | * Copyright (c) 2001-2014 Anton Altaparmakov and Tuxera Inc. |
5 | * | 5 | * |
6 | * This program/include file is free software; you can redistribute it and/or | 6 | * This program/include file is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License as published | 7 | * modify it under the terms of the GNU General Public License as published |
@@ -1012,6 +1012,7 @@ skip_large_dir_stuff: | |||
1012 | /* Setup the operations for this inode. */ | 1012 | /* Setup the operations for this inode. */ |
1013 | vi->i_op = &ntfs_dir_inode_ops; | 1013 | vi->i_op = &ntfs_dir_inode_ops; |
1014 | vi->i_fop = &ntfs_dir_ops; | 1014 | vi->i_fop = &ntfs_dir_ops; |
1015 | vi->i_mapping->a_ops = &ntfs_mst_aops; | ||
1015 | } else { | 1016 | } else { |
1016 | /* It is a file. */ | 1017 | /* It is a file. */ |
1017 | ntfs_attr_reinit_search_ctx(ctx); | 1018 | ntfs_attr_reinit_search_ctx(ctx); |
@@ -1160,11 +1161,12 @@ no_data_attr_special_case: | |||
1160 | /* Setup the operations for this inode. */ | 1161 | /* Setup the operations for this inode. */ |
1161 | vi->i_op = &ntfs_file_inode_ops; | 1162 | vi->i_op = &ntfs_file_inode_ops; |
1162 | vi->i_fop = &ntfs_file_ops; | 1163 | vi->i_fop = &ntfs_file_ops; |
1164 | vi->i_mapping->a_ops = &ntfs_normal_aops; | ||
1165 | if (NInoMstProtected(ni)) | ||
1166 | vi->i_mapping->a_ops = &ntfs_mst_aops; | ||
1167 | else if (NInoCompressed(ni)) | ||
1168 | vi->i_mapping->a_ops = &ntfs_compressed_aops; | ||
1163 | } | 1169 | } |
1164 | if (NInoMstProtected(ni)) | ||
1165 | vi->i_mapping->a_ops = &ntfs_mst_aops; | ||
1166 | else | ||
1167 | vi->i_mapping->a_ops = &ntfs_aops; | ||
1168 | /* | 1170 | /* |
1169 | * The number of 512-byte blocks used on disk (for stat). This is in so | 1171 | * The number of 512-byte blocks used on disk (for stat). This is in so |
1170 | * far inaccurate as it doesn't account for any named streams or other | 1172 | * far inaccurate as it doesn't account for any named streams or other |
@@ -1414,10 +1416,11 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi) | |||
1414 | ni->allocated_size = sle64_to_cpu( | 1416 | ni->allocated_size = sle64_to_cpu( |
1415 | a->data.non_resident.allocated_size); | 1417 | a->data.non_resident.allocated_size); |
1416 | } | 1418 | } |
1419 | vi->i_mapping->a_ops = &ntfs_normal_aops; | ||
1417 | if (NInoMstProtected(ni)) | 1420 | if (NInoMstProtected(ni)) |
1418 | vi->i_mapping->a_ops = &ntfs_mst_aops; | 1421 | vi->i_mapping->a_ops = &ntfs_mst_aops; |
1419 | else | 1422 | else if (NInoCompressed(ni)) |
1420 | vi->i_mapping->a_ops = &ntfs_aops; | 1423 | vi->i_mapping->a_ops = &ntfs_compressed_aops; |
1421 | if ((NInoCompressed(ni) || NInoSparse(ni)) && ni->type != AT_INDEX_ROOT) | 1424 | if ((NInoCompressed(ni) || NInoSparse(ni)) && ni->type != AT_INDEX_ROOT) |
1422 | vi->i_blocks = ni->itype.compressed.size >> 9; | 1425 | vi->i_blocks = ni->itype.compressed.size >> 9; |
1423 | else | 1426 | else |