]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
apparmor: remove useless static inline function is_deleted
authorColin Ian King <colin.i.king@gmail.com>
Mon, 4 Mar 2024 16:36:55 +0000 (16:36 +0000)
committerJohn Johansen <john.johansen@canonical.com>
Fri, 10 May 2024 15:44:43 +0000 (08:44 -0700)
The inlined function is_deleted is redundant, it is not called at all
from any function in security/apparmor/file.c and so it can be removed.

Cleans up clang scan build warning:
security/apparmor/file.c:153:20: warning: unused function
'is_deleted' [-Wunused-function]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/file.c

index c03eb7c19f16229bc7fc89ac1dfd9fe6ae6f5fa9..d52a5b14dad4c75f24acdb93a07a148ee620d9f2 100644 (file)
@@ -144,19 +144,6 @@ int aa_audit_file(const struct cred *subj_cred,
        return aa_audit(type, profile, &ad, file_audit_cb);
 }
 
-/**
- * is_deleted - test if a file has been completely unlinked
- * @dentry: dentry of file to test for deletion  (NOT NULL)
- *
- * Returns: true if deleted else false
- */
-static inline bool is_deleted(struct dentry *dentry)
-{
-       if (d_unlinked(dentry) && d_backing_inode(dentry)->i_nlink == 0)
-               return true;
-       return false;
-}
-
 static int path_name(const char *op, const struct cred *subj_cred,
                     struct aa_label *label,
                     const struct path *path, int flags, char *buffer,