git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[pandora-kernel.git]
/
fs
/
readdir.c
diff --git
a/fs/readdir.c
b/fs/readdir.c
index
f39f5b3
..
4e026e5
100644
(file)
--- a/
fs/readdir.c
+++ b/
fs/readdir.c
@@
-4,13
+4,13
@@
* Copyright (C) 1995 Linus Torvalds
*/
* Copyright (C) 1995 Linus Torvalds
*/
+#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/time.h>
#include <linux/mm.h>
#include <linux/errno.h>
#include <linux/stat.h>
#include <linux/file.h>
#include <linux/module.h>
#include <linux/time.h>
#include <linux/mm.h>
#include <linux/errno.h>
#include <linux/stat.h>
#include <linux/file.h>
-#include <linux/smp_lock.h>
#include <linux/fs.h>
#include <linux/dirent.h>
#include <linux/security.h>
#include <linux/fs.h>
#include <linux/dirent.h>
#include <linux/security.h>
@@
-30,7
+30,10
@@
int vfs_readdir(struct file *file, filldir_t filler, void *buf)
if (res)
goto out;
if (res)
goto out;
- mutex_lock(&inode->i_mutex);
+ res = mutex_lock_killable(&inode->i_mutex);
+ if (res)
+ goto out;
+
res = -ENOENT;
if (!IS_DEADDIR(inode)) {
res = file->f_op->readdir(file, buf, filler);
res = -ENOENT;
if (!IS_DEADDIR(inode)) {
res = file->f_op->readdir(file, buf, filler);
@@
-52,7
+55,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)))
* 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
#ifdef __ARCH_WANT_OLD_READDIR
@@
-147,7
+149,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;
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)
buf->error = -EINVAL; /* only used if we fail.. */
if (reclen > buf->count)
@@
-220,8
+222,6
@@
out:
return error;
}
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;
struct getdents_callback64 {
struct linux_dirent64 __user * current_dir;
struct linux_dirent64 __user * previous;
@@
-234,7
+234,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;
{
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)
buf->error = -EINVAL; /* only used if we fail.. */
if (reclen > buf->count)