summaryrefslogtreecommitdiff
path: root/fs/ntfs3/attrib.c
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2021-08-31 16:57:40 +0300
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2021-08-31 19:07:12 +0300
commitd3624466b56dd5b1886c1dff500525b544c19c83 (patch)
tree76c47b06dc905526e306f6d4195390b1b2793f72 /fs/ntfs3/attrib.c
parent78ab59fee07f22464f32eafebab2bd97ba94ff2d (diff)
fs/ntfs3: Restyle comments to better align with kernel-doc
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/attrib.c')
-rw-r--r--fs/ntfs3/attrib.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c
index ffc323bacc9f..34c4cbf7e29b 100644
--- a/fs/ntfs3/attrib.c
+++ b/fs/ntfs3/attrib.c
@@ -199,6 +199,7 @@ int attr_allocate_clusters(struct ntfs_sb_info *sbi, struct runs_tree *run,
/* Add new fragment into run storage. */
if (!run_add_entry(run, vcn, lcn, flen, opt == ALLOCATE_MFT)) {
+ /* Undo last 'ntfs_look_for_free_space' */
down_write_nested(&wnd->rw_lock, BITMAP_MUTEX_CLUSTERS);
wnd_set_free(wnd, lcn, flen);
up_write(&wnd->rw_lock);
@@ -351,7 +352,6 @@ out2:
run_close(run);
out1:
kfree(attr_s);
- /* Reinsert le. */
out:
return err;
}
@@ -1153,14 +1153,18 @@ int attr_load_runs_vcn(struct ntfs_inode *ni, enum ATTR_TYPE type,
u16 ro;
attr = ni_find_attr(ni, NULL, NULL, type, name, name_len, &vcn, NULL);
- if (!attr)
+ if (!attr) {
+ /* Is record corrupted? */
return -ENOENT;
+ }
svcn = le64_to_cpu(attr->nres.svcn);
evcn = le64_to_cpu(attr->nres.evcn);
- if (evcn < vcn || vcn < svcn)
+ if (evcn < vcn || vcn < svcn) {
+ /* Is record corrupted? */
return -EINVAL;
+ }
ro = le16_to_cpu(attr->nres.run_off);
err = run_unpack_ex(run, ni->mi.sbi, ni->mi.rno, svcn, evcn, svcn,
@@ -1171,7 +1175,7 @@ int attr_load_runs_vcn(struct ntfs_inode *ni, enum ATTR_TYPE type,
}
/*
- * attr_wof_load_runs_range - Load runs for given range [from to).
+ * attr_load_runs_range - Load runs for given range [from to).
*/
int attr_load_runs_range(struct ntfs_inode *ni, enum ATTR_TYPE type,
const __le16 *name, u8 name_len, struct runs_tree *run,
@@ -1974,7 +1978,7 @@ int attr_punch_hole(struct ntfs_inode *ni, u64 vbo, u64 bytes, u32 *frame_size)
total_size = le64_to_cpu(attr_b->nres.total_size);
if (vbo >= alloc_size) {
- // NOTE: It is allowed.
+ /* NOTE: It is allowed. */
return 0;
}
@@ -1986,9 +1990,9 @@ int attr_punch_hole(struct ntfs_inode *ni, u64 vbo, u64 bytes, u32 *frame_size)
bytes -= vbo;
if ((vbo & mask) || (bytes & mask)) {
- /* We have to zero a range(s)*/
+ /* We have to zero a range(s). */
if (frame_size == NULL) {
- /* Caller insists range is aligned */
+ /* Caller insists range is aligned. */
return -EINVAL;
}
*frame_size = mask + 1;