Add auto-traverse-mount URL argument and default it to TRUE

Add a URL argument to enable/disable the use of automatic traversal of nested
mounts for a libnfs context. Default it to enabled.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
libnfs-4.0.0-vitalif
Ronnie Sahlberg 2015-01-17 11:49:08 -08:00
parent 1eea1c4647
commit d1c2c47ff0
2 changed files with 22 additions and 0 deletions

19
README
View File

@ -40,6 +40,25 @@ Arguments supported by libnfs are :
default it 65534 on Windows and getgid() on unixen.
readahead=<int> : Enable readahead for files and set the maximum amount
of readahead to <int>.
auto-traverse-mounts=<0|1>
: Should libnfs try to traverse across nested mounts
automatically or not. Default is 1 == enabled.
Auto_traverse_mounts
====================
Normally in NFSv3 if a server has nested exports, for example if it would
export both /data and /data/tmp then a client would need to mount
both these exports as well.
The reason is because the NFSv3 protocol does not allow a client request
to return data for an object in a different filesystem/mount.
(legacy, but it is what it is. One reason for this restriction is to
guarantee that inodes are uniqe across the mounted system.)
This option, when enabled will make libnfs perform all these mounts
internally for you. This means that one libnfs mount may now have files
with duplicate inode values so if you cache files based on inode
make sure you cache files based on BOTH st.st_ino and st.st_dev.
ROOT vs NON-ROOT
================

View File

@ -261,6 +261,8 @@ static int nfs_set_context_args(struct nfs_context *nfs, char *arg, char *val)
rpc_set_gid(nfs_get_rpc_context(nfs), atoi(val));
} else if (!strcmp(arg, "readahead")) {
rpc_set_readahead(nfs_get_rpc_context(nfs), atoi(val));
} else if (!strcmp(arg, "auto-traverse-mounts")) {
nfs->auto_traverse_mounts = atoi(val);
}
return 0;
}
@ -424,6 +426,7 @@ struct nfs_context *nfs_init_context(void)
nfs->cwd = strdup("/");
nfs->mask = 022;
nfs->auto_traverse_mounts = 1;
return nfs;
}