summaryrefslogtreecommitdiff
path: root/fs/ntfs3/attrib.c
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2023-01-17 15:01:00 +0400
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2023-03-27 17:44:35 +0400
commit96de65a9413e0422233b285368e8a9a64e461187 (patch)
treeb90c01696305460d6332cbb76673ed169541c8b6 /fs/ntfs3/attrib.c
parent75c5e0c9e5cad34deeec7c131c2b1368df5a8c75 (diff)
fs/ntfs3: Code formatting and refactoring
Added minor refactoring. Added and fixed some comments. In some places, the code has been reformatted to fit into 80 columns. clang-format-12 was used to format code according kernel's .clang-format. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/attrib.c')
-rw-r--r--fs/ntfs3/attrib.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c
index 5e6bafb10f42..0b8bc66377db 100644
--- a/fs/ntfs3/attrib.c
+++ b/fs/ntfs3/attrib.c
@@ -405,8 +405,8 @@ int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
int err = 0;
struct ntfs_sb_info *sbi = ni->mi.sbi;
u8 cluster_bits = sbi->cluster_bits;
- bool is_mft =
- ni->mi.rno == MFT_REC_MFT && type == ATTR_DATA && !name_len;
+ bool is_mft = ni->mi.rno == MFT_REC_MFT && type == ATTR_DATA &&
+ !name_len;
u64 old_valid, old_size, old_alloc, new_alloc, new_alloc_tmp;
struct ATTRIB *attr = NULL, *attr_b;
struct ATTR_LIST_ENTRY *le, *le_b;
@@ -531,11 +531,10 @@ add_alloc_in_same_attr_seg:
pre_alloc = 0;
if (type == ATTR_DATA && !name_len &&
sbi->options->prealloc) {
- pre_alloc =
- bytes_to_cluster(
- sbi,
- get_pre_allocated(new_size)) -
- new_alen;
+ pre_alloc = bytes_to_cluster(
+ sbi, get_pre_allocated(
+ new_size)) -
+ new_alen;
}
/* Get the last LCN to allocate from. */
@@ -573,8 +572,8 @@ add_alloc_in_same_attr_seg:
err = attr_allocate_clusters(
sbi, run, vcn, lcn, to_allocate, &pre_alloc,
is_mft ? ALLOCATE_MFT : ALLOCATE_DEF, &alen,
- is_mft ? 0
- : (sbi->record_size -
+ is_mft ? 0 :
+ (sbi->record_size -
le32_to_cpu(rec->used) + 8) /
3 +
1,