summaryrefslogtreecommitdiff
path: root/source4/smb_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-09-29 13:17:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:30 -0500
commitdcad0f6fd492506efd9a69b4e32c7bbfa5da90e5 (patch)
tree5dd39ae343981c37d3a735abf0cb799a86b1245b /source4/smb_server
parentcd5326a44ee1f83ff9a1d96d50b56db9a2eb0d94 (diff)
downloadsamba-dcad0f6fd492506efd9a69b4e32c7bbfa5da90e5.tar.gz
samba-dcad0f6fd492506efd9a69b4e32c7bbfa5da90e5.tar.bz2
samba-dcad0f6fd492506efd9a69b4e32c7bbfa5da90e5.zip
r2751: this is a new ntvfs design which tries to solve:
- the stacking of modules - finding the modules private data - hide the ntvfs details from the calling layer - I set NTVFS_INTERFACE_VERSION 0 till we are closer to release (because we need to solve some async problems with the module stacking) metze (This used to be commit 3ff03b5cb21bb79afdd3b1609be9635f6688a539)
Diffstat (limited to 'source4/smb_server')
-rw-r--r--source4/smb_server/nttrans.c2
-rw-r--r--source4/smb_server/reply.c78
-rw-r--r--source4/smb_server/search.c6
-rw-r--r--source4/smb_server/service.c17
-rw-r--r--source4/smb_server/smb_server.c2
-rw-r--r--source4/smb_server/smb_server.h19
-rw-r--r--source4/smb_server/trans2.c54
7 files changed, 76 insertions, 102 deletions
diff --git a/source4/smb_server/nttrans.c b/source4/smb_server/nttrans.c
index 683e9e3386..0150eff0fa 100644
--- a/source4/smb_server/nttrans.c
+++ b/source4/smb_server/nttrans.c
@@ -94,7 +94,7 @@ static NTSTATUS nttrans_ioctl(struct smbsrv_request *req,
nttrans_setup_reply(req, trans, 0, 0, 1);
trans->out.setup[0] = 0;
- return req->tcon->ntvfs_ops->ioctl(req, &nt);
+ return ntvfs_ioctl(req, &nt);
}
/*
diff --git a/source4/smb_server/reply.c b/source4/smb_server/reply.c
index 94317bfc39..2a5a7064bd 100644
--- a/source4/smb_server/reply.c
+++ b/source4/smb_server/reply.c
@@ -240,7 +240,7 @@ void reply_ioctl(struct smbsrv_request *req)
req->async.private = io;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->ioctl(req, io);
+ req->async.status = ntvfs_ioctl(req, io);
REQ_ASYNC_TAIL;
}
@@ -259,7 +259,7 @@ void reply_chkpth(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
- req->async.status = req->tcon->ntvfs_ops->chkpath(req, io);
+ req->async.status = ntvfs_chkpath(req, io);
REQ_ASYNC_TAIL;
}
@@ -308,7 +308,7 @@ void reply_getatr(struct smbsrv_request *req)
req->async.private = st;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->qpathinfo(req, st);
+ req->async.status = ntvfs_qpathinfo(req, st);
REQ_ASYNC_TAIL;
}
@@ -339,7 +339,7 @@ void reply_setatr(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->setpathinfo(req, st);
+ req->async.status = ntvfs_setpathinfo(req, st);
REQ_ASYNC_TAIL;
}
@@ -383,7 +383,7 @@ void reply_dskattr(struct smbsrv_request *req)
req->async.private = fs;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->fsinfo(req, fs);
+ req->async.status = ntvfs_fsinfo(req, fs);
REQ_ASYNC_TAIL;
}
@@ -437,7 +437,7 @@ void reply_open(struct smbsrv_request *req)
req->async.private = oi;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->open(req, oi);
+ req->async.status = ntvfs_open(req, oi);
REQ_ASYNC_TAIL;
}
@@ -512,7 +512,7 @@ void reply_open_and_X(struct smbsrv_request *req)
req->async.private = oi;
/* call the backend */
- req->async.status = req->tcon->ntvfs_ops->open(req, oi);
+ req->async.status = ntvfs_open(req, oi);
REQ_ASYNC_TAIL;
}
@@ -562,7 +562,7 @@ void reply_mknew(struct smbsrv_request *req)
req->async.private = oi;
/* call the backend */
- req->async.status = req->tcon->ntvfs_ops->open(req, oi);
+ req->async.status = ntvfs_open(req, oi);
REQ_ASYNC_TAIL;
}
@@ -615,7 +615,7 @@ void reply_ctemp(struct smbsrv_request *req)
req->async.private = oi;
/* call the backend */
- req->async.status = req->tcon->ntvfs_ops->open(req, oi);
+ req->async.status = ntvfs_open(req, oi);
REQ_ASYNC_TAIL;
}
@@ -639,7 +639,7 @@ void reply_unlink(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->unlink(req, unl);
+ req->async.status = ntvfs_unlink(req, unl);
REQ_ASYNC_TAIL;
}
@@ -688,7 +688,7 @@ void reply_readbraw(struct smbsrv_request *req)
io.readbraw.out.data = req->out.buffer + NBT_HDR_SIZE;
/* call the backend */
- status = req->tcon->ntvfs_ops->read(req, &io);
+ status = ntvfs_read(req, &io);
if (!NT_STATUS_IS_OK(status)) {
goto failed;
@@ -762,7 +762,7 @@ void reply_lockread(struct smbsrv_request *req)
req->async.private = io;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->read(req, io);
+ req->async.status = ntvfs_read(req, io);
REQ_ASYNC_TAIL;
}
@@ -820,7 +820,7 @@ void reply_read(struct smbsrv_request *req)
req->async.private = io;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->read(req, io);
+ req->async.status = ntvfs_read(req, io);
REQ_ASYNC_TAIL;
}
@@ -891,7 +891,7 @@ void reply_read_and_X(struct smbsrv_request *req)
req->async.private = io;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->read(req, io);
+ req->async.status = ntvfs_read(req, io);
REQ_ASYNC_TAIL;
}
@@ -957,7 +957,7 @@ void reply_writeunlock(struct smbsrv_request *req)
req->async.private = io;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->write(req, io);
+ req->async.status = ntvfs_write(req, io);
REQ_ASYNC_TAIL;
}
@@ -1014,7 +1014,7 @@ void reply_write(struct smbsrv_request *req)
req->async.private = io;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->write(req, io);
+ req->async.status = ntvfs_write(req, io);
REQ_ASYNC_TAIL;
}
@@ -1080,7 +1080,7 @@ void reply_write_and_X(struct smbsrv_request *req)
req->async.private = io;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->write(req, io);
+ req->async.status = ntvfs_write(req, io);
REQ_ASYNC_TAIL;
}
@@ -1121,7 +1121,7 @@ void reply_lseek(struct smbsrv_request *req)
req->async.private = io;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->seek(req, io);
+ req->async.status = ntvfs_seek(req, io);
REQ_ASYNC_TAIL;
}
@@ -1142,7 +1142,7 @@ void reply_flush(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->flush(req, io);
+ req->async.status = ntvfs_flush(req, io);
REQ_ASYNC_TAIL;
}
@@ -1159,7 +1159,7 @@ void reply_exit(struct smbsrv_request *req)
for (tcon=req->smb_conn->tree.tcons;tcon;tcon=tcon->next) {
req->tcon = tcon;
- status = tcon->ntvfs_ops->exit(req);
+ status = ntvfs_exit(req);
req->tcon = NULL;
if (!NT_STATUS_IS_OK(status)) {
req_reply_error(req, status);
@@ -1192,7 +1192,7 @@ void reply_close(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->close(req, io);
+ req->async.status = ntvfs_close(req, io);
REQ_ASYNC_TAIL;
}
@@ -1247,7 +1247,7 @@ void reply_writeclose(struct smbsrv_request *req)
req->async.private = io;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->write(req, io);
+ req->async.status = ntvfs_write(req, io);
REQ_ASYNC_TAIL;
}
@@ -1271,7 +1271,7 @@ void reply_lock(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->lock(req, lck);
+ req->async.status = ntvfs_lock(req, lck);
REQ_ASYNC_TAIL;
}
@@ -1296,7 +1296,7 @@ void reply_unlock(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->lock(req, lck);
+ req->async.status = ntvfs_lock(req, lck);
REQ_ASYNC_TAIL;
}
@@ -1385,7 +1385,7 @@ void reply_printopen(struct smbsrv_request *req)
req->async.private = oi;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->open(req, oi);
+ req->async.status = ntvfs_open(req, oi);
REQ_ASYNC_TAIL;
}
@@ -1407,7 +1407,7 @@ void reply_printclose(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->close(req, io);
+ req->async.status = ntvfs_close(req, io);
REQ_ASYNC_TAIL;
}
@@ -1476,7 +1476,7 @@ void reply_printqueue(struct smbsrv_request *req)
req->async.private = lpq;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->lpq(req, lpq);
+ req->async.status = ntvfs_lpq(req, lpq);
REQ_ASYNC_TAIL;
}
@@ -1513,7 +1513,7 @@ void reply_printwrite(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->write(req, io);
+ req->async.status = ntvfs_write(req, io);
REQ_ASYNC_TAIL;
}
@@ -1536,7 +1536,7 @@ void reply_mkdir(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->mkdir(req, io);
+ req->async.status = ntvfs_mkdir(req, io);
REQ_ASYNC_TAIL;
}
@@ -1558,7 +1558,7 @@ void reply_rmdir(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->rmdir(req, io);
+ req->async.status = ntvfs_rmdir(req, io);
REQ_ASYNC_TAIL;
}
@@ -1591,7 +1591,7 @@ void reply_mv(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->rename(req, io);
+ req->async.status = ntvfs_rename(req, io);
REQ_ASYNC_TAIL;
}
@@ -1626,7 +1626,7 @@ void reply_ntrename(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->rename(req, io);
+ req->async.status = ntvfs_rename(req, io);
REQ_ASYNC_TAIL;
}
@@ -1677,7 +1677,7 @@ void reply_copy(struct smbsrv_request *req)
req->async.private = cp;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->copy(req, cp);
+ req->async.status = ntvfs_copy(req, cp);
REQ_ASYNC_TAIL;
}
@@ -1777,7 +1777,7 @@ void reply_lockingX(struct smbsrv_request *req)
req->async.private = lck;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->lock(req, lck);
+ req->async.status = ntvfs_lock(req, lck);
REQ_ASYNC_TAIL;
}
@@ -1812,7 +1812,7 @@ void reply_setattrE(struct smbsrv_request *req)
req->async.send_fn = reply_simple_send;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->setfileinfo(req, info);
+ req->async.status = ntvfs_setfileinfo(req, info);
REQ_ASYNC_TAIL;
}
@@ -1879,7 +1879,7 @@ void reply_getattrE(struct smbsrv_request *req)
req->async.private = info;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->qfileinfo(req, info);
+ req->async.status = ntvfs_qfileinfo(req, info);
REQ_ASYNC_TAIL;
}
@@ -2116,7 +2116,7 @@ void reply_ulogoffX(struct smbsrv_request *req)
if ((vuid != 0) && (lp_security() != SEC_SHARE)) {
for (tcon=req->smb_conn->tree.tcons;tcon;tcon=tcon->next) {
req->tcon = tcon;
- status = tcon->ntvfs_ops->logoff(req);
+ status = ntvfs_logoff(req);
req->tcon = NULL;
if (!NT_STATUS_IS_OK(status)) {
req_reply_error(req, status);
@@ -2152,7 +2152,7 @@ void reply_findclose(struct smbsrv_request *req)
io.findclose.in.handle = SVAL(req->in.vwv, VWV(0));
/* call backend */
- status = req->tcon->ntvfs_ops->search_close(req, &io);
+ status = ntvfs_search_close(req, &io);
if (!NT_STATUS_IS_OK(status)) {
req_reply_error(req, status);
@@ -2250,7 +2250,7 @@ void reply_ntcreate_and_X(struct smbsrv_request *req)
req->async.private = io;
/* call the backend */
- req->async.status = req->tcon->ntvfs_ops->open(req, io);
+ req->async.status = ntvfs_open(req, io);
REQ_ASYNC_TAIL;
}
diff --git a/source4/smb_server/search.c b/source4/smb_server/search.c
index acd1b6d417..6a8653c749 100644
--- a/source4/smb_server/search.c
+++ b/source4/smb_server/search.c
@@ -174,7 +174,7 @@ void reply_search(struct smbsrv_request *req)
sn->search_next.in.search_attrib = SVAL(req->in.vwv, VWV(1));
/* call backend */
- status = req->tcon->ntvfs_ops->search_next(req, sn, &state, find_callback);
+ status = ntvfs_search_next(req, sn, &state, find_callback);
SSVAL(req->out.vwv, VWV(0), sn->search_next.out.count);
} else {
/* do a search first operation */
@@ -183,7 +183,7 @@ void reply_search(struct smbsrv_request *req)
sf->search_first.in.max_count = SVAL(req->in.vwv, VWV(0));
/* call backend */
- status = req->tcon->ntvfs_ops->search_first(req, sf, &state, find_callback);
+ status = ntvfs_search_first(req, sf, &state, find_callback);
SSVAL(req->out.vwv, VWV(0), sf->search_first.out.count);
}
@@ -272,7 +272,7 @@ void reply_fclose(struct smbsrv_request *req)
req->async.private = sc;
/* call backend */
- req->async.status = req->tcon->ntvfs_ops->search_close(req, sc);
+ req->async.status = ntvfs_search_close(req, sc);
REQ_ASYNC_TAIL;
}
diff --git a/source4/smb_server/service.c b/source4/smb_server/service.c
index 5f698fe20b..8519869e6b 100644
--- a/source4/smb_server/service.c
+++ b/source4/smb_server/service.c
@@ -158,7 +158,6 @@ static NTSTATUS make_connection_snum(struct smbsrv_request *req,
req->tcon = tcon;
tcon->service = snum;
- tcon->type = type;
/*
* New code to check if there's a share security descripter
@@ -180,7 +179,7 @@ static NTSTATUS make_connection_snum(struct smbsrv_request *req,
}
/* init ntvfs function pointers */
- status = ntvfs_init_connection(req);
+ status = ntvfs_init_connection(req, type);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("ntvfs_init_connection failed for service %s\n", lp_servicename(SNUM(tcon))));
conn_free(req->smb_conn, tcon);
@@ -188,13 +187,11 @@ static NTSTATUS make_connection_snum(struct smbsrv_request *req,
}
/* Invoke NTVFS connection hook */
- if (tcon->ntvfs_ops->connect) {
- status = tcon->ntvfs_ops->connect(req, lp_servicename(snum), 0);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0,("make_connection: NTVFS make connection failed!\n"));
- conn_free(req->smb_conn, tcon);
- return status;
- }
+ status = ntvfs_connect(req, lp_servicename(snum));
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0,("make_connection: NTVFS make connection failed!\n"));
+ conn_free(req->smb_conn, tcon);
+ return status;
}
return NT_STATUS_OK;
@@ -259,7 +256,7 @@ void close_cnum(struct smbsrv_tcon *tcon)
lp_servicename(SNUM(tcon))));
/* tell the ntvfs backend that we are disconnecting */
- tcon->ntvfs_ops->disconnect(tcon, 0);
+ ntvfs_disconnect(tcon);
conn_free(tcon->smb_conn, tcon);
}
diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c
index 883be01b41..28ca4d880a 100644
--- a/source4/smb_server/smb_server.c
+++ b/source4/smb_server/smb_server.c
@@ -512,7 +512,7 @@ static void switch_message(int type, struct smbsrv_request *req)
}
/* ipc services are limited */
- if (req->tcon && req->tcon->type == NTVFS_IPC && (flags & AS_USER) && !(flags & CAN_IPC)) {
+ if (req->tcon && req->tcon->ntvfs_ctx->type == NTVFS_IPC && (flags & AS_USER) && !(flags & CAN_IPC)) {
req_reply_error(req, NT_STATUS_ACCESS_DENIED);
return;
}
diff --git a/source4/smb_server/smb_server.h b/source4/smb_server/smb_server.h
index 1f7df36a9b..c40633eb06 100644
--- a/source4/smb_server/smb_server.h
+++ b/source4/smb_server/smb_server.h
@@ -46,15 +46,9 @@ struct smbsrv_session {
struct auth_session_info *session_info;
};
-
-/* each backend has to be one one of the following 3 basic types. In
- * earlier versions of Samba backends needed to handle all types, now
- * we implement them separately. */
-enum ntvfs_type {NTVFS_DISK, NTVFS_PRINT, NTVFS_IPC};
-
/* we need a forward declaration of the ntvfs_ops strucutre to prevent
include recursion */
-struct ntvfs_ops;
+struct ntvfs_context;
struct smbsrv_tcon {
struct smbsrv_tcon *next, *prev;
@@ -62,17 +56,13 @@ struct smbsrv_tcon {
/* the server context that this was created on */
struct smbsrv_connection *smb_conn;
- /* an array of private structures used by the active NTVFS backends */
- void **ntvfs_private_list;
-
uint16_t cnum; /* an index passed over the wire (the TID) */
int service;
- enum ntvfs_type type;
BOOL read_only;
BOOL admin_user;
- /* the NTVFS operations - see source/ntvfs/ and include/ntvfs.h for details */
- const struct ntvfs_ops *ntvfs_ops;
+ /* the NTVFS context - see source/ntvfs/ for details */
+ struct ntvfs_context *ntvfs_ctx;
/* the reported filesystem type */
char *fs_type;
@@ -93,9 +83,6 @@ struct smbsrv_request {
/* the session context is derived from the vuid */
struct smbsrv_session *session;
- /* the ntvfs chaining depth */
- int ntvfs_depth;
-
/* a set of flags to control usage of the request. See REQ_CONTROL_* */
unsigned control_flags;
diff --git a/source4/smb_server/trans2.c b/source4/smb_server/trans2.c
index 34e79061df..b8b3035286 100644
--- a/source4/smb_server/trans2.c
+++ b/source4/smb_server/trans2.c
@@ -215,7 +215,7 @@ static NTSTATUS trans2_qfsinfo(struct smbsrv_request *req, struct smb_trans2 *tr
case SMB_QFS_ALLOCATION:
fsinfo.allocation.level = RAW_QFS_ALLOCATION;
- status = req->tcon->ntvfs_ops->fsinfo(req, &fsinfo);
+ status = ntvfs_fsinfo(req, &fsinfo);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -233,7 +233,7 @@ static NTSTATUS trans2_qfsinfo(struct smbsrv_request *req, struct smb_trans2 *tr
case SMB_QFS_VOLUME:
fsinfo.volume.level = RAW_QFS_VOLUME;
- status = req->tcon->ntvfs_ops->fsinfo(req, &fsinfo);
+ status = ntvfs_fsinfo(req, &fsinfo);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -253,7 +253,7 @@ static NTSTATUS trans2_qfsinfo(struct smbsrv_request *req, struct smb_trans2 *tr
case SMB_QFS_VOLUME_INFORMATION:
fsinfo.volume_info.level = RAW_QFS_VOLUME_INFO;
- status = req->tcon->ntvfs_ops->fsinfo(req, &fsinfo);
+ status = ntvfs_fsinfo(req, &fsinfo);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -273,7 +273,7 @@ static NTSTATUS trans2_qfsinfo(struct smbsrv_request *req, struct smb_trans2 *tr
case SMB_QFS_SIZE_INFORMATION:
fsinfo.size_info.level = RAW_QFS_SIZE_INFO;
- status = req->tcon->ntvfs_ops->fsinfo(req, &fsinfo);
+ status = ntvfs_fsinfo(req, &fsinfo);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -291,7 +291,7 @@ static NTSTATUS trans2_qfsinfo(struct smbsrv_request *req, struct smb_trans2 *tr
case SMB_QFS_DEVICE_INFORMATION:
fsinfo.device_info.level = RAW_QFS_DEVICE_INFO;
- status = req->tcon->ntvfs_ops->fsinfo(req, &fsinfo);
+ status = ntvfs_fsinfo(req, &fsinfo);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -305,7 +305,7 @@ static NTSTATUS trans2_qfsinfo(struct smbsrv_request *req, struct smb_trans2 *tr
case SMB_QFS_ATTRIBUTE_INFORMATION:
fsinfo.attribute_info.level = RAW_QFS_ATTRIBUTE_INFO;
- status = req->tcon->ntvfs_ops->fsinfo(req, &fsinfo);
+ status = ntvfs_fsinfo(req, &fsinfo);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -326,7 +326,7 @@ static NTSTATUS trans2_qfsinfo(struct smbsrv_request *req, struct smb_trans2 *tr
case SMB_QFS_QUOTA_INFORMATION:
fsinfo.quota_information.level = RAW_QFS_QUOTA_INFORMATION;
- status = req->tcon->ntvfs_ops->fsinfo(req, &fsinfo);
+ status = ntvfs_fsinfo(req, &fsinfo);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -346,7 +346,7 @@ static NTSTATUS trans2_qfsinfo(struct smbsrv_request *req, struct smb_trans2 *tr
case SMB_QFS_FULL_SIZE_INFORMATION:
fsinfo.full_size_information.level = RAW_QFS_FULL_SIZE_INFORMATION;
- status = req->tcon->ntvfs_ops->fsinfo(req, &fsinfo);
+ status = ntvfs_fsinfo(req, &fsinfo);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -364,7 +364,7 @@ static NTSTATUS trans2_qfsinfo(struct smbsrv_request *req, struct smb_trans2 *tr
case SMB_QFS_OBJECTID_INFORMATION:
fsinfo.objectid_information.level = RAW_QFS_OBJECTID_INFORMATION;
- status = req->tcon->ntvfs_ops->fsinfo(req, &fsinfo);
+ status = ntvfs_fsinfo(req, &fsinfo);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -641,7 +641,7 @@ static NTSTATUS trans2_qpathinfo(struct smbsrv_request *req, struct smb_trans2 *
}
/* call the backend */
- status = req->tcon->ntvfs_ops->qpathinfo(req, &st);
+ status = ntvfs_qpathinfo(req, &st);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -677,7 +677,7 @@ static NTSTATUS trans2_qfileinfo(struct smbsrv_request *req, struct smb_trans2 *
}
/* call the backend */
- status = req->tcon->ntvfs_ops->qfileinfo(req, &st);
+ status = ntvfs_qfileinfo(req, &st);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -813,7 +813,7 @@ static NTSTATUS trans2_setfileinfo(struct smbsrv_request *req, struct smb_trans2
return status;
}
- status = req->tcon->ntvfs_ops->setfileinfo(req, &st);
+ status = ntvfs_setfileinfo(req, &st);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -852,7 +852,7 @@ static NTSTATUS trans2_setpathinfo(struct smbsrv_request *req, struct smb_trans2
return status;
}
- status = req->tcon->ntvfs_ops->setpathinfo(req, &st);
+ status = ntvfs_setpathinfo(req, &st);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -1114,7 +1114,7 @@ static NTSTATUS trans2_findfirst(struct smbsrv_request *req, struct smb_trans2 *
trans2_setup_reply(req, trans, 10, 0, 0);
/* call the backend */
- status = req->tcon->ntvfs_ops->search_first(req, &search, &state, find_callback);
+ status = ntvfs_search_first(req, &search, &state, find_callback);
if (!NT_STATUS_IS_OK(status)) {
trans2_setup_reply(req, trans, 0, 0, 0);
return status;
@@ -1175,7 +1175,7 @@ static NTSTATUS trans2_findnext(struct smbsrv_request *req, struct smb_trans2 *t
trans2_setup_reply(req, trans, 8, 0, 0);
/* call the backend */
- status = req->tcon->ntvfs_ops->search_next(req, &search, &state, find_callback);
+ status = ntvfs_search_next(req, &search, &state, find_callback);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -1196,9 +1196,12 @@ static NTSTATUS trans2_findnext(struct smbsrv_request *req, struct smb_trans2 *t
*/
static NTSTATUS trans2_backend(struct smbsrv_request *req, struct smb_trans2 *trans)
{
- if (req->tcon->ntvfs_ops->trans2 != NULL) {
- /* direct trans2 pass thru */
- return req->tcon->ntvfs_ops->trans2(req, trans);
+ NTSTATUS status;
+
+ /* direct trans2 pass thru */
+ status = ntvfs_trans2(req, trans);
+ if (!NT_STATUS_EQUAL(NT_STATUS_NOT_IMPLEMENTED, status)) {
+ return status;
}
/* must have at least one setup word */
@@ -1228,19 +1231,6 @@ static NTSTATUS trans2_backend(struct smbsrv_request *req, struct smb_trans2 *tr
return NT_STATUS_FOOBAR;
}
-
-/*
- backend for trans requests
-*/
-static NTSTATUS trans_backend(struct smbsrv_request *req, struct smb_trans2 *trans)
-{
- if (!req->tcon->ntvfs_ops->trans) {
- return NT_STATUS_NOT_IMPLEMENTED;
- }
- return req->tcon->ntvfs_ops->trans(req, trans);
-}
-
-
/****************************************************************************
Reply to an SMBtrans or SMBtrans2 request
****************************************************************************/
@@ -1308,7 +1298,7 @@ void reply_trans_generic(struct smbsrv_request *req, uint8_t command)
/* its a full request, give it to the backend */
if (command == SMBtrans) {
- status = trans_backend(req, &trans);
+ status = ntvfs_trans(req, &trans);
} else {
status = trans2_backend(req, &trans);
}