]> www.infradead.org Git - users/willy/linux.git/commitdiff
fs/ntfs3: Remove unused al_delete_le
authorDr. David Alan Gilbert <linux@treblig.org>
Fri, 13 Sep 2024 20:50:06 +0000 (21:50 +0100)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Tue, 1 Oct 2024 09:19:05 +0000 (12:19 +0300)
'al_delete_le' was added by:
Commit be71b5cba2e6 ("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>
fs/ntfs3/attrlist.c
fs/ntfs3/ntfs_fs.h

index 9f4bd8d260901ca4fd4db97aea3687459e4ebc1a..a4d74bed74fab07f27a5e9143f4443499b3fa882 100644 (file)
@@ -382,59 +382,6 @@ bool al_remove_le(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le)
        return true;
 }
 
-/*
- * al_delete_le - Delete first le from the list which matches its parameters.
- */
-bool al_delete_le(struct ntfs_inode *ni, enum ATTR_TYPE type, CLST vcn,
-                 const __le16 *name, u8 name_len, const struct MFT_REF *ref)
-{
-       u16 size;
-       struct ATTR_LIST_ENTRY *le;
-       size_t off;
-       typeof(ni->attr_list) *al = &ni->attr_list;
-
-       /* Scan forward to the first le that matches the input. */
-       le = al_find_ex(ni, NULL, type, name, name_len, &vcn);
-       if (!le)
-               return false;
-
-       off = PtrOffset(al->le, le);
-
-next:
-       if (off >= al->size)
-               return false;
-       if (le->type != type)
-               return false;
-       if (le->name_len != name_len)
-               return false;
-       if (name_len && ntfs_cmp_names(le_name(le), name_len, name, name_len,
-                                      ni->mi.sbi->upcase, true))
-               return false;
-       if (le64_to_cpu(le->vcn) != vcn)
-               return false;
-
-       /*
-        * The caller specified a segment reference, so we have to
-        * scan through the matching entries until we find that segment
-        * reference or we run of matching entries.
-        */
-       if (ref && memcmp(ref, &le->ref, sizeof(*ref))) {
-               off += le16_to_cpu(le->size);
-               le = Add2Ptr(al->le, off);
-               goto next;
-       }
-
-       /* Save on stack the size of 'le'. */
-       size = le16_to_cpu(le->size);
-       /* Delete the le. */
-       memmove(le, Add2Ptr(le, size), al->size - (off + size));
-
-       al->size -= size;
-       al->dirty = true;
-
-       return true;
-}
-
 int al_update(struct ntfs_inode *ni, int sync)
 {
        int err;
index 3dd6215316e4503de6ed9e1fdb85d3c8a48a347f..d605d1a11f187b59378df188a2199f1f662e86c0 100644 (file)
@@ -472,8 +472,6 @@ int al_add_le(struct ntfs_inode *ni, enum ATTR_TYPE type, const __le16 *name,
              u8 name_len, CLST svcn, __le16 id, const struct MFT_REF *ref,
              struct ATTR_LIST_ENTRY **new_le);
 bool al_remove_le(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le);
-bool al_delete_le(struct ntfs_inode *ni, enum ATTR_TYPE type, CLST vcn,
-                 const __le16 *name, u8 name_len, const struct MFT_REF *ref);
 int al_update(struct ntfs_inode *ni, int sync);
 static inline size_t al_aligned(size_t size)
 {