Skip to content

Commit f037776

Browse files
fs/ntfs3: Code formatting
clang-format-15 was used to format code according kernel's .clang-format. Signed-off-by: Konstantin Komarov <[email protected]>
1 parent f1d325b commit f037776

File tree

14 files changed

+92
-83
lines changed

14 files changed

+92
-83
lines changed

fs/ntfs3/attrib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
573573
sbi, run, vcn, lcn, to_allocate, &pre_alloc,
574574
is_mft ? ALLOCATE_MFT : ALLOCATE_DEF, &alen,
575575
is_mft ? 0 :
576-
(sbi->record_size -
576+
(sbi->record_size -
577577
le32_to_cpu(rec->used) + 8) /
578578
3 +
579579
1,

fs/ntfs3/bitmap.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ static void wnd_add_free_ext(struct wnd_bitmap *wnd, size_t bit, size_t len,
287287
/* Check bits before 'bit'. */
288288
ib = wnd->zone_bit == wnd->zone_end ||
289289
bit < wnd->zone_end ?
290-
0 :
291-
wnd->zone_end;
290+
0 :
291+
wnd->zone_end;
292292

293293
while (bit > ib && wnd_is_free_hlp(wnd, bit - 1, 1)) {
294294
bit -= 1;
@@ -298,8 +298,8 @@ static void wnd_add_free_ext(struct wnd_bitmap *wnd, size_t bit, size_t len,
298298
/* Check bits after 'end_in'. */
299299
ib = wnd->zone_bit == wnd->zone_end ||
300300
end_in > wnd->zone_bit ?
301-
wnd->nbits :
302-
wnd->zone_bit;
301+
wnd->nbits :
302+
wnd->zone_bit;
303303

304304
while (end_in < ib && wnd_is_free_hlp(wnd, end_in, 1)) {
305305
end_in += 1;
@@ -418,7 +418,7 @@ static void wnd_remove_free_ext(struct wnd_bitmap *wnd, size_t bit, size_t len)
418418
n3 = rb_first(&wnd->count_tree);
419419
wnd->extent_max =
420420
n3 ? rb_entry(n3, struct e_node, count.node)->count.key :
421-
0;
421+
0;
422422
return;
423423
}
424424

fs/ntfs3/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static int ntfs_zero_range(struct inode *inode, u64 vbo, u64 vbo_to)
192192
for (; idx < idx_end; idx += 1, from = 0) {
193193
page_off = (loff_t)idx << PAGE_SHIFT;
194194
to = (page_off + PAGE_SIZE) > vbo_to ? (vbo_to - page_off) :
195-
PAGE_SIZE;
195+
PAGE_SIZE;
196196
iblock = page_off >> inode->i_blkbits;
197197

198198
page = find_or_create_page(mapping, idx,
@@ -1052,7 +1052,7 @@ static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
10521052
goto out;
10531053

10541054
ret = is_compressed(ni) ? ntfs_compress_write(iocb, from) :
1055-
__generic_file_write_iter(iocb, from);
1055+
__generic_file_write_iter(iocb, from);
10561056

10571057
out:
10581058
inode_unlock(inode);

fs/ntfs3/frecord.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct ATTR_STD_INFO *ni_std(struct ntfs_inode *ni)
7777

7878
attr = mi_find_attr(&ni->mi, NULL, ATTR_STD, NULL, 0, NULL);
7979
return attr ? resident_data_ex(attr, sizeof(struct ATTR_STD_INFO)) :
80-
NULL;
80+
NULL;
8181
}
8282

8383
/*
@@ -92,7 +92,7 @@ struct ATTR_STD_INFO5 *ni_std5(struct ntfs_inode *ni)
9292
attr = mi_find_attr(&ni->mi, NULL, ATTR_STD, NULL, 0, NULL);
9393

9494
return attr ? resident_data_ex(attr, sizeof(struct ATTR_STD_INFO5)) :
95-
NULL;
95+
NULL;
9696
}
9797

9898
/*
@@ -517,6 +517,9 @@ ni_ins_new_attr(struct ntfs_inode *ni, struct mft_inode *mi,
517517
*/
518518
static int ni_repack(struct ntfs_inode *ni)
519519
{
520+
#if 1
521+
return 0;
522+
#else
520523
int err = 0;
521524
struct ntfs_sb_info *sbi = ni->mi.sbi;
522525
struct mft_inode *mi, *mi_p = NULL;
@@ -639,6 +642,7 @@ static int ni_repack(struct ntfs_inode *ni)
639642

640643
run_close(&run);
641644
return err;
645+
#endif
642646
}
643647

644648
/*
@@ -1758,8 +1762,8 @@ int ni_new_attr_flags(struct ntfs_inode *ni, enum FILE_ATTRIBUTE new_fa)
17581762

17591763
/* Resize nonresident empty attribute in-place only. */
17601764
new_asize = (new_aflags & (ATTR_FLAG_COMPRESSED | ATTR_FLAG_SPARSED)) ?
1761-
(SIZEOF_NONRESIDENT_EX + 8) :
1762-
(SIZEOF_NONRESIDENT + 8);
1765+
(SIZEOF_NONRESIDENT_EX + 8) :
1766+
(SIZEOF_NONRESIDENT + 8);
17631767

17641768
if (!mi_resize_attr(mi, attr, new_asize - le32_to_cpu(attr->size)))
17651769
return -EOPNOTSUPP;
@@ -3161,8 +3165,8 @@ static bool ni_update_parent(struct ntfs_inode *ni, struct NTFS_DUP_INFO *dup,
31613165
__le64 valid_le;
31623166

31633167
dup->alloc_size = is_attr_ext(attr) ?
3164-
attr->nres.total_size :
3165-
attr->nres.alloc_size;
3168+
attr->nres.total_size :
3169+
attr->nres.alloc_size;
31663170
dup->data_size = attr->nres.data_size;
31673171

31683172
if (new_valid > data_size)

fs/ntfs3/fslog.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -828,8 +828,8 @@ static inline struct RESTART_TABLE *extend_rsttbl(struct RESTART_TABLE *tbl,
828828
memcpy(rt + 1, tbl + 1, esize * used);
829829

830830
rt->free_goal = free_goal == ~0u ?
831-
cpu_to_le32(~0u) :
832-
cpu_to_le32(sizeof(struct RESTART_TABLE) +
831+
cpu_to_le32(~0u) :
832+
cpu_to_le32(sizeof(struct RESTART_TABLE) +
833833
free_goal * esize);
834834

835835
if (tbl->first_free) {
@@ -1090,8 +1090,8 @@ static inline u64 base_lsn(struct ntfs_log *log,
10901090
<< log->file_data_bits) +
10911091
((((is_log_record_end(hdr) &&
10921092
h_lsn <= le64_to_cpu(hdr->record_hdr.last_end_lsn)) ?
1093-
le16_to_cpu(hdr->record_hdr.next_record_off) :
1094-
log->page_size) +
1093+
le16_to_cpu(hdr->record_hdr.next_record_off) :
1094+
log->page_size) +
10951095
lsn) >>
10961096
3);
10971097

@@ -1299,8 +1299,8 @@ static void log_init_pg_hdr(struct ntfs_log *log, u32 sys_page_size,
12991299
log->clst_per_page = 1;
13001300

13011301
log->first_page = major_ver >= 2 ?
1302-
0x22 * page_size :
1303-
((sys_page_size << 1) + (page_size << 1));
1302+
0x22 * page_size :
1303+
((sys_page_size << 1) + (page_size << 1));
13041304
log->major_ver = major_ver;
13051305
log->minor_ver = minor_ver;
13061306
}
@@ -1513,18 +1513,18 @@ static u32 current_log_avail(struct ntfs_log *log)
15131513
* If there is no oldest lsn then start at the first page of the file.
15141514
*/
15151515
oldest_off = (log->l_flags & NTFSLOG_NO_OLDEST_LSN) ?
1516-
log->first_page :
1517-
(log->oldest_lsn_off & ~log->sys_page_mask);
1516+
log->first_page :
1517+
(log->oldest_lsn_off & ~log->sys_page_mask);
15181518

15191519
/*
15201520
* We will use the next log page offset to compute the next free page.
15211521
* If we are going to reuse this page go to the next page.
15221522
* If we are at the first page then use the end of the file.
15231523
*/
15241524
next_free_off = (log->l_flags & NTFSLOG_REUSE_TAIL) ?
1525-
log->next_page + log->page_size :
1525+
log->next_page + log->page_size :
15261526
log->next_page == log->first_page ? log->l_size :
1527-
log->next_page;
1527+
log->next_page;
15281528

15291529
/* If the two offsets are the same then there is no available space. */
15301530
if (oldest_off == next_free_off)
@@ -1535,8 +1535,8 @@ static u32 current_log_avail(struct ntfs_log *log)
15351535
*/
15361536
free_bytes =
15371537
oldest_off < next_free_off ?
1538-
log->total_avail_pages - (next_free_off - oldest_off) :
1539-
oldest_off - next_free_off;
1538+
log->total_avail_pages - (next_free_off - oldest_off) :
1539+
oldest_off - next_free_off;
15401540

15411541
free_bytes >>= log->page_bits;
15421542
return free_bytes * log->reserved;
@@ -1671,7 +1671,7 @@ static int last_log_lsn(struct ntfs_log *log)
16711671

16721672
best_lsn1 = first_tail ? base_lsn(log, first_tail, first_file_off) : 0;
16731673
best_lsn2 = second_tail ? base_lsn(log, second_tail, second_file_off) :
1674-
0;
1674+
0;
16751675

16761676
if (first_tail && second_tail) {
16771677
if (best_lsn1 > best_lsn2) {
@@ -1767,7 +1767,7 @@ static int last_log_lsn(struct ntfs_log *log)
17671767
page_cnt = page_pos = 1;
17681768

17691769
curpage_off = seq_base == log->seq_num ? min(log->next_page, page_off) :
1770-
log->next_page;
1770+
log->next_page;
17711771

17721772
wrapped_file =
17731773
curpage_off == log->first_page &&
@@ -1826,8 +1826,8 @@ static int last_log_lsn(struct ntfs_log *log)
18261826
((lsn_cur >> log->file_data_bits) +
18271827
((curpage_off <
18281828
(lsn_to_vbo(log, lsn_cur) & ~log->page_mask)) ?
1829-
1 :
1830-
0)) != expected_seq) {
1829+
1 :
1830+
0)) != expected_seq) {
18311831
goto check_tail;
18321832
}
18331833

@@ -2643,8 +2643,8 @@ static inline bool check_index_root(const struct ATTRIB *attr,
26432643
const struct INDEX_ROOT *root = resident_data(attr);
26442644
u8 index_bits = le32_to_cpu(root->index_block_size) >=
26452645
sbi->cluster_size ?
2646-
sbi->cluster_bits :
2647-
SECTOR_SHIFT;
2646+
sbi->cluster_bits :
2647+
SECTOR_SHIFT;
26482648
u8 block_clst = root->index_block_clst;
26492649

26502650
if (le32_to_cpu(attr->res.data_size) < sizeof(struct INDEX_ROOT) ||
@@ -3861,9 +3861,9 @@ int log_replay(struct ntfs_inode *ni, bool *initialized)
38613861

38623862
/* If we have a valid page then grab a pointer to the restart area. */
38633863
ra2 = rst_info.valid_page ?
3864-
Add2Ptr(rst_info.r_page,
3864+
Add2Ptr(rst_info.r_page,
38653865
le16_to_cpu(rst_info.r_page->ra_off)) :
3866-
NULL;
3866+
NULL;
38673867

38683868
if (rst_info.chkdsk_was_run ||
38693869
(ra2 && ra2->client_idx[1] == LFS_NO_CLIENT_LE)) {

fs/ntfs3/fsntfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ int ntfs_fix_post_read(struct NTFS_RECORD_HEADER *rhdr, size_t bytes,
173173

174174
fo = le16_to_cpu(rhdr->fix_off);
175175
fn = simple ? ((bytes >> SECTOR_SHIFT) + 1) :
176-
le16_to_cpu(rhdr->fix_num);
176+
le16_to_cpu(rhdr->fix_num);
177177

178178
/* Check errors. */
179179
if ((fo & 1) || fo + fn * sizeof(short) > SECTOR_SIZE || !fn-- ||

fs/ntfs3/index.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,8 @@ static int scan_nres_bitmap(struct ntfs_inode *ni, struct ATTRIB *bitmap,
432432
nbits = 8 * (data_size - vbo);
433433

434434
ok = nbits > from ?
435-
(*fn)((ulong *)bh->b_data, from, nbits, ret) :
436-
false;
435+
(*fn)((ulong *)bh->b_data, from, nbits, ret) :
436+
false;
437437
put_bh(bh);
438438

439439
if (ok) {
@@ -1682,8 +1682,8 @@ static int indx_insert_into_root(struct ntfs_index *indx, struct ntfs_inode *ni,
16821682

16831683
/* Create alloc and bitmap attributes (if not). */
16841684
err = run_is_empty(&indx->alloc_run) ?
1685-
indx_create_allocate(indx, ni, &new_vbn) :
1686-
indx_add_allocate(indx, ni, &new_vbn);
1685+
indx_create_allocate(indx, ni, &new_vbn) :
1686+
indx_add_allocate(indx, ni, &new_vbn);
16871687

16881688
/* Layout of record may be changed, so rescan root. */
16891689
root = indx_get_root(indx, ni, &attr, &mi);
@@ -1874,8 +1874,8 @@ indx_insert_into_buffer(struct ntfs_index *indx, struct ntfs_inode *ni,
18741874
(*indx->cmp)(new_de + 1, le16_to_cpu(new_de->key_size),
18751875
up_e + 1, le16_to_cpu(up_e->key_size),
18761876
ctx) < 0 ?
1877-
hdr2 :
1878-
hdr1,
1877+
hdr2 :
1878+
hdr1,
18791879
new_de, NULL, ctx);
18801880

18811881
indx_mark_used(indx, ni, new_vbn >> indx->idx2vbn_bits);
@@ -2346,7 +2346,7 @@ int indx_delete_entry(struct ntfs_index *indx, struct ntfs_inode *ni,
23462346
re, ctx,
23472347
fnd->level - 1,
23482348
fnd) :
2349-
indx_insert_into_root(indx, ni, re, e,
2349+
indx_insert_into_root(indx, ni, re, e,
23502350
ctx, fnd, 0);
23512351
kfree(re);
23522352

fs/ntfs3/inode.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static struct inode *ntfs_read_mft(struct inode *inode,
263263
goto next_attr;
264264

265265
run = ino == MFT_REC_BITMAP ? &sbi->used.bitmap.run :
266-
&ni->file.run;
266+
&ni->file.run;
267267
break;
268268

269269
case ATTR_ROOT:
@@ -291,8 +291,8 @@ static struct inode *ntfs_read_mft(struct inode *inode,
291291
goto out;
292292

293293
mode = sb->s_root ?
294-
(S_IFDIR | (0777 & sbi->options->fs_dmask_inv)) :
295-
(S_IFDIR | 0777);
294+
(S_IFDIR | (0777 & sbi->options->fs_dmask_inv)) :
295+
(S_IFDIR | 0777);
296296
goto next_attr;
297297

298298
case ATTR_ALLOC:
@@ -450,7 +450,7 @@ static struct inode *ntfs_read_mft(struct inode *inode,
450450
inode->i_op = &ntfs_file_inode_operations;
451451
inode->i_fop = &ntfs_file_operations;
452452
inode->i_mapping->a_ops = is_compressed(ni) ? &ntfs_aops_cmpr :
453-
&ntfs_aops;
453+
&ntfs_aops;
454454
if (ino != MFT_REC_MFT)
455455
init_rwsem(&ni->file.run_lock);
456456
} else if (S_ISCHR(mode) || S_ISBLK(mode) || S_ISFIFO(mode) ||
@@ -787,7 +787,7 @@ static ssize_t ntfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
787787

788788
ret = blockdev_direct_IO(iocb, inode, iter,
789789
wr ? ntfs_get_block_direct_IO_W :
790-
ntfs_get_block_direct_IO_R);
790+
ntfs_get_block_direct_IO_R);
791791

792792
if (ret > 0)
793793
end = vbo + ret;
@@ -1191,11 +1191,11 @@ ntfs_create_reparse_buffer(struct ntfs_sb_info *sbi, const char *symname,
11911191
* - ntfs_symlink
11921192
* - ntfs_mkdir
11931193
* - ntfs_atomic_open
1194-
*
1194+
*
11951195
* NOTE: if fnd != NULL (ntfs_atomic_open) then @dir is locked
11961196
*/
1197-
struct inode *ntfs_create_inode(struct mnt_idmap *idmap,
1198-
struct inode *dir, struct dentry *dentry,
1197+
struct inode *ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
1198+
struct dentry *dentry,
11991199
const struct cpu_str *uni, umode_t mode,
12001200
dev_t dev, const char *symname, u32 size,
12011201
struct ntfs_fnd *fnd)
@@ -1605,7 +1605,7 @@ struct inode *ntfs_create_inode(struct mnt_idmap *idmap,
16051605
inode->i_op = &ntfs_file_inode_operations;
16061606
inode->i_fop = &ntfs_file_operations;
16071607
inode->i_mapping->a_ops = is_compressed(ni) ? &ntfs_aops_cmpr :
1608-
&ntfs_aops;
1608+
&ntfs_aops;
16091609
init_rwsem(&ni->file.run_lock);
16101610
} else {
16111611
inode->i_op = &ntfs_special_inode_operations;

fs/ntfs3/lznt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static inline ssize_t decompress_chunk(u8 *unc, u8 *unc_end, const u8 *cmpr,
297297
struct lznt *get_lznt_ctx(int level)
298298
{
299299
struct lznt *r = kzalloc(level ? offsetof(struct lznt, hash) :
300-
sizeof(struct lznt),
300+
sizeof(struct lznt),
301301
GFP_NOFS);
302302

303303
if (r)
@@ -393,8 +393,8 @@ ssize_t decompress_lznt(const void *cmpr, size_t cmpr_size, void *unc,
393393
} else {
394394
/* This chunk does not contain compressed data. */
395395
unc_use = unc_chunk + LZNT_CHUNK_SIZE > unc_end ?
396-
unc_end - unc_chunk :
397-
LZNT_CHUNK_SIZE;
396+
unc_end - unc_chunk :
397+
LZNT_CHUNK_SIZE;
398398

399399
if (cmpr_chunk + sizeof(chunk_hdr) + unc_use >
400400
cmpr_end) {

0 commit comments

Comments
 (0)