summaryrefslogtreecommitdiff
path: root/fs/readdir.c
diff options
context:
space:
mode:
authorMilind Arun Choudhary <milindchoudhary@gmail.com>2007-05-08 00:29:02 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 11:15:09 -0700
commit022a1692444cd683ef42f637cc717db4d8fd9378 (patch)
tree82d8c1360921310f90b81c147b345afad98317f7 /fs/readdir.c
parent10f8a59813ee8bb41fb1d72ed2ec12a1c9f66da2 (diff)
downloadlwn-022a1692444cd683ef42f637cc717db4d8fd9378.tar.gz
lwn-022a1692444cd683ef42f637cc717db4d8fd9378.zip
ROUND_UP macro cleanup in fs/(select|compat|readdir).c
ROUND_UP macro cleanup use,ALIGN or DIV_ROUND_UP where ever appropriate. Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/readdir.c')
-rw-r--r--fs/readdir.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/readdir.c b/fs/readdir.c
index 71bd12b50b4c..efe52e676577 100644
--- a/fs/readdir.c
+++ b/fs/readdir.c
@@ -4,6 +4,7 @@
* Copyright (C) 1995 Linus Torvalds
*/
+#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/time.h>
#include <linux/mm.h>
@@ -51,7 +52,6 @@ EXPORT_SYMBOL(vfs_readdir);
* case (the low-level handlers don't need to care about this).
*/
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
-#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))
#ifdef __ARCH_WANT_OLD_READDIR
@@ -146,7 +146,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
struct linux_dirent __user * dirent;
struct getdents_callback * buf = (struct getdents_callback *) __buf;
unsigned long d_ino;
- int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2);
+ int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 2, sizeof(long));
buf->error = -EINVAL; /* only used if we fail.. */
if (reclen > buf->count)
@@ -219,8 +219,6 @@ out:
return error;
}
-#define ROUND_UP64(x) (((x)+sizeof(u64)-1) & ~(sizeof(u64)-1))
-
struct getdents_callback64 {
struct linux_dirent64 __user * current_dir;
struct linux_dirent64 __user * previous;
@@ -233,7 +231,7 @@ static int filldir64(void * __buf, const char * name, int namlen, loff_t offset,
{
struct linux_dirent64 __user *dirent;
struct getdents_callback64 * buf = (struct getdents_callback64 *) __buf;
- int reclen = ROUND_UP64(NAME_OFFSET(dirent) + namlen + 1);
+ int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, sizeof(u64));
buf->error = -EINVAL; /* only used if we fail.. */
if (reclen > buf->count)