Skip to content

Commit 1b998c4

Browse files
Dr. David Alan Gilbertaalexandrovich
authored andcommitted
fs/ntfs3: Remove unused ni_load_attr
ni_load_attr() was added in 2021 by commit 4342306 ("fs/ntfs3: Add file operations and implementation") but hasn't been used. Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent 6bb81b9 commit 1b998c4

File tree

2 files changed

+0
-60
lines changed

2 files changed

+0
-60
lines changed

fs/ntfs3/frecord.c

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -280,63 +280,6 @@ struct ATTRIB *ni_enum_attr_ex(struct ntfs_inode *ni, struct ATTRIB *attr,
280280
return rec_find_attr_le(ni, mi2, le2);
281281
}
282282

283-
/*
284-
* ni_load_attr - Load attribute that contains given VCN.
285-
*/
286-
struct ATTRIB *ni_load_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
287-
const __le16 *name, u8 name_len, CLST vcn,
288-
struct mft_inode **pmi)
289-
{
290-
struct ATTR_LIST_ENTRY *le;
291-
struct ATTRIB *attr;
292-
struct mft_inode *mi;
293-
struct ATTR_LIST_ENTRY *next;
294-
295-
if (!ni->attr_list.size) {
296-
if (pmi)
297-
*pmi = &ni->mi;
298-
return mi_find_attr(ni, &ni->mi, NULL, type, name, name_len,
299-
NULL);
300-
}
301-
302-
le = al_find_ex(ni, NULL, type, name, name_len, NULL);
303-
if (!le)
304-
return NULL;
305-
306-
/*
307-
* Unfortunately ATTR_LIST_ENTRY contains only start VCN.
308-
* So to find the ATTRIB segment that contains 'vcn' we should
309-
* enumerate some entries.
310-
*/
311-
if (vcn) {
312-
for (;; le = next) {
313-
next = al_find_ex(ni, le, type, name, name_len, NULL);
314-
if (!next || le64_to_cpu(next->vcn) > vcn)
315-
break;
316-
}
317-
}
318-
319-
if (ni_load_mi(ni, le, &mi))
320-
return NULL;
321-
322-
if (pmi)
323-
*pmi = mi;
324-
325-
attr = mi_find_attr(ni, mi, NULL, type, name, name_len, &le->id);
326-
if (!attr)
327-
return NULL;
328-
329-
if (!attr->non_res)
330-
return attr;
331-
332-
if (le64_to_cpu(attr->nres.svcn) <= vcn &&
333-
vcn <= le64_to_cpu(attr->nres.evcn))
334-
return attr;
335-
336-
_ntfs_bad_inode(&ni->vfs_inode);
337-
return NULL;
338-
}
339-
340283
/*
341284
* ni_load_all_mi - Load all subrecords.
342285
*/

fs/ntfs3/ntfs_fs.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,6 @@ struct ATTRIB *ni_find_attr(struct ntfs_inode *ni, struct ATTRIB *attr,
530530
struct ATTRIB *ni_enum_attr_ex(struct ntfs_inode *ni, struct ATTRIB *attr,
531531
struct ATTR_LIST_ENTRY **le,
532532
struct mft_inode **mi);
533-
struct ATTRIB *ni_load_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
534-
const __le16 *name, u8 name_len, CLST vcn,
535-
struct mft_inode **pmi);
536533
int ni_load_all_mi(struct ntfs_inode *ni);
537534
bool ni_add_subrecord(struct ntfs_inode *ni, CLST rno, struct mft_inode **mi);
538535
int ni_remove_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,

0 commit comments

Comments
 (0)