Lines Matching +full:super +full:- +full:frames

1 /* SPDX-License-Identifier: GPL-2.0 */
4 * Copyright (C) 2019-2021 Paragon Software GmbH, All rights reserved.
8 // clang-format off
19 #include <linux/page-flags.h>
42 #define MINUS_ONE_T ((size_t)(-1))
54 /* NTFS specific error code about resident->nonresident. */
58 /* NTFS specific error code when on-disk struct is corrupted. */
62 /* sbi->flags */
73 /* ni->ni_flags */
76 * 1 - WOF_COMPRESSION_XPRESS4K
77 * 2 - WOF_COMPRESSION_XPRESS8K
78 * 3 - WOF_COMPRESSION_XPRESS16K
79 * 4 - WOF_COMPRESSION_LZX32K
88 // clang-format on
160 * -1 Tree is activated but not updated (too many fragments).
161 * 0 - Tree is not activated.
162 * 1 - Tree is activated and updated.
188 /* ntfs_index - Allocation unit inside directory. */
198 u8 index_bits; // log2(root->index_block_size)
199 u8 idx2vbn_bits; // log2(root->index_block_clst)
209 /* Ntfs file system in-core superblock data. */
214 u64 discard_granularity_mask_inv; // ~(discard_granularity_mask_inv-1)
217 u32 cluster_mask; // == cluster_size - 1
218 u64 cluster_mask_inv; // ~(cluster_size - 1)
219 u32 block_mask; // sb->s_blocksize - 1
220 u32 blocks_per_cluster; // cluster_size / sb->s_blocksize
258 * MFT records [11-24) used to expand MFT itself.
262 ulong reserved_bitmap; // Bitmap of used records [11 - 24)
349 * Ntfs inode - extends linux inode. consists of one or more MFT inodes.
355 * Valid size: [0 - i_valid) - these range in file contains valid data.
356 * Range [i_valid - inode->i_size) - contains 0.
357 * Usually i_valid <= inode->i_size.
382 * If inode is bad during initialization - use make_bad_inode
383 * If inode is bad during operations - use this field
453 struct runs_tree *run, u64 frame, u64 frames,
754 return mi_find_attr(ni, rec, NULL, le->type, le_name(le), le->name_len, in rec_find_attr_le()
755 &le->id); in rec_find_attr_le()
772 if (le32_to_cpu(ref->low) != mi->rno) in mi_is_ref()
774 if (ref->seq != mi->mrec->seq) in mi_is_ref()
778 return le16_to_cpu(ref->high) == (mi->rno >> 32); in mi_is_ref()
780 return !ref->high; in mi_is_ref()
786 ref->low = cpu_to_le32(mi->rno); in mi_get_ref()
788 ref->high = cpu_to_le16(mi->rno >> 32); in mi_get_ref()
790 ref->high = 0; in mi_get_ref()
792 ref->seq = mi->mrec->seq; in mi_get_ref()
825 /* Globals from super.c */
837 return wnd->total_zeroes; in wnd_zeroes()
898 return sbi->volume.major_ver >= 3; in is_ntfs3()
901 /* (sb->s_flags & SB_ACTIVE) */
904 return !!sbi->sb->s_root; in is_mounted()
909 return rno < MFT_REC_FREE || rno == sbi->objid_no || in ntfs_is_meta_file()
910 rno == sbi->quota_no || rno == sbi->reparse_no || in ntfs_is_meta_file()
911 rno == sbi->usn_jrnl_no; in ntfs_is_meta_file()
916 return wnd->zone_bit; in wnd_zone_bit()
921 return wnd->zone_end - wnd->zone_bit; in wnd_zone_len()
926 run->runs = NULL; in run_init()
927 run->count = 0; in run_init()
928 run->allocated = 0; in run_init()
938 kvfree(run->runs); in run_close()
945 kvfree(run->runs); in run_free()
952 return !run->count; in run_is_empty()
967 * kernel2nt - Converts in-memory kernel timestamp into nt time.
973 (ts->tv_sec + SecondsToStartOf1970) + in kernel2nt()
974 ts->tv_nsec / NTFS_TIME_GRAN); in kernel2nt()
978 * nt2kernel - Converts on-disk nt time into kernel timestamp.
982 u64 t = le64_to_cpu(tm) - _100ns2seconds * SecondsToStartOf1970; in nt2kernel()
985 ts->tv_nsec = do_div(t, _100ns2seconds) * 100; in nt2kernel()
986 ts->tv_sec = t; in nt2kernel()
991 return sb->s_fs_info; in ntfs_sb()
996 return test_bit(NTFS_FLAGS_SHUTDOWN_BIT, &ntfs_sb(sb)->flags); in ntfs3_forced_shutdown()
1000 * ntfs_up_cluster - Align up on cluster boundary.
1004 return (size + sbi->cluster_mask) & sbi->cluster_mask_inv; in ntfs_up_cluster()
1008 * ntfs_up_block - Align up on cluster boundary.
1012 return (size + sb->s_blocksize - 1) & ~(u64)(sb->s_blocksize - 1); in ntfs_up_block()
1017 return (size + sbi->cluster_mask) >> sbi->cluster_bits; in bytes_to_cluster()
1022 return (size + sb->s_blocksize - 1) >> sb->s_blocksize_bits; in bytes_to_block()
1032 return (ni->std_fa & FILE_ATTRIBUTE_COMPRESSED) || in is_compressed()
1033 (ni->ni_flags & NI_FLAG_COMPRESSED_MASK); in is_compressed()
1038 return ni->ni_bad; in is_bad_ni()
1043 return 0xb + (ni->ni_flags & NI_FLAG_COMPRESSED_MASK); in ni_ext_compress_bits()
1046 /* Bits - 0xc, 0xd, 0xe, 0xf, 0x10 */
1049 ni->ni_flags |= (bits - 0xb) & NI_FLAG_COMPRESSED_MASK; in ni_set_ext_compress_bits()
1054 return ni->ni_flags & NI_FLAG_DEDUPLICATED; in is_dedup()
1059 return ni->std_fa & FILE_ATTRIBUTE_ENCRYPTED; in is_encrypted()
1064 return ni->std_fa & FILE_ATTRIBUTE_SPARSE_FILE; in is_sparsed()
1069 return ni->ni_flags & NI_FLAG_RESIDENT; in is_resident()
1074 *var = cpu_to_le16(le16_to_cpu(*var) - val); in le16_sub_cpu()
1079 *var = cpu_to_le32(le32_to_cpu(*var) - val); in le32_sub_cpu()
1084 u32 i, nbufs = nb->nbufs; in nb_put()
1090 put_bh(nb->bh[i]); in nb_put()
1091 nb->nbufs = 0; in nb_put()
1099 kfree(in->index); in put_indx_node()
1100 nb_put(&in->nb); in put_indx_node()
1106 nb_put(&mi->nb); in mi_clear()
1107 kfree(mi->mrec); in mi_clear()
1108 mi->mrec = NULL; in mi_clear()
1113 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_NORMAL); in ni_lock()
1118 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_PARENT); in ni_lock_dir()
1123 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_PARENT2); in ni_lock_dir2()
1128 mutex_unlock(&ni->ni_lock); in ni_unlock()
1133 return mutex_trylock(&ni->ni_lock); in ni_trylock()
1140 return attr_load_runs_vcn(ni, attr->type, attr_name(attr), in attr_load_runs_attr()
1141 attr->name_len, run, vcn); in attr_load_runs_attr()
1146 *var = cpu_to_le64(le64_to_cpu(*var) - val); in le64_sub_cpu()