Skip to contentSkip to conversation

Add leading underscores to filldir, fillonedir, compat_fillonedir, filldir64

PATCH New Mathieu Desnoyers 1 participant 1 message Feb 25, 2013 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add leading underscores to filldir, fillonedir, compat_fillonedir, filldir64

Document that these functions expect access_ok() to be performed on dirent between reception from user-space and call to these functions.

---
 fs/compat.c  |    4 ++--
 fs/readdir.c |   14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)
fs/compat.c +2 -2
Index: linux/fs/compat.c
===================================================================
@@ -834,7 +834,7 @@ struct compat_readdir_callback {
 	int result;
 };
 
-static int compat_fillonedir(void *__buf, const char *name, int namlen,
+static int __compat_fillonedir(void *__buf, const char *name, int namlen,
 			loff_t offset, u64 ino, unsigned int d_type)
 {
 	struct compat_readdir_callback *buf = __buf;
@@ -879,7 +879,7 @@ asmlinkage long compat_sys_old_readdir(u
 	buf.result = 0;
 	buf.dirent = dirent;
 
-	error = vfs_readdir(f.file, compat_fillonedir, &buf);
+	error = vfs_readdir(f.file, __compat_fillonedir, &buf);
 	if (buf.result)
 		error = buf.result;
 
fs/readdir.c +7 -7
Index: linux/fs/readdir.c
===================================================================
@@ -52,7 +52,7 @@ EXPORT_SYMBOL(vfs_readdir);
  *
  * "count=1" is a special case, meaning that the buffer is one
  * dirent-structure in size and that the code can't handle more
- * anyway. Thus the special "fillonedir()" function for that
+ * anyway. Thus the special "__fillonedir()" function for that
  * case (the low-level handlers don't need to care about this).
  */
 
@@ -70,7 +70,7 @@ struct readdir_callback {
 	int result;
 };
 
-static int fillonedir(void * __buf, const char * name, int namlen, loff_t offset,
+static int __fillonedir(void * __buf, const char * name, int namlen, loff_t offset,
 		      u64 ino, unsigned int d_type)
 {
 	struct readdir_callback * buf = (struct readdir_callback *) __buf;
@@ -115,7 +115,7 @@ SYSCALL_DEFINE3(old_readdir, unsigned in
 	buf.result = 0;
 	buf.dirent = dirent;
 
-	error = vfs_readdir(f.file, fillonedir, &buf);
+	error = vfs_readdir(f.file, __fillonedir, &buf);
 	if (buf.result)
 		error = buf.result;
 
@@ -143,7 +143,7 @@ struct getdents_callback {
 	int error;
 };
 
-static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
+static int __filldir(void * __buf, const char * name, int namlen, loff_t offset,
 		   u64 ino, unsigned int d_type)
 {
 	struct linux_dirent __user * dirent;
@@ -206,7 +206,7 @@ SYSCALL_DEFINE3(getdents, unsigned int,
 	buf.count = count;
 	buf.error = 0;
 
-	error = vfs_readdir(f.file, filldir, &buf);
+	error = vfs_readdir(f.file, __filldir, &buf);
 	if (error >= 0)
 		error = buf.error;
 	lastdirent = buf.previous;
@@ -227,7 +227,7 @@ struct getdents_callback64 {
 	int error;
 };
 
-static int filldir64(void * __buf, const char * name, int namlen, loff_t offset,
+static int __filldir64(void * __buf, const char * name, int namlen, loff_t offset,
 		     u64 ino, unsigned int d_type)
 {
 	struct linux_dirent64 __user *dirent;
@@ -286,7 +286,7 @@ SYSCALL_DEFINE3(getdents64, unsigned int
 	buf.count = count;
 	buf.error = 0;
 
-	error = vfs_readdir(f.file, filldir64, &buf);
+	error = vfs_readdir(f.file, __filldir64, &buf);
 	if (error >= 0)
 		error = buf.error;
 	lastdirent = buf.previous;
Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com