s3:smbd/oplock: pass smbd_server_connection to onefs_init_kernel_oplocks()
authorStefan Metzmacher <metze@samba.org>
Tue, 13 Dec 2011 12:38:41 +0000 (13:38 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 13 Dec 2011 19:31:09 +0000 (20:31 +0100)
metze

source3/smbd/oplock.c
source3/smbd/oplock_onefs.c
source3/smbd/proto.h

index fd02fbf60ae9c358706886732110c156abf1251a..a414b72d3134fed4ed6aa44cad32f1b47ca7bd1b 100644 (file)
@@ -958,7 +958,7 @@ bool init_oplocks(struct smbd_server_connection *sconn)
                koplocks = linux_init_kernel_oplocks(sconn);
 #elif HAVE_ONEFS
 #error Isilon, please check if the NULL context is okay here. Thanks!
-               koplocks = onefs_init_kernel_oplocks(NULL);
+               koplocks = onefs_init_kernel_oplocks(sconn);
 #endif
        }
 
index 4717b1faf7d6e6570b2c9cda0d60609c58358776..d7e36087350b740794b763653e9dbd02490dad21 100644 (file)
@@ -34,6 +34,7 @@
 
 struct onefs_oplocks_context {
        struct kernel_oplocks *ctx;
+       struct smbd_server_connection *sconn;
        const struct oplocks_event_ops *onefs_ops;
        int onefs_event_fd;
        struct fd_event *read_fde;
@@ -663,7 +664,7 @@ static const struct oplocks_event_ops onefs_dispatch_ops = {
        .semlock_async_failure = semlock_async_failure_handler,
 };
 
-struct kernel_oplocks *onefs_init_kernel_oplocks(TALLOC_CTX *mem_ctx)
+struct kernel_oplocks *onefs_init_kernel_oplocks(struct smbd_server_connection *sconn)
 {
        struct kernel_oplocks *_ctx = NULL;
        struct onefs_oplocks_context *ctx = NULL;
@@ -688,6 +689,7 @@ struct kernel_oplocks *onefs_init_kernel_oplocks(TALLOC_CTX *mem_ctx)
        if (!ctx) {
                goto err_out;
        }
+       ctx->sconn = sconn;
 
        _ctx->ops = &onefs_koplocks_ops;
        _ctx->flags = (KOPLOCKS_LEVEL2_SUPPORTED |
@@ -709,7 +711,7 @@ struct kernel_oplocks *onefs_init_kernel_oplocks(TALLOC_CTX *mem_ctx)
        DEBUG(10, ("oplock event_fd = %d\n", ctx->onefs_event_fd));
 
        /* Register the oplock event_fd with samba's event system */
-       ctx->read_fde = event_add_fd(server_event_context(),
+       ctx->read_fde = event_add_fd(sconn->ev_ctx,
                                     ctx,
                                     ctx->onefs_event_fd,
                                     EVENT_FD_READ,
index 22eeae988ee285c1af1cd5a19b057fd7bf0fef15..d7a7c4e4b5126da3cc1956352dece8876f4b04ce 100644 (file)
@@ -684,7 +684,7 @@ struct kernel_oplocks *linux_init_kernel_oplocks(struct smbd_server_connection *
 
 /* The following definitions come from smbd/oplock_onefs.c  */
 
-struct kernel_oplocks *onefs_init_kernel_oplocks(TALLOC_CTX *mem_ctx);
+struct kernel_oplocks *onefs_init_kernel_oplocks(struct smbd_server_connection *sconn);
 
 /* The following definitions come from smbd/password.c  */