Lines Matching refs:m
156 MFT_RECORD *m; in map_mft_record() local
166 m = map_mft_record_page(ni); in map_mft_record()
167 if (likely(!IS_ERR(m))) in map_mft_record()
168 return m; in map_mft_record()
172 ntfs_error(ni->vol->sb, "Failed with error code %lu.", -PTR_ERR(m)); in map_mft_record()
173 return m; in map_mft_record()
248 MFT_RECORD *m; in map_extent_mft_record() local
281 m = map_mft_record(ni); in map_extent_mft_record()
284 if (likely(!IS_ERR(m))) { in map_extent_mft_record()
286 if (likely(le16_to_cpu(m->sequence_number) == seq_no)) { in map_extent_mft_record()
289 return m; in map_extent_mft_record()
299 "mft record, error code %ld.", -PTR_ERR(m)); in map_extent_mft_record()
300 return m; in map_extent_mft_record()
314 m = map_mft_record(ni); in map_extent_mft_record()
315 if (IS_ERR(m)) { in map_extent_mft_record()
322 if (seq_no && (le16_to_cpu(m->sequence_number) != seq_no)) { in map_extent_mft_record()
326 m = ERR_PTR(-EIO); in map_extent_mft_record()
339 m = ERR_PTR(-ENOMEM); in map_extent_mft_record()
355 return m; in map_extent_mft_record()
366 return m; in map_extent_mft_record()
439 const unsigned long mft_no, MFT_RECORD *m) in ntfs_sync_mft_mirror_umount() argument
466 MFT_RECORD *m, int sync) in ntfs_sync_mft_mirror() argument
483 err = ntfs_sync_mft_mirror_umount(vol, mft_no, m); in ntfs_sync_mft_mirror()
504 memcpy(kmirr, m, vol->mft_record_size); in ntfs_sync_mft_mirror()
669 int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync) in write_mft_record_nolock() argument
772 err = pre_write_mst_fixup((NTFS_RECORD*)m, vol->mft_record_size); in write_mft_record_nolock()
792 ntfs_sync_mft_mirror(vol, ni->mft_no, m, sync); in write_mft_record_nolock()
810 ntfs_sync_mft_mirror(vol, ni->mft_no, m, sync); in write_mft_record_nolock()
812 post_write_mst_fixup((NTFS_RECORD*)m); in write_mft_record_nolock()
926 const MFT_RECORD *m, ntfs_inode **locked_ni) in ntfs_may_write_mft_record() argument
1003 if (!ntfs_is_mft_record(m->magic)) { in ntfs_may_write_mft_record()
1009 if (!m->base_mft_record) { in ntfs_may_write_mft_record()
1019 na.mft_no = MREF_LE(m->base_mft_record); in ntfs_may_write_mft_record()
2013 MFT_RECORD *m) in ntfs_mft_record_layout() argument
2024 memset(m, 0, vol->mft_record_size); in ntfs_mft_record_layout()
2027 m->usa_ofs = cpu_to_le16((sizeof(MFT_RECORD_OLD) + 1) & ~1); in ntfs_mft_record_layout()
2029 m->usa_ofs = cpu_to_le16((sizeof(MFT_RECORD) + 1) & ~1); in ntfs_mft_record_layout()
2034 m->reserved = 0; in ntfs_mft_record_layout()
2035 m->mft_record_number = cpu_to_le32((u32)mft_no); in ntfs_mft_record_layout()
2037 m->magic = magic_FILE; in ntfs_mft_record_layout()
2039 m->usa_count = cpu_to_le16(vol->mft_record_size / in ntfs_mft_record_layout()
2042 m->usa_count = cpu_to_le16(1); in ntfs_mft_record_layout()
2052 *(le16*)((u8*)m + le16_to_cpu(m->usa_ofs)) = cpu_to_le16(1); in ntfs_mft_record_layout()
2053 m->lsn = 0; in ntfs_mft_record_layout()
2054 m->sequence_number = cpu_to_le16(1); in ntfs_mft_record_layout()
2055 m->link_count = 0; in ntfs_mft_record_layout()
2060 m->attrs_offset = cpu_to_le16((le16_to_cpu(m->usa_ofs) + in ntfs_mft_record_layout()
2061 (le16_to_cpu(m->usa_count) << 1) + 7) & ~7); in ntfs_mft_record_layout()
2062 m->flags = 0; in ntfs_mft_record_layout()
2068 m->bytes_in_use = cpu_to_le32(le16_to_cpu(m->attrs_offset) + 8); in ntfs_mft_record_layout()
2069 m->bytes_allocated = cpu_to_le32(vol->mft_record_size); in ntfs_mft_record_layout()
2070 m->base_mft_record = 0; in ntfs_mft_record_layout()
2071 m->next_attr_instance = 0; in ntfs_mft_record_layout()
2073 a = (ATTR_RECORD*)((u8*)m + le16_to_cpu(m->attrs_offset)); in ntfs_mft_record_layout()
2096 MFT_RECORD *m; in ntfs_mft_record_format() local
2129 m = (MFT_RECORD*)((u8*)page_address(page) + ofs); in ntfs_mft_record_format()
2130 err = ntfs_mft_record_layout(vol, mft_no, m); in ntfs_mft_record_format()
2252 MFT_RECORD *m; in ntfs_mft_record_alloc() local
2459 m = map_mft_record(mft_ni); in ntfs_mft_record_alloc()
2460 if (IS_ERR(m)) { in ntfs_mft_record_alloc()
2462 err = PTR_ERR(m); in ntfs_mft_record_alloc()
2465 ctx = ntfs_attr_get_search_ctx(mft_ni, m); in ntfs_mft_record_alloc()
2531 m = (MFT_RECORD*)((u8*)page_address(page) + ofs); in ntfs_mft_record_alloc()
2535 if (ntfs_is_file_record(m->magic) && in ntfs_mft_record_alloc()
2536 (m->flags & MFT_RECORD_IN_USE)) { in ntfs_mft_record_alloc()
2556 seq_no = m->sequence_number; in ntfs_mft_record_alloc()
2557 usn = *(le16*)((u8*)m + le16_to_cpu(m->usa_ofs)); in ntfs_mft_record_alloc()
2558 err = ntfs_mft_record_layout(vol, bit, m); in ntfs_mft_record_alloc()
2568 m->sequence_number = seq_no; in ntfs_mft_record_alloc()
2570 *(le16*)((u8*)m + le16_to_cpu(m->usa_ofs)) = usn; in ntfs_mft_record_alloc()
2573 m->flags |= MFT_RECORD_IN_USE; in ntfs_mft_record_alloc()
2575 m->flags |= MFT_RECORD_IS_DIRECTORY; in ntfs_mft_record_alloc()
2584 m->base_mft_record = MK_LE_MREF(base_ni->mft_no, in ntfs_mft_record_alloc()
2591 m = map_extent_mft_record(base_ni, bit, &ni); in ntfs_mft_record_alloc()
2592 if (IS_ERR(m)) { in ntfs_mft_record_alloc()
2595 err = PTR_ERR(m); in ntfs_mft_record_alloc()
2597 m->flags &= cpu_to_le16( in ntfs_mft_record_alloc()
2630 m->flags &= cpu_to_le16( in ntfs_mft_record_alloc()
2701 vi->i_generation = ni->seq_no = le16_to_cpu(m->sequence_number); in ntfs_mft_record_alloc()
2735 *mrec = m; in ntfs_mft_record_alloc()
2781 int ntfs_extent_mft_record_free(ntfs_inode *ni, MFT_RECORD *m) in ntfs_extent_mft_record_free() argument
2842 m->flags &= const_cpu_to_le16(~const_le16_to_cpu(MFT_RECORD_IN_USE)); in ntfs_extent_mft_record_free()
2845 old_seq_no = m->sequence_number; in ntfs_extent_mft_record_free()
2851 m->sequence_number = cpu_to_le16(seq_no); in ntfs_extent_mft_record_free()
2859 err = write_mft_record(ni, m, 0); in ntfs_extent_mft_record_free()
2907 m->flags |= MFT_RECORD_IN_USE; in ntfs_extent_mft_record_free()
2908 m->sequence_number = old_seq_no; in ntfs_extent_mft_record_free()