r21109: Send notify_fam.c through the VFS. Lets see how the build farm likes this.
authorVolker Lendecke <vlendec@samba.org>
Thu, 1 Feb 2007 14:31:10 +0000 (14:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:17:38 +0000 (12:17 -0500)
Volker

source/Makefile.in
source/configure.in
source/modules/vfs_notify_fam.c [moved from source/smbd/notify_fam.c with 91% similarity]

index de55f35a2dc54cff706fd9ec11fac49a18a99524..d365c9cab0cfb80b0bf069b024f478b9c3c46355 100644 (file)
@@ -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
 
index 0a14d4c88c85694d06dcbc25ab504b4ce3e22087..1883df1a17a2e09000a5a658d639595bc7e5c4ae 100644 (file)
@@ -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)
 
similarity index 91%
rename from source/smbd/notify_fam.c
rename to source/modules/vfs_notify_fam.c
index 3fa6dad162caf0f9b7e5f4497a07cb0604a1fc2d..b76046b37892313d7271692fe772f85b3523f2d2 100644 (file)
@@ -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);
+}