Commit Graph

107 Commits (ddd9e2f7e9b14248da45fbe9d02e188751206950)

Author SHA1 Message Date
Alexander Graf 883f660430 fuse_nfs: Add fsync
Libnfs already has exports for fsync, hook them up to the fuse example.

Signed-off-by: Alexander Graf <agraf@suse.de>
2015-09-11 11:24:47 +02:00
Alexander Graf 9439361243 fuse_nfs: Add truncate
Libnfs already has exports for truncate, hook them up to the fuse example.

Signed-off-by: Alexander Graf <agraf@suse.de>
2015-09-11 11:24:09 +02:00
Alexander Graf b66121610d fuse_nfs: Add chown
Libnfs already has exports for chown, hook them up to the fuse example.

Signed-off-by: Alexander Graf <agraf@suse.de>
2015-09-11 11:23:35 +02:00
Alexander Graf 315112b923 fuse_nfs: Add chmod
Libnfs already has exports for chmod, hook them up to the fuse example.

Signed-off-by: Alexander Graf <agraf@suse.de>
2015-09-11 11:23:03 +02:00
Alexander Graf d1709ab573 fuse_nfs: Add link
Libnfs already has exports for link, hook them up to the fuse example.

Signed-off-by: Alexander Graf <agraf@suse.de>
2015-09-11 11:22:29 +02:00
Alexander Graf 37fd16ee08 fuse_nfs: Add rename
Libnfs already has exports for rename, hook them up to the fuse example.

Signed-off-by: Alexander Graf <agraf@suse.de>
2015-09-11 11:21:31 +02:00
Alexander Graf 50aabd0729 fuse_nfs: Add symlink
Libnfs already has exports for symlink, hook them up to the fuse example.

Signed-off-by: Alexander Graf <agraf@suse.de>
2015-09-11 11:20:49 +02:00
Alexander Graf 618b6ea030 fuse_nfs: Add mknod
Libnfs already has exports for mknod, hook them up to the fuse example.

Signed-off-by: Alexander Graf <agraf@suse.de>
2015-09-11 11:19:52 +02:00
Alexander Graf 39d1f3693c fuse_nfs: Add symlink support
The fuse framework allows us to directly expose symlinks from NFS to the user,
just like a real NFS mount would. All we need to do is call lstat rather
than stat and implement a readlink function.

With this patch I can successfully chroot into a rootfs mounted using
fuse_nfs.

Signed-off-by: Alexander Graf <agraf@suse.de>
2015-09-11 00:23:48 +02:00
Alexander Graf e81f9e23ab fuse_nfs: Consider st_.tim as struct timespec
At least in my version of glibc the members st_mtim, st_ctim and st_atim
are defined as struct timespec rather than struct timeval, thus
containing a tv_nsec field rather than tv_usec.

Use the proper struct fields instead, fixing compilation on Linux.

Signed-off-by: Alexander Graf <agraf@suse.de>
2015-09-11 00:22:09 +02:00
Peter Lieven beaa838637 fix some compiler warnings
Signed-off-by: Peter Lieven <pl@kamp.de>
2015-06-19 13:49:17 +02:00
Ronnie Sahlberg 08ea9a3138 UTILS: move nfs-cp from examples to utils
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-24 07:50:43 -07:00
Ronnie Sahlberg ec3a3afeae EXAMPLES: convert remaining nfs_[f]stat to nfs_[f]stat64
The old nfs_[f]stat calls are deprecated. Convert to the newer
nfs_[f]stat64 call that takes struct nfs_stat_64

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-24 07:38:17 -07:00
Ronnie Sahlberg 6f2727468d FUSE: use nfs_stat64() not nfs_stat()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-24 07:19:01 -07:00
Alexander Graf a5042b9857 fuse_nfs: Disable multithreading
If we blindly spawn new threads based on existing open NFS shares, all
threads will concurrently still run on the same file descriptors for NFS
traffic, colliding sooner or later.

This is what happens with the fuse-nfs example program. To steer us back
into safety, we can just tell fuse to not do multi-threading which this
patch does.

This patch fixes random connection aborts with fuse_nfs for me.

Signed-off-by: Alexander Graf <agraf@suse.de>
2015-02-15 01:49:23 +01:00
Marlies Heijkoop 7e967f4de2 Print usage when missing mandatory arguments 2014-08-16 16:38:25 +02:00
Marlies Heijkoop 6a88df2924 Fix usage message to match expected arguments 2014-08-16 16:26:17 +02:00
Ronnie Sahlberg 2db42ce2fc ZDR: remove dependency on zdr.h from the examples and nfs-ls
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-07-05 12:44:18 -07:00
Ronnie Sahlberg c7ddf2e5cb NFS-LS: Build nfs-ls as utils and make it install under bin 2014-03-21 18:31:05 -07:00
Ronnie Sahlberg a562a7f5fb examples/Makefile.am Remove stuff we do not need 2014-03-21 17:33:14 -07:00
Ronnie Sahlberg 1f8134ebe4 PORTMAP client: Pass length as sockaddr_storage, not sockaddr_in6 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg ea20b4ec24 PORTMAP client: Parse and print the actual sockaddr that UADDR2TADDR returned 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 75ec99d519 PORTMAP client: Add commands to send v3 SET/UNSET 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 24f45c5452 PORTMAP: Rename pmap3_getaddr_result to pmap3_string_result 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 729266a796 PORTMAP: Add PMAP v3 UADDR2TADDR support 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 5245608a65 PORTMAP: Add v3 GETTIME support 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 7fbedfdefd PORTMAP: Add support for PORTMAP v3 GETADDR 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 4edd78302d PORTMAPv3: Add NULL and DUMP commands. Also add portmap example client. 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 0f0e352f49 PORTMAP: Rename the functions in PMAP to PMAP2 to desribe the version of PMAP we use.
Future patches will add PMAP3 which we will need for IPv6 support.
2014-03-19 18:25:49 -07:00
Ronnie Sahlberg 55125e894a Merge pull request #68 from plieven/for-1.9.3
examples/nfs-ls: fix summary output
2014-03-17 10:29:43 -07:00
Peter Lieven 9ecd7868a6 examples/nfs-ls: fix summary output
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-03-17 18:06:21 +01:00
Ronnie Sahlberg 8ae943f608 PORTMAP: Add support for V3 DUMP command
This implements the missing procedure from Issue #65
2014-03-16 14:17:06 -07:00
Ronnie Sahlberg 479302f729 Add a new nfs_stat64() function that operates on a always-64-bit stat structure 2014-03-04 19:40:05 -08:00
Ronnie Sahlberg d84d168f0f Change license for the ld preload hack to gplv3 2014-02-11 18:36:24 -08:00
Ronnie Sahlberg b8c28d541e Add a simple LD_PRELOAD toy to make cat and cp nfs-aware 2014-02-02 18:03:50 -08:00
Maxim Koltsov 5581436f5f Adjust Makefile.am's to support out-of-source builds 2014-01-08 12:36:09 +04:00
Ronnie Sahlberg c4ba61c51c Change all calls to rpc_nfs_fsinfo to rpc_nfs3_fsinfo 2013-12-31 15:06:25 -08:00
Ronnie Sahlberg 8aab33e33c Merge pull request #44 from plieven/master
fix 3 flaws detected by valgrind and bump version to intermediate version
2013-12-26 11:00:04 -08:00
Ronnie Sahlberg dc3ed8c3ab Fix some compiler warnings and bugs
Add missing %s to two example programs and fix incorrect argument to
rpc_nfs3_fsinfo_async()
2013-12-26 10:40:37 -08:00
Peter Lieven 22fbc5dad8 nfs-cp: don't leave file_context->url unitialized
Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-26 14:03:57 +01:00
Ronnie Sahlberg 6d89ace041 Merge pull request #43 from plieven/master
URL parsing functions and minor fixes + enhancements
2013-12-25 16:11:29 -08:00
Ronnie Sahlberg 767a479c37 Write the total number of bytes copied by nfs-cp, not just the last block written. 2013-12-24 13:05:04 -08:00
Peter Lieven 17d3cbb136 examples/nfs-ls: add discovery mode
this adds the ability for nfs-ls to discover

a) local NFS servers

examples/nfs-ls -D nfs://

b) NFS shares on a server

examples/nfs-ls -D nfs://10.0.0.1

c) all shares on local NFS servers

examples/nfs-ls -D -R nfs://

Enjoy!

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 15:12:50 +01:00
Peter Lieven 6bdcd5b676 examples: add nfs-io example
this simple example tool allows to
- creat and unlink files
- mkdir and rmdir directories
- stat

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 14:50:09 +01:00
Peter Lieven 82f5df21eb examples/nfs-cp: use nfs_parse_url_full
Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 14:07:01 +01:00
Peter Lieven d2ec73c75a add URL parsing functions
this adds the following 4 functions. see libnfs.h for details.

struct nfs_url *nfs_parse_url_full(struct nfs_context *nfs, char *url);
struct nfs_url *nfs_parse_url_dir(struct nfs_context *nfs, char *url);
struct nfs_url *nfs_parse_url_incomplete(struct nfs_context *nfs, char *url);
void nfs_destroy_url(struct nfs_url *url);

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 14:03:00 +01:00
Peter Lieven 1dc9ea0d52 examples/nfs-ls: recursion and summary support
this adds recusrion and summary support, fixes some compiler warnings,
fixes exit codes and avoids a possible sprintf buffer overflow.

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 12:46:26 +01:00
Ronnie Sahlberg b4598f416f Remove some debug residuals from fuse_nfs 2013-11-04 06:36:50 -08:00
Ronnie Sahlberg 8ca7b275f8 We don't need -odebug for the fuse nfs client anymore 2013-11-03 21:01:11 -08:00
Ronnie Sahlberg c6bd90a235 Add a simple FUSE filesystem based on libnfs. 2013-11-03 19:36:57 -08:00