s4-ntvfs: Rename brl_*() -> brlock_*() to avoid conflict with brlock_init in s3
authorAndrew Bartlett <abartlet@samba.org>
Sat, 7 May 2011 06:12:54 +0000 (08:12 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 8 May 2011 08:56:26 +0000 (10:56 +0200)
source4/ntvfs/common/brlock.c
source4/ntvfs/common/brlock.h
source4/ntvfs/common/brlock_tdb.c
source4/ntvfs/posix/pvfs_lock.c
source4/ntvfs/posix/pvfs_open.c
source4/ntvfs/posix/vfs_posix.c
source4/ntvfs/posix/vfs_posix.h

index efb70226e68013066cb60397f42beed52ee0e42b..142b4ff799d17ba9d0c12e067890ee3db2cf46e6 100644 (file)
@@ -38,7 +38,7 @@ static const struct brlock_ops *ops;
 /*
   set the brl backend ops
 */
-void brl_set_ops(const struct brlock_ops *new_ops)
+void brlock_set_ops(const struct brlock_ops *new_ops)
 {
        ops = new_ops;
 }
@@ -47,7 +47,7 @@ void brl_set_ops(const struct brlock_ops *new_ops)
   Open up the brlock database. Close it down using talloc_free(). We
   need the imessaging_ctx to allow for pending lock notifications.
 */
-struct brl_context *brl_init(TALLOC_CTX *mem_ctx, struct server_id server, 
+struct brl_context *brlock_init(TALLOC_CTX *mem_ctx, struct server_id server, 
                             struct loadparm_context *lp_ctx,
                             struct imessaging_context *imessaging_ctx)
 {
@@ -57,7 +57,7 @@ struct brl_context *brl_init(TALLOC_CTX *mem_ctx, struct server_id server,
        return ops->brl_init(mem_ctx, server, lp_ctx, imessaging_ctx);
 }
 
-struct brl_handle *brl_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *ntvfs, DATA_BLOB *file_key)
+struct brl_handle *brlock_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *ntvfs, DATA_BLOB *file_key)
 {
        return ops->brl_create_handle(mem_ctx, ntvfs, file_key);
 }
@@ -69,7 +69,7 @@ struct brl_handle *brl_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *n
   someone else closing an overlapping lock range) a messaging
   notification is sent, identified by the notify_ptr
 */
-NTSTATUS brl_lock(struct brl_context *brl,
+NTSTATUS brlock_lock(struct brl_context *brl,
                  struct brl_handle *brlh,
                  uint32_t smbpid,
                  uint64_t start, uint64_t size, 
@@ -83,7 +83,7 @@ NTSTATUS brl_lock(struct brl_context *brl,
 /*
  Unlock a range of bytes.
 */
-NTSTATUS brl_unlock(struct brl_context *brl,
+NTSTATUS brlock_unlock(struct brl_context *brl,
                    struct brl_handle *brlh, 
                    uint32_t smbpid,
                    uint64_t start, uint64_t size)
@@ -96,7 +96,7 @@ NTSTATUS brl_unlock(struct brl_context *brl,
   given up trying to establish a lock or when they have succeeded in
   getting it. In either case they no longer need to be notified.
 */
-NTSTATUS brl_remove_pending(struct brl_context *brl,
+NTSTATUS brlock_remove_pending(struct brl_context *brl,
                            struct brl_handle *brlh, 
                            void *notify_ptr)
 {
@@ -107,7 +107,7 @@ NTSTATUS brl_remove_pending(struct brl_context *brl,
 /*
   Test if we are allowed to perform IO on a region of an open file
 */
-NTSTATUS brl_locktest(struct brl_context *brl,
+NTSTATUS brlock_locktest(struct brl_context *brl,
                      struct brl_handle *brlh,
                      uint32_t smbpid, 
                      uint64_t start, uint64_t size, 
@@ -120,7 +120,7 @@ NTSTATUS brl_locktest(struct brl_context *brl,
 /*
  Remove any locks associated with a open file.
 */
-NTSTATUS brl_close(struct brl_context *brl,
+NTSTATUS brlock_close(struct brl_context *brl,
                   struct brl_handle *brlh)
 {
        return ops->brl_close(brl, brlh);
@@ -129,7 +129,7 @@ NTSTATUS brl_close(struct brl_context *brl,
 /*
  Get a number of locks associated with a open file.
 */
-NTSTATUS brl_count(struct brl_context *brl,
+NTSTATUS brlock_count(struct brl_context *brl,
                   struct brl_handle *brlh,
                   int *count)
 {
index 7ae3111cc4374e773de7b7044579ffb44dfb72b6..703538f0738896ba0c66460fec1d1663041a1604 100644 (file)
@@ -52,7 +52,7 @@ struct brlock_ops {
 };
 
 
-void brl_set_ops(const struct brlock_ops *new_ops);
+void brlock_set_ops(const struct brlock_ops *new_ops);
 void brl_tdb_init_ops(void);
 void brl_ctdb_init_ops(void);
 
index ab4d91c4db635b2c461c4d33ebbe3d4236673091..3fd0edcc692371aba87e15596fa107a915c78027 100644 (file)
@@ -779,5 +779,5 @@ static const struct brlock_ops brlock_tdb_ops = {
 
 void brl_tdb_init_ops(void)
 {
-       brl_set_ops(&brlock_tdb_ops);
+       brlock_set_ops(&brlock_tdb_ops);
 }
index 11757deea49d02c6c903a1f8bb89eb9cd97121c1..76bc73dad8204f49ea3792876c986841c9478bb6 100644 (file)
@@ -39,7 +39,7 @@ NTSTATUS pvfs_check_lock(struct pvfs_state *pvfs,
                return NT_STATUS_OK;
        }
 
-       return brl_locktest(pvfs->brl_context,
+       return brlock_locktest(pvfs->brl_context,
                            f->brl_handle,
                            smbpid,
                            offset, count, rw);
@@ -70,7 +70,7 @@ static void pvfs_lock_async_failed(struct pvfs_state *pvfs,
 {
        /* undo the locks we just did */
        for (i--;i>=0;i--) {
-               brl_unlock(pvfs->brl_context,
+               brlock_unlock(pvfs->brl_context,
                           f->brl_handle,
                           locks[i].pid,
                           locks[i].offset,
@@ -127,7 +127,7 @@ static void pvfs_pending_lock_continue(void *private_data, enum pvfs_wait_notice
                 * because with this we'll get the correct error code
                 * FILE_LOCK_CONFLICT in the error case
                 */
-               status = brl_lock(pvfs->brl_context,
+               status = brlock_lock(pvfs->brl_context,
                                  f->brl_handle,
                                  locks[pending->pending_lock].pid,
                                  locks[pending->pending_lock].offset,
@@ -143,7 +143,7 @@ static void pvfs_pending_lock_continue(void *private_data, enum pvfs_wait_notice
           don't need the pending lock any more */
        if (NT_STATUS_IS_OK(status) || timed_out) {
                NTSTATUS status2;
-               status2 = brl_remove_pending(pvfs->brl_context, 
+               status2 = brlock_remove_pending(pvfs->brl_context, 
                                             f->brl_handle, pending);
                if (!NT_STATUS_IS_OK(status2)) {
                        DEBUG(0,("pvfs_lock: failed to remove pending lock - %s\n", nt_errstr(status2)));
@@ -177,7 +177,7 @@ static void pvfs_pending_lock_continue(void *private_data, enum pvfs_wait_notice
                        pending->pending_lock = i;
                }
 
-               status = brl_lock(pvfs->brl_context,
+               status = brlock_lock(pvfs->brl_context,
                                  f->brl_handle,
                                  locks[i].pid,
                                  locks[i].offset,
@@ -225,7 +225,7 @@ void pvfs_lock_close(struct pvfs_state *pvfs, struct pvfs_file *f)
        if (f->lock_count || f->pending_list) {
                DEBUG(5,("pvfs_lock: removing %.0f locks on close\n", 
                         (double)f->lock_count));
-               brl_close(f->pvfs->brl_context, f->brl_handle);
+               brlock_close(f->pvfs->brl_context, f->brl_handle);
                f->lock_count = 0;
        }
 
@@ -350,7 +350,7 @@ NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs,
        locks = lck->lockx.in.locks;
 
        for (i=0;i<lck->lockx.in.ulock_cnt;i++) {
-               status = brl_unlock(pvfs->brl_context,
+               status = brlock_unlock(pvfs->brl_context,
                                    f->brl_handle,
                                    locks[i].pid,
                                    locks[i].offset,
@@ -369,7 +369,7 @@ NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs,
                        pending->pending_lock = i;
                }
 
-               status = brl_lock(pvfs->brl_context,
+               status = brlock_lock(pvfs->brl_context,
                                  f->brl_handle,
                                  locks[i].pid,
                                  locks[i].offset,
@@ -394,7 +394,7 @@ NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs,
 
                        /* undo the locks we just did */
                        for (i--;i>=0;i--) {
-                               brl_unlock(pvfs->brl_context,
+                               brlock_unlock(pvfs->brl_context,
                                           f->brl_handle,
                                           locks[i].pid,
                                           locks[i].offset,
index 08a54f8e42be419da0fc412df1d590dcb53dc817..dfe2f2aa628c08ccfb5147ce615368c425d92ef0 100644 (file)
@@ -590,7 +590,7 @@ static NTSTATUS pvfs_brl_locking_handle(TALLOC_CTX *mem_ctx,
                data_blob_free(&odb_key);
        }
 
-       h = brl_create_handle(mem_ctx, ntvfs, &key);
+       h = brlock_create_handle(mem_ctx, ntvfs, &key);
        NT_STATUS_HAVE_NO_MEMORY(h);
 
        *_h = h;
@@ -1569,7 +1569,7 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
 
        f->handle->fd = fd;
 
-       status = brl_count(f->pvfs->brl_context, f->brl_handle, &count);
+       status = brlock_count(f->pvfs->brl_context, f->brl_handle, &count);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(lck);
                return status;
index b79ae957f303c7af6d67f5823ff70a9cd1292857..4c1404eec578ff120dc67fd07a29b1a798aa3acc 100644 (file)
@@ -249,7 +249,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs,
 
        ntvfs->private_data = pvfs;
 
-       pvfs->brl_context = brl_init(pvfs, 
+       pvfs->brl_context = brlock_init(pvfs, 
                                     pvfs->ntvfs->ctx->server_id,
                                     pvfs->ntvfs->ctx->lp_ctx,
                                     pvfs->ntvfs->ctx->msg_ctx);
index d60369df5016e312071e1a80c679fcf829e551da..e1593a38cf578c583960510c506226e360966bb1 100644 (file)
@@ -204,7 +204,7 @@ struct pvfs_file {
        /* a file handle to be used for byte range locking */
        struct brl_handle *brl_handle;
 
-       /* a count of active locks - used to avoid calling brl_close on
+       /* a count of active locks - used to avoid calling brlock_close on
           file close */
        uint64_t lock_count;