diff options
author | Michael Adam <obnox@samba.org> | 2014-01-28 12:33:42 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2014-02-07 16:06:07 +0100 |
commit | bbf0903d6bf60afc38b75332e36d81868c05d22c (patch) | |
tree | 704d54ba29a1a5be082635b12d3c1499308aff82 | |
parent | 906abe55cbc6f0e2daed93975411d4fc1ece5d3a (diff) | |
download | samba-bbf0903d6bf60afc38b75332e36d81868c05d22c.tar.gz samba-bbf0903d6bf60afc38b75332e36d81868c05d22c.tar.xz samba-bbf0903d6bf60afc38b75332e36d81868c05d22c.zip |
dbwrap: add a dbwrap_flags argument to db_open_tdb()
...for consistency and in preparation of future flags
that the tdb backend might be aware of.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | lib/dbwrap/dbwrap_local_open.c | 4 | ||||
-rw-r--r-- | lib/dbwrap/dbwrap_tdb.c | 3 | ||||
-rw-r--r-- | lib/dbwrap/dbwrap_tdb.h | 3 | ||||
-rw-r--r-- | source3/smbd/notify_internal.c | 2 | ||||
-rw-r--r-- | source4/ntvfs/posix/python/pyxattr_tdb.c | 6 |
5 files changed, 11 insertions, 7 deletions
diff --git a/lib/dbwrap/dbwrap_local_open.c b/lib/dbwrap/dbwrap_local_open.c index 56048afa84..650bcb35df 100644 --- a/lib/dbwrap/dbwrap_local_open.c +++ b/lib/dbwrap/dbwrap_local_open.c @@ -103,7 +103,7 @@ static bool tdb_to_ntdb(TALLOC_CTX *ctx, struct loadparm_context *lp_ctx, return false; } tdb = db_open_tdb(ctx, lp_ctx, tdbname, 0, - TDB_DEFAULT, O_RDONLY, 0, 0); + TDB_DEFAULT, O_RDONLY, 0, 0, DBWRAP_FLAG_NONE); if (!tdb) { DEBUG(0, ("tdb_to_ntdb: could not open %s: %s\n", tdbname, strerror(errno))); @@ -213,7 +213,7 @@ struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx, } db = db_open_tdb(mem_ctx, lp_ctx, tdbname, hash_size, tdb_flags, open_flags, mode, - lock_order); + lock_order, dbwrap_flags); } out: talloc_free(tmp_ctx); diff --git a/lib/dbwrap/dbwrap_tdb.c b/lib/dbwrap/dbwrap_tdb.c index 3f21192233..1b061e3fdf 100644 --- a/lib/dbwrap/dbwrap_tdb.c +++ b/lib/dbwrap/dbwrap_tdb.c @@ -401,7 +401,8 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx, const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode, - enum dbwrap_lock_order lock_order) + enum dbwrap_lock_order lock_order, + uint64_t dbrwap_flags) { struct db_context *result = NULL; struct db_tdb_ctx *db_tdb; diff --git a/lib/dbwrap/dbwrap_tdb.h b/lib/dbwrap/dbwrap_tdb.h index 6a6da45a08..93ee09c605 100644 --- a/lib/dbwrap/dbwrap_tdb.h +++ b/lib/dbwrap/dbwrap_tdb.h @@ -29,7 +29,8 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx, const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode, - enum dbwrap_lock_order lock_order); + enum dbwrap_lock_order lock_order, + uint64_t dbwrap_flags); #endif /* __DBWRAP_TDB_H__ */ diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c index 0a7e5dea22..4d885651ba 100644 --- a/source3/smbd/notify_internal.c +++ b/source3/smbd/notify_internal.c @@ -137,7 +137,7 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, notify->db_notify = db_open_tdb( notify, lp_ctx, lock_path("notify.tdb"), 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, - O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_2); + O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_2, DBWRAP_FLAG_NONE); talloc_unlink(notify, lp_ctx); if (notify->db_notify == NULL) { goto fail; diff --git a/source4/ntvfs/posix/python/pyxattr_tdb.c b/source4/ntvfs/posix/python/pyxattr_tdb.c index b5109317dd..b866d7eea8 100644 --- a/source4/ntvfs/posix/python/pyxattr_tdb.c +++ b/source4/ntvfs/posix/python/pyxattr_tdb.c @@ -57,7 +57,8 @@ static PyObject *py_wrap_setxattr(PyObject *self, PyObject *args) blob.length = blobsize; mem_ctx = talloc_new(NULL); eadb = db_open_tdb(mem_ctx, py_default_loadparm_context(mem_ctx), tdbname, 50000, - TDB_DEFAULT, O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2); + TDB_DEFAULT, O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2, + DBWRAP_FLAG_NONE); if (eadb == NULL) { PyErr_SetFromErrno(PyExc_IOError); @@ -104,7 +105,8 @@ static PyObject *py_wrap_getxattr(PyObject *self, PyObject *args) mem_ctx = talloc_new(NULL); eadb = db_open_tdb(mem_ctx, py_default_loadparm_context(mem_ctx), tdbname, 50000, - TDB_DEFAULT, O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2); + TDB_DEFAULT, O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2, + DBWRAP_FLAG_NONE); if (eadb == NULL) { PyErr_SetFromErrno(PyExc_IOError); |