summaryrefslogtreecommitdiffstats
path: root/source4/ntvfs/posix
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
commit6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch)
tree850c71039563c16a5d563c47e7ba2ab645baf198 /source4/ntvfs/posix
parent6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff)
parent2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff)
downloadsamba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz
samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.xz
samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16samba-4.0.0alpha16
Diffstat (limited to 'source4/ntvfs/posix')
-rw-r--r--source4/ntvfs/posix/pvfs_acl.c4
-rw-r--r--source4/ntvfs/posix/pvfs_dirlist.c8
-rw-r--r--source4/ntvfs/posix/pvfs_lock.c21
-rw-r--r--source4/ntvfs/posix/pvfs_open.c6
-rw-r--r--source4/ntvfs/posix/pvfs_oplock.c10
-rw-r--r--source4/ntvfs/posix/pvfs_qfileinfo.c9
-rw-r--r--source4/ntvfs/posix/pvfs_search.c4
-rw-r--r--source4/ntvfs/posix/pvfs_util.c2
-rw-r--r--source4/ntvfs/posix/pvfs_wait.c10
-rw-r--r--source4/ntvfs/posix/pvfs_write.c2
-rw-r--r--source4/ntvfs/posix/python/pyxattr_tdb.c4
-rw-r--r--source4/ntvfs/posix/vfs_posix.c8
-rw-r--r--source4/ntvfs/posix/vfs_posix.h2
-rw-r--r--source4/ntvfs/posix/xattr_tdb.c10
14 files changed, 52 insertions, 48 deletions
diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c
index 67b544d4dee..d7a778e1f7d 100644
--- a/source4/ntvfs/posix/pvfs_acl.c
+++ b/source4/ntvfs/posix/pvfs_acl.c
@@ -89,7 +89,7 @@ const struct pvfs_acl_ops *pvfs_acl_backend_byname(const char *name)
return NULL;
}
-NTSTATUS pvfs_acl_init(struct loadparm_context *lp_ctx)
+NTSTATUS pvfs_acl_init(void)
{
static bool initialized = false;
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
@@ -100,7 +100,7 @@ NTSTATUS pvfs_acl_init(struct loadparm_context *lp_ctx)
if (initialized) return NT_STATUS_OK;
initialized = true;
- shared_init = load_samba_modules(NULL, lp_ctx, "pvfs_acl");
+ shared_init = load_samba_modules(NULL, "pvfs_acl");
run_init_functions(static_init);
run_init_functions(shared_init);
diff --git a/source4/ntvfs/posix/pvfs_dirlist.c b/source4/ntvfs/posix/pvfs_dirlist.c
index 77f19c35850..1bc91c1c788 100644
--- a/source4/ntvfs/posix/pvfs_dirlist.c
+++ b/source4/ntvfs/posix/pvfs_dirlist.c
@@ -199,7 +199,7 @@ const char *pvfs_list_next(struct pvfs_dir *dir, off_t *ofs)
if (*ofs == DIR_OFFSET_DOT) {
(*ofs) = DIR_OFFSET_DOTDOT;
dir->offset = *ofs;
- if (ms_fnmatch(dir->pattern, ".", protocol) == 0) {
+ if (ms_fnmatch_protocol(dir->pattern, ".", protocol) == 0) {
dcache_add(dir, ".");
return ".";
}
@@ -208,7 +208,7 @@ const char *pvfs_list_next(struct pvfs_dir *dir, off_t *ofs)
if (*ofs == DIR_OFFSET_DOTDOT) {
(*ofs) = DIR_OFFSET_BASE;
dir->offset = *ofs;
- if (ms_fnmatch(dir->pattern, "..", protocol) == 0) {
+ if (ms_fnmatch_protocol(dir->pattern, "..", protocol) == 0) {
dcache_add(dir, "..");
return "..";
}
@@ -228,10 +228,10 @@ const char *pvfs_list_next(struct pvfs_dir *dir, off_t *ofs)
continue;
}
- if (ms_fnmatch(dir->pattern, dname, protocol) != 0) {
+ if (ms_fnmatch_protocol(dir->pattern, dname, protocol) != 0) {
char *short_name = pvfs_short_name_component(dir->pvfs, dname);
if (short_name == NULL ||
- ms_fnmatch(dir->pattern, short_name, protocol) != 0) {
+ ms_fnmatch_protocol(dir->pattern, short_name, protocol) != 0) {
talloc_free(short_name);
continue;
}
diff --git a/source4/ntvfs/posix/pvfs_lock.c b/source4/ntvfs/posix/pvfs_lock.c
index 11757deea49..0d99860e59b 100644
--- a/source4/ntvfs/posix/pvfs_lock.c
+++ b/source4/ntvfs/posix/pvfs_lock.c
@@ -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;
}
@@ -324,8 +324,7 @@ NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs,
pending->req = req;
pending->end_time =
- timeval_current_ofs(lck->lockx.in.timeout/1000,
- 1000*(lck->lockx.in.timeout%1000));
+ timeval_current_ofs_msec(lck->lockx.in.timeout);
}
if (lck->lockx.in.mode & LOCKING_ANDX_SHARED_LOCK) {
@@ -350,7 +349,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 +368,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 +393,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,
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index 08a54f8e42b..d56bce58f75 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/ntvfs/posix/pvfs_open.c
@@ -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;
@@ -1174,7 +1174,7 @@ static NTSTATUS pvfs_open_setup_retry(struct ntvfs_module_context *ntvfs,
*final_timeout = timeval_add(&req->statistics.request_time,
pvfs->oplock_break_timeout,
0);
- end_time = timeval_current_ofs(0, (pvfs->sharing_violation_delay*4)/5);
+ end_time = timeval_current_ofs_usec((pvfs->sharing_violation_delay*4)/5);
end_time = timeval_min(final_timeout, &end_time);
} else {
return NT_STATUS_INTERNAL_ERROR;
@@ -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;
diff --git a/source4/ntvfs/posix/pvfs_oplock.c b/source4/ntvfs/posix/pvfs_oplock.c
index a10188f3eb5..5b9f3a318c8 100644
--- a/source4/ntvfs/posix/pvfs_oplock.c
+++ b/source4/ntvfs/posix/pvfs_oplock.c
@@ -32,7 +32,7 @@ struct pvfs_oplock {
uint32_t level;
struct timeval break_to_level_II;
struct timeval break_to_none;
- struct messaging_context *msg_ctx;
+ struct imessaging_context *msg_ctx;
};
static NTSTATUS pvfs_oplock_release_internal(struct pvfs_file_handle *h,
@@ -158,7 +158,7 @@ static void pvfs_oplock_break(struct pvfs_oplock *opl, uint8_t level)
}
}
-static void pvfs_oplock_break_dispatch(struct messaging_context *msg,
+static void pvfs_oplock_break_dispatch(struct imessaging_context *msg,
void *private_data, uint32_t msg_type,
struct server_id src, DATA_BLOB *data)
{
@@ -169,7 +169,7 @@ static void pvfs_oplock_break_dispatch(struct messaging_context *msg,
ZERO_STRUCT(opb);
/* we need to check that this one is for us. See
- messaging_send_ptr() for the other side of this.
+ imessaging_send_ptr() for the other side of this.
*/
if (data->length == sizeof(struct opendb_oplock_break)) {
struct opendb_oplock_break *p;
@@ -192,7 +192,7 @@ static void pvfs_oplock_break_dispatch(struct messaging_context *msg,
static int pvfs_oplock_destructor(struct pvfs_oplock *opl)
{
- messaging_deregister(opl->msg_ctx, MSG_NTVFS_OPLOCK_BREAK, opl);
+ imessaging_deregister(opl->msg_ctx, MSG_NTVFS_OPLOCK_BREAK, opl);
return 0;
}
@@ -228,7 +228,7 @@ NTSTATUS pvfs_setup_oplock(struct pvfs_file *f, uint32_t oplock_granted)
opl->level = level;
opl->msg_ctx = f->pvfs->ntvfs->ctx->msg_ctx;
- status = messaging_register(opl->msg_ctx,
+ status = imessaging_register(opl->msg_ctx,
opl,
MSG_NTVFS_OPLOCK_BREAK,
pvfs_oplock_break_dispatch);
diff --git a/source4/ntvfs/posix/pvfs_qfileinfo.c b/source4/ntvfs/posix/pvfs_qfileinfo.c
index e54fc2d6690..92843067539 100644
--- a/source4/ntvfs/posix/pvfs_qfileinfo.c
+++ b/source4/ntvfs/posix/pvfs_qfileinfo.c
@@ -149,9 +149,6 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
int fd)
{
switch (info->generic.level) {
- case RAW_FILEINFO_GENERIC:
- return NT_STATUS_INVALID_LEVEL;
-
case RAW_FILEINFO_GETATTR:
info->getattr.out.attrib = name->dos.attrib;
info->getattr.out.size = name->st.st_size;
@@ -333,6 +330,12 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
name->original_name);
NT_STATUS_HAVE_NO_MEMORY(info->all_info2.out.fname.s);
return NT_STATUS_OK;
+
+ case RAW_FILEINFO_GENERIC:
+ case RAW_FILEINFO_UNIX_BASIC:
+ case RAW_FILEINFO_UNIX_INFO2:
+ case RAW_FILEINFO_UNIX_LINK:
+ return NT_STATUS_INVALID_LEVEL;
}
return NT_STATUS_INVALID_LEVEL;
diff --git a/source4/ntvfs/posix/pvfs_search.c b/source4/ntvfs/posix/pvfs_search.c
index a050de1ec38..893f55c5aca 100644
--- a/source4/ntvfs/posix/pvfs_search.c
+++ b/source4/ntvfs/posix/pvfs_search.c
@@ -221,7 +221,9 @@ static NTSTATUS fill_search_info(struct pvfs_state *pvfs,
return NT_STATUS_OK;
case RAW_SEARCH_DATA_GENERIC:
- break;
+ case RAW_SEARCH_DATA_UNIX_INFO:
+ case RAW_SEARCH_DATA_UNIX_INFO2:
+ return NT_STATUS_INVALID_LEVEL;
}
return NT_STATUS_INVALID_LEVEL;
diff --git a/source4/ntvfs/posix/pvfs_util.c b/source4/ntvfs/posix/pvfs_util.c
index 8dedf13a633..c6c6eaa13c8 100644
--- a/source4/ntvfs/posix/pvfs_util.c
+++ b/source4/ntvfs/posix/pvfs_util.c
@@ -40,7 +40,7 @@ bool pvfs_has_wildcard(const char *str)
NTSTATUS pvfs_map_errno(struct pvfs_state *pvfs, int unix_errno)
{
NTSTATUS status;
- status = map_nt_error_from_unix(unix_errno);
+ status = map_nt_error_from_unix_common(unix_errno);
DEBUG(10,(__location__ " mapped unix errno %d -> %s\n", unix_errno, nt_errstr(status)));
return status;
}
diff --git a/source4/ntvfs/posix/pvfs_wait.c b/source4/ntvfs/posix/pvfs_wait.c
index 876ce527978..013de69889c 100644
--- a/source4/ntvfs/posix/pvfs_wait.c
+++ b/source4/ntvfs/posix/pvfs_wait.c
@@ -33,7 +33,7 @@ struct pvfs_wait {
void (*handler)(void *, enum pvfs_wait_notice);
void *private_data;
int msg_type;
- struct messaging_context *msg_ctx;
+ struct imessaging_context *msg_ctx;
struct tevent_context *ev;
struct ntvfs_request *req;
enum pvfs_wait_notice reason;
@@ -56,7 +56,7 @@ NTSTATUS pvfs_async_setup(struct ntvfs_module_context *ntvfs,
/*
receive a completion message for a wait
*/
-static void pvfs_wait_dispatch(struct messaging_context *msg,
+static void pvfs_wait_dispatch(struct imessaging_context *msg,
void *private_data, uint32_t msg_type,
struct server_id src, DATA_BLOB *data)
{
@@ -66,7 +66,7 @@ static void pvfs_wait_dispatch(struct messaging_context *msg,
void *p = NULL;
/* we need to check that this one is for us. See
- messaging_send_ptr() for the other side of this.
+ imessaging_send_ptr() for the other side of this.
*/
if (data->length == sizeof(void *)) {
void **pp;
@@ -116,7 +116,7 @@ static void pvfs_wait_timeout(struct tevent_context *ev,
static int pvfs_wait_destructor(struct pvfs_wait *pwait)
{
if (pwait->msg_type != -1) {
- messaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait);
+ imessaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait);
}
DLIST_REMOVE(pwait->pvfs->wait_list, pwait);
return 0;
@@ -162,7 +162,7 @@ struct pvfs_wait *pvfs_wait_message(struct pvfs_state *pvfs,
/* register with the messaging subsystem for this message
type */
if (msg_type != -1) {
- messaging_register(pwait->msg_ctx,
+ imessaging_register(pwait->msg_ctx,
pwait,
msg_type,
pvfs_wait_dispatch);
diff --git a/source4/ntvfs/posix/pvfs_write.c b/source4/ntvfs/posix/pvfs_write.c
index fb629a87fb3..892d3dd7495 100644
--- a/source4/ntvfs/posix/pvfs_write.c
+++ b/source4/ntvfs/posix/pvfs_write.c
@@ -64,7 +64,7 @@ static void pvfs_trigger_write_time_update(struct pvfs_file_handle *h)
return;
}
- tv = timeval_current_ofs(0, pvfs->writetime_delay);
+ tv = timeval_current_ofs_usec(pvfs->writetime_delay);
h->write_time.update_triggered = true;
h->write_time.update_on_close = true;
diff --git a/source4/ntvfs/posix/python/pyxattr_tdb.c b/source4/ntvfs/posix/python/pyxattr_tdb.c
index 5e72ac9dde5..2b28aca365a 100644
--- a/source4/ntvfs/posix/python/pyxattr_tdb.c
+++ b/source4/ntvfs/posix/python/pyxattr_tdb.c
@@ -20,8 +20,8 @@
#include <Python.h>
#include "includes.h"
-#include <tdb.h>
-#include "tdb_wrap.h"
+#include "tdb_compat.h"
+#include "lib/util/tdb_wrap.h"
#include "librpc/ndr/libndr.h"
#include "lib/util/wrap_xattr.h"
#include "ntvfs/posix/vfs_posix.h"
diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c
index ca1d1633279..00ed146c965 100644
--- a/source4/ntvfs/posix/vfs_posix.c
+++ b/source4/ntvfs/posix/vfs_posix.c
@@ -26,8 +26,8 @@
#include "includes.h"
#include "vfs_posix.h"
#include "librpc/gen_ndr/security.h"
-#include <tdb.h>
-#include "tdb_wrap.h"
+#include "tdb_compat.h"
+#include "lib/util/tdb_wrap.h"
#include "libcli/security/security.h"
#include "lib/events/events.h"
#include "param/param.h"
@@ -212,7 +212,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs,
* TODO: call this from ntvfs_posix_init()
* but currently we don't have a lp_ctx there
*/
- status = pvfs_acl_init(ntvfs->ctx->lp_ctx);
+ status = pvfs_acl_init();
NT_STATUS_NOT_OK_RETURN(status);
pvfs = talloc_zero(ntvfs, struct pvfs_state);
@@ -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);
diff --git a/source4/ntvfs/posix/vfs_posix.h b/source4/ntvfs/posix/vfs_posix.h
index d60369df501..e1593a38cf5 100644
--- a/source4/ntvfs/posix/vfs_posix.h
+++ b/source4/ntvfs/posix/vfs_posix.h
@@ -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;
diff --git a/source4/ntvfs/posix/xattr_tdb.c b/source4/ntvfs/posix/xattr_tdb.c
index de7c83677a4..07b37122158 100644
--- a/source4/ntvfs/posix/xattr_tdb.c
+++ b/source4/ntvfs/posix/xattr_tdb.c
@@ -20,8 +20,8 @@
*/
#include "includes.h"
-#include "tdb_wrap.h"
-#include <tdb.h>
+#include "lib/util/tdb_wrap.h"
+#include "tdb_compat.h"
#include "vfs_posix.h"
#define XATTR_LIST_ATTR ".xattr_list"
@@ -129,7 +129,7 @@ NTSTATUS pull_xattr_blob_tdb_raw(struct tdb_wrap *ea_tdb,
return status;
}
- tdata = tdb_fetch(ea_tdb->tdb, tkey);
+ tdata = tdb_fetch_compat(ea_tdb->tdb, tkey);
if (tdata.dptr == NULL) {
return NT_STATUS_NOT_FOUND;
}
@@ -185,7 +185,7 @@ NTSTATUS push_xattr_blob_tdb_raw(struct tdb_wrap *ea_tdb,
goto done;
}
- if (tdb_store(ea_tdb->tdb, tkey, tdata, TDB_REPLACE) == -1) {
+ if (tdb_store(ea_tdb->tdb, tkey, tdata, TDB_REPLACE) != 0) {
status = NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -218,7 +218,7 @@ NTSTATUS delete_xattr_tdb(struct pvfs_state *pvfs, const char *attr_name,
return status;
}
- if (tdb_delete(pvfs->ea_db->tdb, tkey) == -1) {
+ if (tdb_delete(pvfs->ea_db->tdb, tkey) != 0) {
talloc_free(tkey.dptr);
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}