diff options
Diffstat (limited to 'fs/ntfs/mft.c')
-rw-r--r-- | fs/ntfs/mft.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 3014a36a255b..37b2501caaa4 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c | |||
@@ -61,16 +61,16 @@ static inline MFT_RECORD *map_mft_record_page(ntfs_inode *ni) | |||
61 | * here if the volume was that big... | 61 | * here if the volume was that big... |
62 | */ | 62 | */ |
63 | index = (u64)ni->mft_no << vol->mft_record_size_bits >> | 63 | index = (u64)ni->mft_no << vol->mft_record_size_bits >> |
64 | PAGE_CACHE_SHIFT; | 64 | PAGE_SHIFT; |
65 | ofs = (ni->mft_no << vol->mft_record_size_bits) & ~PAGE_CACHE_MASK; | 65 | ofs = (ni->mft_no << vol->mft_record_size_bits) & ~PAGE_MASK; |
66 | 66 | ||
67 | i_size = i_size_read(mft_vi); | 67 | i_size = i_size_read(mft_vi); |
68 | /* The maximum valid index into the page cache for $MFT's data. */ | 68 | /* The maximum valid index into the page cache for $MFT's data. */ |
69 | end_index = i_size >> PAGE_CACHE_SHIFT; | 69 | end_index = i_size >> PAGE_SHIFT; |
70 | 70 | ||
71 | /* If the wanted index is out of bounds the mft record doesn't exist. */ | 71 | /* If the wanted index is out of bounds the mft record doesn't exist. */ |
72 | if (unlikely(index >= end_index)) { | 72 | if (unlikely(index >= end_index)) { |
73 | if (index > end_index || (i_size & ~PAGE_CACHE_MASK) < ofs + | 73 | if (index > end_index || (i_size & ~PAGE_MASK) < ofs + |
74 | vol->mft_record_size) { | 74 | vol->mft_record_size) { |
75 | page = ERR_PTR(-ENOENT); | 75 | page = ERR_PTR(-ENOENT); |
76 | ntfs_error(vol->sb, "Attempt to read mft record 0x%lx, " | 76 | ntfs_error(vol->sb, "Attempt to read mft record 0x%lx, " |
@@ -487,7 +487,7 @@ int ntfs_sync_mft_mirror(ntfs_volume *vol, const unsigned long mft_no, | |||
487 | } | 487 | } |
488 | /* Get the page containing the mirror copy of the mft record @m. */ | 488 | /* Get the page containing the mirror copy of the mft record @m. */ |
489 | page = ntfs_map_page(vol->mftmirr_ino->i_mapping, mft_no >> | 489 | page = ntfs_map_page(vol->mftmirr_ino->i_mapping, mft_no >> |
490 | (PAGE_CACHE_SHIFT - vol->mft_record_size_bits)); | 490 | (PAGE_SHIFT - vol->mft_record_size_bits)); |
491 | if (IS_ERR(page)) { | 491 | if (IS_ERR(page)) { |
492 | ntfs_error(vol->sb, "Failed to map mft mirror page."); | 492 | ntfs_error(vol->sb, "Failed to map mft mirror page."); |
493 | err = PTR_ERR(page); | 493 | err = PTR_ERR(page); |
@@ -497,7 +497,7 @@ int ntfs_sync_mft_mirror(ntfs_volume *vol, const unsigned long mft_no, | |||
497 | BUG_ON(!PageUptodate(page)); | 497 | BUG_ON(!PageUptodate(page)); |
498 | ClearPageUptodate(page); | 498 | ClearPageUptodate(page); |
499 | /* Offset of the mft mirror record inside the page. */ | 499 | /* Offset of the mft mirror record inside the page. */ |
500 | page_ofs = (mft_no << vol->mft_record_size_bits) & ~PAGE_CACHE_MASK; | 500 | page_ofs = (mft_no << vol->mft_record_size_bits) & ~PAGE_MASK; |
501 | /* The address in the page of the mirror copy of the mft record @m. */ | 501 | /* The address in the page of the mirror copy of the mft record @m. */ |
502 | kmirr = page_address(page) + page_ofs; | 502 | kmirr = page_address(page) + page_ofs; |
503 | /* Copy the mst protected mft record to the mirror. */ | 503 | /* Copy the mst protected mft record to the mirror. */ |
@@ -1178,8 +1178,8 @@ static int ntfs_mft_bitmap_find_and_alloc_free_rec_nolock(ntfs_volume *vol, | |||
1178 | for (; pass <= 2;) { | 1178 | for (; pass <= 2;) { |
1179 | /* Cap size to pass_end. */ | 1179 | /* Cap size to pass_end. */ |
1180 | ofs = data_pos >> 3; | 1180 | ofs = data_pos >> 3; |
1181 | page_ofs = ofs & ~PAGE_CACHE_MASK; | 1181 | page_ofs = ofs & ~PAGE_MASK; |
1182 | size = PAGE_CACHE_SIZE - page_ofs; | 1182 | size = PAGE_SIZE - page_ofs; |
1183 | ll = ((pass_end + 7) >> 3) - ofs; | 1183 | ll = ((pass_end + 7) >> 3) - ofs; |
1184 | if (size > ll) | 1184 | if (size > ll) |
1185 | size = ll; | 1185 | size = ll; |
@@ -1190,7 +1190,7 @@ static int ntfs_mft_bitmap_find_and_alloc_free_rec_nolock(ntfs_volume *vol, | |||
1190 | */ | 1190 | */ |
1191 | if (size) { | 1191 | if (size) { |
1192 | page = ntfs_map_page(mftbmp_mapping, | 1192 | page = ntfs_map_page(mftbmp_mapping, |
1193 | ofs >> PAGE_CACHE_SHIFT); | 1193 | ofs >> PAGE_SHIFT); |
1194 | if (IS_ERR(page)) { | 1194 | if (IS_ERR(page)) { |
1195 | ntfs_error(vol->sb, "Failed to read mft " | 1195 | ntfs_error(vol->sb, "Failed to read mft " |
1196 | "bitmap, aborting."); | 1196 | "bitmap, aborting."); |
@@ -1328,13 +1328,13 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(ntfs_volume *vol) | |||
1328 | */ | 1328 | */ |
1329 | ll = lcn >> 3; | 1329 | ll = lcn >> 3; |
1330 | page = ntfs_map_page(vol->lcnbmp_ino->i_mapping, | 1330 | page = ntfs_map_page(vol->lcnbmp_ino->i_mapping, |
1331 | ll >> PAGE_CACHE_SHIFT); | 1331 | ll >> PAGE_SHIFT); |
1332 | if (IS_ERR(page)) { | 1332 | if (IS_ERR(page)) { |
1333 | up_write(&mftbmp_ni->runlist.lock); | 1333 | up_write(&mftbmp_ni->runlist.lock); |
1334 | ntfs_error(vol->sb, "Failed to read from lcn bitmap."); | 1334 | ntfs_error(vol->sb, "Failed to read from lcn bitmap."); |
1335 | return PTR_ERR(page); | 1335 | return PTR_ERR(page); |
1336 | } | 1336 | } |
1337 | b = (u8*)page_address(page) + (ll & ~PAGE_CACHE_MASK); | 1337 | b = (u8*)page_address(page) + (ll & ~PAGE_MASK); |
1338 | tb = 1 << (lcn & 7ull); | 1338 | tb = 1 << (lcn & 7ull); |
1339 | down_write(&vol->lcnbmp_lock); | 1339 | down_write(&vol->lcnbmp_lock); |
1340 | if (*b != 0xff && !(*b & tb)) { | 1340 | if (*b != 0xff && !(*b & tb)) { |
@@ -2103,14 +2103,14 @@ static int ntfs_mft_record_format(const ntfs_volume *vol, const s64 mft_no) | |||
2103 | * The index into the page cache and the offset within the page cache | 2103 | * The index into the page cache and the offset within the page cache |
2104 | * page of the wanted mft record. | 2104 | * page of the wanted mft record. |
2105 | */ | 2105 | */ |
2106 | index = mft_no << vol->mft_record_size_bits >> PAGE_CACHE_SHIFT; | 2106 | index = mft_no << vol->mft_record_size_bits >> PAGE_SHIFT; |
2107 | ofs = (mft_no << vol->mft_record_size_bits) & ~PAGE_CACHE_MASK; | 2107 | ofs = (mft_no << vol->mft_record_size_bits) & ~PAGE_MASK; |
2108 | /* The maximum valid index into the page cache for $MFT's data. */ | 2108 | /* The maximum valid index into the page cache for $MFT's data. */ |
2109 | i_size = i_size_read(mft_vi); | 2109 | i_size = i_size_read(mft_vi); |
2110 | end_index = i_size >> PAGE_CACHE_SHIFT; | 2110 | end_index = i_size >> PAGE_SHIFT; |
2111 | if (unlikely(index >= end_index)) { | 2111 | if (unlikely(index >= end_index)) { |
2112 | if (unlikely(index > end_index || ofs + vol->mft_record_size >= | 2112 | if (unlikely(index > end_index || ofs + vol->mft_record_size >= |
2113 | (i_size & ~PAGE_CACHE_MASK))) { | 2113 | (i_size & ~PAGE_MASK))) { |
2114 | ntfs_error(vol->sb, "Tried to format non-existing mft " | 2114 | ntfs_error(vol->sb, "Tried to format non-existing mft " |
2115 | "record 0x%llx.", (long long)mft_no); | 2115 | "record 0x%llx.", (long long)mft_no); |
2116 | return -ENOENT; | 2116 | return -ENOENT; |
@@ -2515,8 +2515,8 @@ mft_rec_already_initialized: | |||
2515 | * We now have allocated and initialized the mft record. Calculate the | 2515 | * We now have allocated and initialized the mft record. Calculate the |
2516 | * index of and the offset within the page cache page the record is in. | 2516 | * index of and the offset within the page cache page the record is in. |
2517 | */ | 2517 | */ |
2518 | index = bit << vol->mft_record_size_bits >> PAGE_CACHE_SHIFT; | 2518 | index = bit << vol->mft_record_size_bits >> PAGE_SHIFT; |
2519 | ofs = (bit << vol->mft_record_size_bits) & ~PAGE_CACHE_MASK; | 2519 | ofs = (bit << vol->mft_record_size_bits) & ~PAGE_MASK; |
2520 | /* Read, map, and pin the page containing the mft record. */ | 2520 | /* Read, map, and pin the page containing the mft record. */ |
2521 | page = ntfs_map_page(vol->mft_ino->i_mapping, index); | 2521 | page = ntfs_map_page(vol->mft_ino->i_mapping, index); |
2522 | if (IS_ERR(page)) { | 2522 | if (IS_ERR(page)) { |