summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-12-05 20:41:24 +0100
committerVolker Lendecke <vl@samba.org>2007-12-10 12:22:01 +0100
commit0527d3758ad7522995e1e1cc85a3c1b9ee22de52 (patch)
treebb8b36a08e29c176a97616fe8ca89268ee3cd97d
parentf4fe725ff173a173307b364939284b05c3d69a91 (diff)
downloadsamba-0527d3758ad7522995e1e1cc85a3c1b9ee22de52.tar.gz
samba-0527d3758ad7522995e1e1cc85a3c1b9ee22de52.tar.bz2
samba-0527d3758ad7522995e1e1cc85a3c1b9ee22de52.zip
Remove a static
(This used to be commit 1f317f471af72f8bbc6c9fdd3e79a27c59e6fb6e)
-rw-r--r--source3/locking/locking.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index eb7531d9a0..296323f7da 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -430,14 +430,10 @@ bool locking_end(void)
Form a static locking key for a dev/inode pair.
******************************************************************/
-static TDB_DATA locking_key(struct file_id id)
+static TDB_DATA locking_key(const struct file_id *id, struct file_id *tmp)
{
- static struct file_id key;
- TDB_DATA kbuf;
- key = id;
- kbuf.dptr = (uint8 *)&key;
- kbuf.dsize = sizeof(key);
- return kbuf;
+ *tmp = *id;
+ return make_tdb_data((const uint8_t *)tmp, sizeof(*tmp));
}
/*******************************************************************
@@ -783,12 +779,13 @@ static bool fill_share_mode_lock(struct share_mode_lock *lck,
}
struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
- struct file_id id,
+ const struct file_id id,
const char *servicepath,
const char *fname)
{
struct share_mode_lock *lck;
- TDB_DATA key = locking_key(id);
+ struct file_id tmp;
+ TDB_DATA key = locking_key(&id, &tmp);
if (!(lck = TALLOC_P(mem_ctx, struct share_mode_lock))) {
DEBUG(0, ("talloc failed\n"));
@@ -814,12 +811,13 @@ struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
}
struct share_mode_lock *fetch_share_mode_unlocked(TALLOC_CTX *mem_ctx,
- struct file_id id,
+ const struct file_id id,
const char *servicepath,
const char *fname)
{
struct share_mode_lock *lck;
- TDB_DATA key = locking_key(id);
+ struct file_id tmp;
+ TDB_DATA key = locking_key(&id, &tmp);
TDB_DATA data;
if (!(lck = TALLOC_P(mem_ctx, struct share_mode_lock))) {