.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /** |
---|
2 | 3 | * mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project. |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc. |
---|
5 | 6 | * Copyright (c) 2002 Richard Russon |
---|
6 | | - * |
---|
7 | | - * This program/include file is free software; you can redistribute it and/or |
---|
8 | | - * modify it under the terms of the GNU General Public License as published |
---|
9 | | - * by the Free Software Foundation; either version 2 of the License, or |
---|
10 | | - * (at your option) any later version. |
---|
11 | | - * |
---|
12 | | - * This program/include file is distributed in the hope that it will be |
---|
13 | | - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
---|
14 | | - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | | - * GNU General Public License for more details. |
---|
16 | | - * |
---|
17 | | - * You should have received a copy of the GNU General Public License |
---|
18 | | - * along with this program (in the main directory of the Linux-NTFS |
---|
19 | | - * distribution in the file COPYING); if not, write to the Free Software |
---|
20 | | - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
21 | 7 | */ |
---|
22 | 8 | |
---|
23 | 9 | #include <linux/buffer_head.h> |
---|
.. | .. |
---|
85 | 71 | } |
---|
86 | 72 | /* Read, map, and pin the page. */ |
---|
87 | 73 | page = ntfs_map_page(mft_vi->i_mapping, index); |
---|
88 | | - if (likely(!IS_ERR(page))) { |
---|
| 74 | + if (!IS_ERR(page)) { |
---|
89 | 75 | /* Catch multi sector transfer fixup errors. */ |
---|
90 | 76 | if (likely(ntfs_is_mft_recordp((le32*)(page_address(page) + |
---|
91 | 77 | ofs)))) { |
---|
.. | .. |
---|
168 | 154 | mutex_lock(&ni->mrec_lock); |
---|
169 | 155 | |
---|
170 | 156 | m = map_mft_record_page(ni); |
---|
171 | | - if (likely(!IS_ERR(m))) |
---|
| 157 | + if (!IS_ERR(m)) |
---|
172 | 158 | return m; |
---|
173 | 159 | |
---|
174 | 160 | mutex_unlock(&ni->mrec_lock); |
---|
.. | .. |
---|
285 | 271 | m = map_mft_record(ni); |
---|
286 | 272 | /* map_mft_record() has incremented this on success. */ |
---|
287 | 273 | atomic_dec(&ni->count); |
---|
288 | | - if (likely(!IS_ERR(m))) { |
---|
| 274 | + if (!IS_ERR(m)) { |
---|
289 | 275 | /* Verify the sequence number. */ |
---|
290 | 276 | if (likely(le16_to_cpu(m->sequence_number) == seq_no)) { |
---|
291 | 277 | ntfs_debug("Done 1."); |
---|
.. | .. |
---|
518 | 504 | bh = bh->b_this_page; |
---|
519 | 505 | } while (bh); |
---|
520 | 506 | tail->b_this_page = head; |
---|
521 | | - attach_page_buffers(page, head); |
---|
| 507 | + attach_page_private(page, head); |
---|
522 | 508 | } |
---|
523 | 509 | bh = head = page_buffers(page); |
---|
524 | 510 | BUG_ON(!bh); |
---|
.. | .. |
---|
972 | 958 | * dirty code path of the inode dirty code path when writing |
---|
973 | 959 | * $MFT occurs. |
---|
974 | 960 | */ |
---|
975 | | - vi = ilookup5_nowait(sb, mft_no, (test_t)ntfs_test_inode, &na); |
---|
| 961 | + vi = ilookup5_nowait(sb, mft_no, ntfs_test_inode, &na); |
---|
976 | 962 | } |
---|
977 | 963 | if (vi) { |
---|
978 | 964 | ntfs_debug("Base inode 0x%lx is in icache.", mft_no); |
---|
.. | .. |
---|
1033 | 1019 | vi = igrab(mft_vi); |
---|
1034 | 1020 | BUG_ON(vi != mft_vi); |
---|
1035 | 1021 | } else |
---|
1036 | | - vi = ilookup5_nowait(sb, na.mft_no, (test_t)ntfs_test_inode, |
---|
| 1022 | + vi = ilookup5_nowait(sb, na.mft_no, ntfs_test_inode, |
---|
1037 | 1023 | &na); |
---|
1038 | 1024 | if (!vi) { |
---|
1039 | 1025 | /* |
---|
.. | .. |
---|
1317 | 1303 | read_unlock_irqrestore(&mftbmp_ni->size_lock, flags); |
---|
1318 | 1304 | rl = ntfs_attr_find_vcn_nolock(mftbmp_ni, |
---|
1319 | 1305 | (ll - 1) >> vol->cluster_size_bits, NULL); |
---|
1320 | | - if (unlikely(IS_ERR(rl) || !rl->length || rl->lcn < 0)) { |
---|
| 1306 | + if (IS_ERR(rl) || unlikely(!rl->length || rl->lcn < 0)) { |
---|
1321 | 1307 | up_write(&mftbmp_ni->runlist.lock); |
---|
1322 | 1308 | ntfs_error(vol->sb, "Failed to determine last allocated " |
---|
1323 | 1309 | "cluster of mft bitmap attribute."); |
---|
.. | .. |
---|
1748 | 1734 | read_unlock_irqrestore(&mft_ni->size_lock, flags); |
---|
1749 | 1735 | rl = ntfs_attr_find_vcn_nolock(mft_ni, |
---|
1750 | 1736 | (ll - 1) >> vol->cluster_size_bits, NULL); |
---|
1751 | | - if (unlikely(IS_ERR(rl) || !rl->length || rl->lcn < 0)) { |
---|
| 1737 | + if (IS_ERR(rl) || unlikely(!rl->length || rl->lcn < 0)) { |
---|
1752 | 1738 | up_write(&mft_ni->runlist.lock); |
---|
1753 | 1739 | ntfs_error(vol->sb, "Failed to determine last allocated " |
---|
1754 | 1740 | "cluster of mft data attribute."); |
---|
.. | .. |
---|
1790 | 1776 | do { |
---|
1791 | 1777 | rl2 = ntfs_cluster_alloc(vol, old_last_vcn, nr, lcn, MFT_ZONE, |
---|
1792 | 1778 | true); |
---|
1793 | | - if (likely(!IS_ERR(rl2))) |
---|
| 1779 | + if (!IS_ERR(rl2)) |
---|
1794 | 1780 | break; |
---|
1795 | 1781 | if (PTR_ERR(rl2) != -ENOSPC || nr == min_nr) { |
---|
1796 | 1782 | ntfs_error(vol->sb, "Failed to allocate the minimal " |
---|