X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Freaddir.c;h=efe52e67657719963d5ac1cd22df34e7465d4234;hb=fc0dc4d3aa9c73e275accf2966e0bdf16bff45f1;hp=f39f5b3132527243a5eb08979d7bf5aebaaa9f15;hpb=11c302c14d8ddc47504bd3b650bc9e8da7c717b7;p=linux-2.6-omap-h63xx.git diff --git a/fs/readdir.c b/fs/readdir.c index f39f5b31325..efe52e67657 100644 --- a/fs/readdir.c +++ b/fs/readdir.c @@ -4,13 +4,13 @@ * Copyright (C) 1995 Linus Torvalds */ +#include #include #include #include #include #include #include -#include #include #include #include @@ -52,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 @@ -147,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) @@ -220,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; @@ -234,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)