[apparmor] [PATCH] apparmor: Remove is_deleted()

Goldwyn Rodrigues rgoldwyn at suse.de
Thu Sep 7 19:33:58 UTC 2017


From: Goldwyn Rodrigues <rgoldwyn at suse.com>

is_deleted() function is no longer in use and can be safely removed.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.com>
--- 
diff --git a/security/apparmor/file.c b/security/apparmor/file.c
index 3382518b87fa..242cd5c09761 100644
--- a/security/apparmor/file.c
+++ b/security/apparmor/file.c
@@ -152,19 +152,6 @@ int aa_audit_file(struct aa_profile *profile, struct aa_perms *perms,
 	return aa_audit(type, profile, &sa, file_audit_cb);
 }
 
-/**
- * is_deleted - test if a file has been completely unlinked
- * @dentry: dentry of file to test for deletion  (NOT NULL)
- *
- * Returns: %1 if deleted else %0
- */
-static inline bool is_deleted(struct dentry *dentry)
-{
-	if (d_unlinked(dentry) && d_backing_inode(dentry)->i_nlink == 0)
-		return 1;
-	return 0;
-}
-
 static int path_name(const char *op, struct aa_label *label,
 		     const struct path *path, int flags, char *buffer,
 		     const char **name, struct path_cond *cond, u32 request)



More information about the AppArmor mailing list