From 0c59ebfc9b811c60fcf808a5de33320eeeb394af Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Sun, 10 Sep 2006 20:53:36 +0000 Subject: ulockmgr --- example/Makefile.am | 6 +----- example/fusexmp_fh.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'example') diff --git a/example/Makefile.am b/example/Makefile.am index 1f31cfc..9fe35e8 100644 --- a/example/Makefile.am +++ b/example/Makefile.am @@ -3,9 +3,5 @@ AM_CPPFLAGS = -I$(top_srcdir)/include noinst_PROGRAMS = fusexmp fusexmp_fh null hello hello_ll -fusexmp_SOURCES = fusexmp.c -fusexmp_fh_SOURCES = fusexmp_fh.c -null_SOURCES = null.c -hello_SOURCES = hello.c - LDADD = ../lib/libfuse.la -lpthread +fusexmp_fh_LDADD = ../lib/libfuse.la ../lib/libulockmgr.la -lpthread diff --git a/example/fusexmp_fh.c b/example/fusexmp_fh.c index 5ede6db..047ad09 100644 --- a/example/fusexmp_fh.c +++ b/example/fusexmp_fh.c @@ -11,6 +11,7 @@ #define _GNU_SOURCE #include +#include #include #include #include @@ -400,6 +401,14 @@ static int xmp_removexattr(const char *path, const char *name) } #endif /* HAVE_SETXATTR */ +static int xmp_lock(const char *path, struct fuse_file_info *fi, int cmd, + struct flock *lock, uint64_t owner) +{ + (void) path; + + return ulockmgr_op(fi->fh, cmd, lock, &owner, sizeof(owner)); +} + static struct fuse_operations xmp_oper = { .getattr = xmp_getattr, .fgetattr = xmp_fgetattr, @@ -434,6 +443,7 @@ static struct fuse_operations xmp_oper = { .listxattr = xmp_listxattr, .removexattr= xmp_removexattr, #endif + .lock = xmp_lock, }; int main(int argc, char *argv[]) -- cgit v1.2.3