Commit 0e062700 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: getdents patch for 32 -> 64 converter

From: Anton Blanchard <anton@samba.org>

From: Marcus Meissner <meissner@suse.de>

With 2.6.4 we now have the glorious hidden d_type passing in getdents.

glibc CVS expects this to be passed if we have a kernel version after
2.6.4, so we have to also handle it in the 32bit syscall converter.
parent 4f2ade37
......@@ -533,7 +533,7 @@ filldir(void * __buf, const char * name, int namlen, off_t offset, ino_t ino,
{
struct linux_dirent32 * dirent;
struct getdents_callback32 * buf = (struct getdents_callback32 *) __buf;
int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2);
buf->error = -EINVAL; /* only used if we fail.. */
if (reclen > buf->count)
......@@ -547,6 +547,7 @@ filldir(void * __buf, const char * name, int namlen, off_t offset, ino_t ino,
put_user(reclen, &dirent->d_reclen);
copy_to_user(dirent->d_name, name, namlen);
put_user(0, dirent->d_name + namlen);
put_user(d_type, (char *) dirent + reclen - 1);
((char *) dirent) += reclen;
buf->current_dir = dirent;
buf->count -= reclen;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment