ntfs_fs.h (fa3cacf544636b2dc48cfb2f277a2071f14d66a2) | ntfs_fs.h (195c52bdd5d5ecfdabf5a7c6159efe299e534f84) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * 4 * Copyright (C) 2019-2021 Paragon Software GmbH, All rights reserved. 5 * 6 */ 7 8// clang-format off --- 589 unchanged lines hidden (view full) --- 598void mark_as_free_ex(struct ntfs_sb_info *sbi, CLST lcn, CLST len, bool trim); 599int run_deallocate(struct ntfs_sb_info *sbi, struct runs_tree *run, bool trim); 600 601/* globals from index.c */ 602int indx_used_bit(struct ntfs_index *indx, struct ntfs_inode *ni, size_t *bit); 603void fnd_clear(struct ntfs_fnd *fnd); 604static inline struct ntfs_fnd *fnd_get(void) 605{ | 1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * 4 * Copyright (C) 2019-2021 Paragon Software GmbH, All rights reserved. 5 * 6 */ 7 8// clang-format off --- 589 unchanged lines hidden (view full) --- 598void mark_as_free_ex(struct ntfs_sb_info *sbi, CLST lcn, CLST len, bool trim); 599int run_deallocate(struct ntfs_sb_info *sbi, struct runs_tree *run, bool trim); 600 601/* globals from index.c */ 602int indx_used_bit(struct ntfs_index *indx, struct ntfs_inode *ni, size_t *bit); 603void fnd_clear(struct ntfs_fnd *fnd); 604static inline struct ntfs_fnd *fnd_get(void) 605{ |
606 return ntfs_zalloc(sizeof(struct ntfs_fnd)); | 606 return kzalloc(sizeof(struct ntfs_fnd), GFP_NOFS); |
607} 608static inline void fnd_put(struct ntfs_fnd *fnd) 609{ 610 if (fnd) { 611 fnd_clear(fnd); | 607} 608static inline void fnd_put(struct ntfs_fnd *fnd) 609{ 610 if (fnd) { 611 fnd_clear(fnd); |
612 ntfs_free(fnd); | 612 kfree(fnd); |
613 } 614} 615void indx_clear(struct ntfs_index *idx); 616int indx_init(struct ntfs_index *indx, struct ntfs_sb_info *sbi, 617 const struct ATTRIB *attr, enum index_mutex_classed type); 618struct INDEX_ROOT *indx_get_root(struct ntfs_index *indx, struct ntfs_inode *ni, 619 struct ATTRIB **attr, struct mft_inode **mi); 620int indx_read(struct ntfs_index *idx, struct ntfs_inode *ni, CLST vbn, --- 249 unchanged lines hidden (view full) --- 870{ 871 run->runs = NULL; 872 run->count = 0; 873 run->allocated = 0; 874} 875 876static inline struct runs_tree *run_alloc(void) 877{ | 613 } 614} 615void indx_clear(struct ntfs_index *idx); 616int indx_init(struct ntfs_index *indx, struct ntfs_sb_info *sbi, 617 const struct ATTRIB *attr, enum index_mutex_classed type); 618struct INDEX_ROOT *indx_get_root(struct ntfs_index *indx, struct ntfs_inode *ni, 619 struct ATTRIB **attr, struct mft_inode **mi); 620int indx_read(struct ntfs_index *idx, struct ntfs_inode *ni, CLST vbn, --- 249 unchanged lines hidden (view full) --- 870{ 871 run->runs = NULL; 872 run->count = 0; 873 run->allocated = 0; 874} 875 876static inline struct runs_tree *run_alloc(void) 877{ |
878 return ntfs_zalloc(sizeof(struct runs_tree)); | 878 return kzalloc(sizeof(struct runs_tree), GFP_NOFS); |
879} 880 881static inline void run_close(struct runs_tree *run) 882{ | 879} 880 881static inline void run_close(struct runs_tree *run) 882{ |
883 ntfs_vfree(run->runs); | 883 kvfree(run->runs); |
884 memset(run, 0, sizeof(*run)); 885} 886 887static inline void run_free(struct runs_tree *run) 888{ 889 if (run) { | 884 memset(run, 0, sizeof(*run)); 885} 886 887static inline void run_free(struct runs_tree *run) 888{ 889 if (run) { |
890 ntfs_vfree(run->runs); 891 ntfs_free(run); | 890 kvfree(run->runs); 891 kfree(run); |
892 } 893} 894 895static inline bool run_is_empty(struct runs_tree *run) 896{ 897 return !run->count; 898} 899 --- 139 unchanged lines hidden (view full) --- 1039 nb->nbufs = 0; 1040} 1041 1042static inline void put_indx_node(struct indx_node *in) 1043{ 1044 if (!in) 1045 return; 1046 | 892 } 893} 894 895static inline bool run_is_empty(struct runs_tree *run) 896{ 897 return !run->count; 898} 899 --- 139 unchanged lines hidden (view full) --- 1039 nb->nbufs = 0; 1040} 1041 1042static inline void put_indx_node(struct indx_node *in) 1043{ 1044 if (!in) 1045 return; 1046 |
1047 ntfs_free(in->index); | 1047 kfree(in->index); |
1048 nb_put(&in->nb); | 1048 nb_put(&in->nb); |
1049 ntfs_free(in); | 1049 kfree(in); |
1050} 1051 1052static inline void mi_clear(struct mft_inode *mi) 1053{ 1054 nb_put(&mi->nb); | 1050} 1051 1052static inline void mi_clear(struct mft_inode *mi) 1053{ 1054 nb_put(&mi->nb); |
1055 ntfs_free(mi->mrec); | 1055 kfree(mi->mrec); |
1056 mi->mrec = NULL; 1057} 1058 1059static inline void ni_lock(struct ntfs_inode *ni) 1060{ 1061 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_NORMAL); 1062} 1063 --- 29 unchanged lines hidden --- | 1056 mi->mrec = NULL; 1057} 1058 1059static inline void ni_lock(struct ntfs_inode *ni) 1060{ 1061 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_NORMAL); 1062} 1063 --- 29 unchanged lines hidden --- |