summaryrefslogtreecommitdiff
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2025-11-02 01:01:47 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2026-01-13 15:18:07 -0500
commit741c97fecb6a4160014a76759e9b8c0880fc44f1 (patch)
tree72bd86a8d2455ae66dc6cc9d3b830bae980da91e /include/linux/fs.h
parent9fa3ec84587c5eca7580eafc27eee332bc3a5a0e (diff)
struct filename ->refcnt doesn't need to be atomic
... or visible outside of audit, really. Note that references held in delayed_filename always have refcount 1, and from the moment of complete_getname() or equivalent point in getname...() there won't be any references to struct filename instance left in places visible to other threads. Acked-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f1612a7dffd0..6a26ee347517 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2412,7 +2412,7 @@ struct audit_names;
struct __filename_head {
const char *name; /* pointer to actual string */
- atomic_t refcnt;
+ int refcnt;
struct audit_names *aname;
};
#define EMBEDDED_NAME_MAX (192 - sizeof(struct __filename_head))
@@ -2527,12 +2527,6 @@ void dismiss_delayed_filename(struct delayed_filename *);
int putname_to_delayed(struct delayed_filename *, struct filename *);
struct filename *complete_getname(struct delayed_filename *);
-static inline struct filename *refname(struct filename *name)
-{
- atomic_inc(&name->refcnt);
- return name;
-}
-
DEFINE_CLASS(filename, struct filename *, putname(_T), getname(p), const char __user *p)
EXTEND_CLASS(filename, _kernel, getname_kernel(p), const char *p)
EXTEND_CLASS(filename, _flags, getname_flags(p, f), const char __user *p, unsigned int f)