Skip to content

Commit bdd6baf

Browse files
Dr. David Alan Gilbertaalexandrovich
authored andcommitted
fs/ntfs3: Remove unused al_delete_le
'al_delete_le' was added by: Commit be71b5c ("fs/ntfs3: Add attrib operations") but has remained unused; there is an al_remove_le which seems to be being used instead. Remove 'al_delete_le'. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
1 parent 689ecd0 commit bdd6baf

2 files changed

Lines changed: 0 additions & 55 deletions

File tree

fs/ntfs3/attrlist.c

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -382,59 +382,6 @@ bool al_remove_le(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le)
382382
return true;
383383
}
384384

385-
/*
386-
* al_delete_le - Delete first le from the list which matches its parameters.
387-
*/
388-
bool al_delete_le(struct ntfs_inode *ni, enum ATTR_TYPE type, CLST vcn,
389-
const __le16 *name, u8 name_len, const struct MFT_REF *ref)
390-
{
391-
u16 size;
392-
struct ATTR_LIST_ENTRY *le;
393-
size_t off;
394-
typeof(ni->attr_list) *al = &ni->attr_list;
395-
396-
/* Scan forward to the first le that matches the input. */
397-
le = al_find_ex(ni, NULL, type, name, name_len, &vcn);
398-
if (!le)
399-
return false;
400-
401-
off = PtrOffset(al->le, le);
402-
403-
next:
404-
if (off >= al->size)
405-
return false;
406-
if (le->type != type)
407-
return false;
408-
if (le->name_len != name_len)
409-
return false;
410-
if (name_len && ntfs_cmp_names(le_name(le), name_len, name, name_len,
411-
ni->mi.sbi->upcase, true))
412-
return false;
413-
if (le64_to_cpu(le->vcn) != vcn)
414-
return false;
415-
416-
/*
417-
* The caller specified a segment reference, so we have to
418-
* scan through the matching entries until we find that segment
419-
* reference or we run of matching entries.
420-
*/
421-
if (ref && memcmp(ref, &le->ref, sizeof(*ref))) {
422-
off += le16_to_cpu(le->size);
423-
le = Add2Ptr(al->le, off);
424-
goto next;
425-
}
426-
427-
/* Save on stack the size of 'le'. */
428-
size = le16_to_cpu(le->size);
429-
/* Delete the le. */
430-
memmove(le, Add2Ptr(le, size), al->size - (off + size));
431-
432-
al->size -= size;
433-
al->dirty = true;
434-
435-
return true;
436-
}
437-
438385
int al_update(struct ntfs_inode *ni, int sync)
439386
{
440387
int err;

fs/ntfs3/ntfs_fs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,6 @@ int al_add_le(struct ntfs_inode *ni, enum ATTR_TYPE type, const __le16 *name,
472472
u8 name_len, CLST svcn, __le16 id, const struct MFT_REF *ref,
473473
struct ATTR_LIST_ENTRY **new_le);
474474
bool al_remove_le(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le);
475-
bool al_delete_le(struct ntfs_inode *ni, enum ATTR_TYPE type, CLST vcn,
476-
const __le16 *name, u8 name_len, const struct MFT_REF *ref);
477475
int al_update(struct ntfs_inode *ni, int sync);
478476
static inline size_t al_aligned(size_t size)
479477
{

0 commit comments

Comments
 (0)