aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--README17
-rw-r--r--lib/fuse.c10
-rw-r--r--lib/helper.c1
4 files changed, 23 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 1855359..005f652 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,8 @@
* kernel: check if mandatory mount options ('fd', 'rootmode',
'user_id', 'group_id') are all given
+ * lib: simplify 'readdir_ino' handling
+
2005-07-03 Miklos Szeredi <miklos@szeredi.hu>
* kernel: clean up 'direct_io' code
diff --git a/README b/README
index fc1675e..5006b3e 100644
--- a/README
+++ b/README
@@ -193,6 +193,23 @@ fsname=NAME
Sets the filesystem name. The default is the program name.
+use_ino
+
+ Honor the 'st_ino' field in getattr() and fill_dir(). This value is
+ used to fill in the 'st_ino' field in the stat()/lstat()/fstat()
+ functions and the 'd_ino' field in the readdir() function. The
+ filesystem does not have to guarantee uniqueness, however some
+ applications rely on this value being unique for the whole
+ filesystem.
+
+readdir_ino
+
+ If 'use_ino' option is not given, still try to fill in the 'd_ino'
+ field in readdir(). If the name was previously looked up, and is
+ still in the cache, the inode number found there will be used.
+ Otherwise it will be set to '-1'. If 'use_ino' option is given,
+ this option is ignored.
+
nonempty
Allows mounts over a non-empty file or directory. By default these
diff --git a/lib/fuse.c b/lib/fuse.c
index 0bd4b86..317b27d 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -80,7 +80,7 @@ struct fuse_dirhandle {
int filled;
unsigned long fh;
int error;
- struct node *node;
+ nodeid_t nodeid;
};
struct fuse_cmd {
@@ -1596,11 +1596,7 @@ static void do_opendir(struct fuse *f, struct fuse_in_header *in,
dh->contents = NULL;
dh->len = 0;
dh->filled = 0;
- if (f->flags & FUSE_READDIR_INO) {
- pthread_mutex_lock(&f->lock);
- dh->node = get_node(f, in->nodeid);
- pthread_mutex_unlock(&f->lock);
- }
+ dh->nodeid = in->nodeid;
mutex_init(&dh->lock);
memset(&outarg, 0, sizeof(outarg));
@@ -1658,7 +1654,7 @@ static int fill_dir_common(struct fuse_dirhandle *dh, const char *name,
if (dh->fuse->flags & FUSE_READDIR_INO) {
struct node *node;
pthread_mutex_lock(&dh->fuse->lock);
- node = lookup_node(dh->fuse, dh->node->nodeid, name);
+ node = lookup_node(dh->fuse, dh->nodeid, name);
if (node)
ino = (ino_t) node->nodeid;
pthread_mutex_unlock(&dh->fuse->lock);
diff --git a/lib/helper.c b/lib/helper.c
index af77c0f..460bea2 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -46,6 +46,7 @@ static void usage(const char *progname)
" fsname=NAME set filesystem name in mtab\n"
" use_ino let filesystem set inode numbers\n"
" readdir_ino try to fill in d_ino in readdir\n"
+ " nonempty allow mounts over non-empty file/dir\n"
);
}