RIP filename::uptr

now that we no longer do getname of the same thing multiple times,
there's no need of that thing or audit_reusename().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/fs/filename.c b/fs/filename.c
index 294bc89..cfc2c10 100644
--- a/fs/filename.c
+++ b/fs/filename.c
@@ -24,10 +24,6 @@ getname_flags(const char __user *filename, int flags)
 	char *kname;
 	int len;
 
-	result = audit_reusename(filename);
-	if (result)
-		return result;
-
 	full = __getname();
 	if (unlikely(!full))
 		return ERR_PTR(-ENOMEM);
@@ -99,7 +95,6 @@ getname_flags(const char __user *filename, int flags)
 	}
 
 	atomic_set(&full->refcnt, 1);
-	full->uptr = filename;
 	full->aname = NULL;
 	audit_getname(result);
 	return result;
@@ -166,7 +161,6 @@ struct filename *getname_kernel(const char * filename)
 		return ERR_PTR(-ENAMETOOLONG);
 	}
 	memcpy((char *)result->name, filename, len);
-	full->uptr = NULL;
 	full->aname = NULL;
 	atomic_set(&full->refcnt, 1);
 	audit_getname(result);
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 0050ef2..3a5274c 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -293,7 +293,6 @@ extern void __audit_uring_exit(int success, long code);
 extern void __audit_syscall_entry(int major, unsigned long a0, unsigned long a1,
 				  unsigned long a2, unsigned long a3);
 extern void __audit_syscall_exit(int ret_success, long ret_value);
-extern struct filename *__audit_reusename(const __user char *uptr);
 extern void __audit_getname(struct filename *name);
 extern void __audit_inode(struct filename *name, const struct dentry *dentry,
 				unsigned int flags);
@@ -357,12 +356,6 @@ static inline void audit_syscall_exit(void *pt_regs)
 		__audit_syscall_exit(success, return_code);
 	}
 }
-static inline struct filename *audit_reusename(const __user char *name)
-{
-	if (unlikely(!audit_dummy_context()))
-		return __audit_reusename(name);
-	return NULL;
-}
 static inline void audit_getname(struct filename *name)
 {
 	if (unlikely(!audit_dummy_context()))
@@ -601,10 +594,6 @@ static inline struct audit_context *audit_context(void)
 {
 	return NULL;
 }
-static inline struct filename *audit_reusename(const __user char *name)
-{
-	return NULL;
-}
 static inline void audit_getname(struct filename *name)
 { }
 static inline void audit_inode(struct filename *name,
diff --git a/include/linux/filename.h b/include/linux/filename.h
index 5c3bf63..68c2a68 100644
--- a/include/linux/filename.h
+++ b/include/linux/filename.h
@@ -12,7 +12,6 @@ struct filename {
 
 struct __filename {
 	struct filename		public;
-	const __user char	*uptr;	/* original userland pointer */
 	atomic_t		refcnt;
 	struct audit_names	*aname;
 	const char		iname[];
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 69a0193..a9ff74f 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -2196,33 +2196,6 @@ static struct audit_names *audit_alloc_name(struct audit_context *context,
 }
 
 /**
- * __audit_reusename - fill out filename with info from existing entry
- * @uptr: userland ptr to pathname
- *
- * Search the audit_names list for the current audit context. If there is an
- * existing entry with a matching "uptr" then return the filename
- * associated with that audit_name. If not, return NULL.
- */
-struct filename *
-__audit_reusename(const __user char *uptr)
-{
-	struct audit_context *context = audit_context();
-	struct audit_names *n;
-
-	list_for_each_entry(n, &context->names_list, list) {
-		struct __filename *name;
-		if (!n->name)
-			continue;
-		name = __filename_full(n->name);
-		if (name->uptr == uptr) {
-			atomic_inc(&name->refcnt);
-			return n->name;
-		}
-	}
-	return NULL;
-}
-
-/**
  * __audit_getname - add a name to the list
  * @name: name to add
  *