summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-02-01 14:31:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:38 -0500
commit6b8fc040e56a9b3db6c060b9ab430112561f86bb (patch)
treec776e46fdcfb0109a9d59579fb414bb1d2f64d1e /source3
parent240a3fd644bbc94e5872f699c9b90649b52b98a1 (diff)
downloadsamba-6b8fc040e56a9b3db6c060b9ab430112561f86bb.tar.gz
samba-6b8fc040e56a9b3db6c060b9ab430112561f86bb.tar.bz2
samba-6b8fc040e56a9b3db6c060b9ab430112561f86bb.zip
r21109: Send notify_fam.c through the VFS. Lets see how the build farm likes this.
Volker (This used to be commit e57a6d4d6341a52de55860e7f97031a63810dbfa)
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in9
-rw-r--r--source3/configure.in4
-rw-r--r--source3/modules/vfs_notify_fam.c (renamed from source3/smbd/notify_fam.c)39
3 files changed, 38 insertions, 14 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index de55f35a2d..d365c9cab0 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -408,8 +408,7 @@ PROFILES_OBJ = utils/profiles.o \
OPLOCK_OBJ = smbd/oplock.o smbd/oplock_irix.o smbd/oplock_linux.o
-NOTIFY_OBJ = smbd/notify.o smbd/notify_fam.o smbd/notify_inotify.o \
- smbd/notify_internal.o
+NOTIFY_OBJ = smbd/notify.o smbd/notify_inotify.o smbd/notify_internal.o
VFS_DEFAULT_OBJ = modules/vfs_default.o
VFS_AUDIT_OBJ = modules/vfs_audit.o
@@ -436,6 +435,7 @@ VFS_CACHEPRIME_OBJ = modules/vfs_cacheprime.o
VFS_PREALLOC_OBJ = modules/vfs_prealloc.o
VFS_COMMIT_OBJ = modules/vfs_commit.o
VFS_GPFS_OBJ = modules/vfs_gpfs.o modules/gpfs.o modules/nfs4_acls.o
+VFS_NOTIFY_FAM_OBJ = modules/vfs_notify_fam.o
PLAINTEXT_AUTH_OBJ = auth/pampass.o auth/pass_check.o
@@ -1559,6 +1559,11 @@ bin/gpfs.@SHLIBEXT@: $(VFS_GPFS_OBJ)
@$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_GPFS_OBJ) \
@SONAMEFLAG@`basename $@`
+bin/notify_fam.@SHLIBEXT@: $(VFS_NOTIFY_FAM_OBJ)
+ @echo "Building plugin $@"
+ @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_NOTIFY_FAM_OBJ) \
+ @SONAMEFLAG@`basename $@`
+
#########################################################
## IdMap NSS plugins
diff --git a/source3/configure.in b/source3/configure.in
index 0a14d4c88c..1883df1a17 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -2557,8 +2557,7 @@ if test x$enable_fam != xno; then
fi
if test x"$samba_cv_HAVE_LIBFAM" = x"yes" ; then
- AC_DEFINE(HAVE_FAM_CHANGE_NOTIFY, 1,
- [Whether FAM file notifications are available])
+ default_shared_modules="$default_shared_modules vfs_notify_fam"
AC_TRY_COMPILE([#include <fam.h>],
[FAMCodes code = FAMChanged;],
AC_DEFINE(HAVE_FAM_H_FAMCODES_TYPEDEF, 1,
@@ -5960,6 +5959,7 @@ SMB_MODULE(vfs_cacheprime, \$(VFS_CACHEPRIME_OBJ), "bin/cacheprime.$SHLIBEXT", V
SMB_MODULE(vfs_prealloc, \$(VFS_PREALLOC_OBJ), "bin/prealloc.$SHLIBEXT", VFS)
SMB_MODULE(vfs_commit, \$(VFS_COMMIT_OBJ), "bin/commit.$SHLIBEXT", VFS)
SMB_MODULE(vfs_gpfs, \$(VFS_GPFS_OBJ), "bin/gpfs.$SHLIBEXT", VFS)
+SMB_MODULE(vfs_notify_fam, \$(VFS_NOTIFY_FAM_OBJ), "bin/notify_fam.$SHLIBEXT", VFS)
SMB_SUBSYSTEM(VFS,smbd/vfs.o)
diff --git a/source3/smbd/notify_fam.c b/source3/modules/vfs_notify_fam.c
index 3fa6dad162..b76046b378 100644
--- a/source3/smbd/notify_fam.c
+++ b/source3/modules/vfs_notify_fam.c
@@ -21,8 +21,6 @@
#include "includes.h"
-#ifdef HAVE_FAM_CHANGE_NOTIFY
-
#include <fam.h>
#if !defined(HAVE_FAM_H_FAMCODES_TYPEDEF)
@@ -202,13 +200,14 @@ static int fam_watch_context_destructor(struct fam_watch_context *ctx)
add a watch. The watch is removed when the caller calls
talloc_free() on *handle
*/
-NTSTATUS fam_watch(struct sys_notify_context *ctx,
- struct notify_entry *e,
- void (*callback)(struct sys_notify_context *ctx,
- void *private_data,
- struct notify_event *ev),
- void *private_data,
- void *handle_p)
+static NTSTATUS fam_watch(vfs_handle_struct *vfs_handle,
+ struct sys_notify_context *ctx,
+ struct notify_entry *e,
+ void (*callback)(struct sys_notify_context *ctx,
+ void *private_data,
+ struct notify_event *ev),
+ void *private_data,
+ void *handle_p)
{
const uint32 fam_mask = (FILE_NOTIFY_CHANGE_FILE_NAME|
FILE_NOTIFY_CHANGE_DIR_NAME);
@@ -280,4 +279,24 @@ NTSTATUS fam_watch(struct sys_notify_context *ctx,
return NT_STATUS_OK;
}
-#endif /* HAVE_FAM_CHANGE_NOTIFY */
+/* VFS operations structure */
+
+static vfs_op_tuple notify_fam_op_tuples[] = {
+
+ {SMB_VFS_OP(fam_watch),
+ SMB_VFS_OP_NOTIFY_WATCH,
+ SMB_VFS_LAYER_OPAQUE},
+
+ {SMB_VFS_OP(NULL),
+ SMB_VFS_OP_NOOP,
+ SMB_VFS_LAYER_NOOP}
+
+};
+
+
+NTSTATUS vfs_notify_fam_init(void);
+NTSTATUS vfs_notify_fam_init(void)
+{
+ return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "notify_fam",
+ notify_fam_op_tuples);
+}