2005-03-31 21:00:50

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH] FUSE: 2/3 add offset to fuse_dirent

This patch adds an offset field to fuse_dirent structure. This will
give userspace filesystems more flexibility in implementing a readdir
method.

Signed-off-by: Miklos Szeredi <[email protected]>

diff -rup linux-2.6.12-rc1-mm4/fs/fuse/dir.c linux-fuse/fs/fuse/dir.c
--- linux-2.6.12-rc1-mm4/fs/fuse/dir.c 2005-03-31 21:43:42.000000000 +0200
+++ linux-fuse/fs/fuse/dir.c 2005-03-31 21:49:39.000000000 +0200
@@ -483,7 +483,7 @@ static int parse_dirfile(char *buf, size
break;

over = filldir(dstbuf, dirent->name, dirent->namelen,
- file->f_pos, dirent->ino, dirent->type);
+ dirent->off, dirent->ino, dirent->type);
if (over)
break;

diff -rup linux-2.6.12-rc1-mm4/include/linux/fuse.h linux-fuse/include/linux/fuse.h
--- linux-2.6.12-rc1-mm4/include/linux/fuse.h 2005-03-31 21:49:56.000000000 +0200
+++ linux-fuse/include/linux/fuse.h 2005-03-31 21:49:39.000000000 +0200
@@ -237,6 +237,7 @@ struct fuse_out_header {

struct fuse_dirent {
__u64 ino;
+ __u64 off;
__u32 namelen;
__u32 type;
char name[0];