opendb: pass down a pointer to the fd in odb_open_file()
authorStefan Metzmacher <metze@samba.org>
Sat, 8 Mar 2008 08:12:09 +0000 (09:12 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 12 Mar 2008 16:35:04 +0000 (17:35 +0100)
This prepares kernel oplock support.

metze

source/cluster/ctdb/opendb_ctdb.c
source/librpc/idl/opendb.idl
source/ntvfs/common/opendb.c
source/ntvfs/common/opendb.h
source/ntvfs/common/opendb_tdb.c

index a7b8ddf7606ab5ca89bd6d7e95cb5acc9b09371e..402f3a2a1afe8ed1883f01d4fbf4bd22b7c7cc50 100644 (file)
@@ -283,7 +283,7 @@ static NTSTATUS odb_oplock_break_send(struct odb_context *odb, struct opendb_ent
 */
 static NTSTATUS odb_ctdb_open_file(struct odb_lock *lck,
                                   void *file_handle, const char *path,
-                                  bool allow_level_II_oplock,
+                                  int *fd, bool allow_level_II_oplock,
                                   uint32_t oplock_level, uint32_t *oplock_granted)
 
 {
index e3bc2d0f1775d3c5afad87835ee55358c6d5dfe9..72bf23a9b4b143d4a3d12049bc69c7782cf378d1 100644 (file)
@@ -20,6 +20,7 @@ interface opendb
                uint32 share_access;
                uint32 access_mask;
                pointer file_handle;
+               pointer fd;
                /* we need a per-entry delete on close, as well as a per-file
                   one, to cope with strange semantics on open */
                boolean8 delete_on_close;
index 1cc077137cc150710eaaf43a62eadf580a4ccdba..676706e03f18ddd6f4504253bd2f40ecca106213 100644 (file)
@@ -97,11 +97,11 @@ _PUBLIC_ DATA_BLOB odb_get_key(TALLOC_CTX *mem_ctx, struct odb_lock *lck)
 */
 _PUBLIC_ NTSTATUS odb_open_file(struct odb_lock *lck,
                                void *file_handle, const char *path,
-                               bool allow_level_II_oplock,
+                               int *fd, bool allow_level_II_oplock,
                                uint32_t oplock_level, uint32_t *oplock_granted)
 {
        return ops->odb_open_file(lck, file_handle, path,
-                                 allow_level_II_oplock,
+                                 fd, allow_level_II_oplock,
                                  oplock_level, oplock_granted);
 }
 
index fb3223aea929fc24dabeda6e3a8673503472cb0a..045476337abbb2bfd1acfbbd2825f3dbd6bc0a95 100644 (file)
@@ -27,7 +27,7 @@ struct opendb_ops {
        DATA_BLOB (*odb_get_key)(TALLOC_CTX *mem_ctx, struct odb_lock *lck);
        NTSTATUS (*odb_open_file)(struct odb_lock *lck,
                                  void *file_handle, const char *path,
-                                 bool allow_level_II_oplock,
+                                 int *fd, bool allow_level_II_oplock,
                                  uint32_t oplock_level, uint32_t *oplock_granted);
        NTSTATUS (*odb_open_file_pending)(struct odb_lock *lck, void *private);
        NTSTATUS (*odb_close_file)(struct odb_lock *lck, void *file_handle,
index 17fcdfbbb452d96a5845599a8b9533f88ae3b161..9b4a5bfa9f6d8ea8a118ce6cb5ccd2320f6daabb 100644 (file)
@@ -442,7 +442,7 @@ static NTSTATUS odb_tdb_open_can_internal(struct odb_context *odb,
 */
 static NTSTATUS odb_tdb_open_file(struct odb_lock *lck,
                                  void *file_handle, const char *path,
-                                 bool allow_level_II_oplock,
+                                 int *fd, bool allow_level_II_oplock,
                                  uint32_t oplock_level, uint32_t *oplock_granted)
 {
        struct odb_context *odb = lck->odb;
@@ -504,6 +504,7 @@ static NTSTATUS odb_tdb_open_file(struct odb_lock *lck,
        }
 
        lck->can_open.e->file_handle            = file_handle;
+       lck->can_open.e->fd                     = fd;
        lck->can_open.e->allow_level_II_oplock  = allow_level_II_oplock;
        lck->can_open.e->oplock_level           = oplock_level;
 
@@ -800,6 +801,7 @@ static NTSTATUS odb_tdb_can_open(struct odb_lock *lck,
 
        lck->can_open.e->server                 = odb->ntvfs_ctx->server_id;
        lck->can_open.e->file_handle            = NULL;
+       lck->can_open.e->fd                     = NULL;
        lck->can_open.e->stream_id              = stream_id;
        lck->can_open.e->share_access           = share_access;
        lck->can_open.e->access_mask            = access_mask;