summaryrefslogtreecommitdiff
path: root/source4/ntvfs/ntvfs.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-05-20 08:15:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:10 -0500
commit9ef33f5f5c786b83311ca088357fb2f0aa72fc9e (patch)
tree66335dced1641119f94e6c656dd1ccc673218d0c /source4/ntvfs/ntvfs.h
parent0dcecc314899b6f36e9215e0b3881220062ba4f9 (diff)
downloadsamba-9ef33f5f5c786b83311ca088357fb2f0aa72fc9e.tar.gz
samba-9ef33f5f5c786b83311ca088357fb2f0aa72fc9e.tar.bz2
samba-9ef33f5f5c786b83311ca088357fb2f0aa72fc9e.zip
r15734: This is a major change to the NTVFS subsystem:
- to use a struct ntvfs_handle instead of a uint16_t fnum. (to make it independend from the frontend protocol) - the allocation of handles now is provided by the frontend (smbsrv_*) via callbacks and not by each backend module - this also makes sure that file handles are only passed to the ntvfs subsystem when the tcon and session matches, so modules can rely on this and need to check this. - this allows multiple modules in the ntvfs module chain to allocate file handles. This can be used for virtual files like "\\$Extend\\$Quota:$Q:$INDEX_ALLOCATION"... - also this will make SMB2 with 128 bit file handles possible metze (This used to be commit 287fc1c22d670f6e568014b420f7f4cb31dc7958)
Diffstat (limited to 'source4/ntvfs/ntvfs.h')
-rw-r--r--source4/ntvfs/ntvfs.h38
1 files changed, 36 insertions, 2 deletions
diff --git a/source4/ntvfs/ntvfs.h b/source4/ntvfs/ntvfs.h
index 9069e6c2ac..cf541de81e 100644
--- a/source4/ntvfs/ntvfs.h
+++ b/source4/ntvfs/ntvfs.h
@@ -191,7 +191,7 @@ struct ntvfs_context {
struct {
void *private_data;
- NTSTATUS (*handler)(void *private_data, uint16_t fnum, uint8_t level);
+ NTSTATUS (*handler)(void *private_data, struct ntvfs_handle *handle, uint8_t level);
} oplock;
struct {
@@ -199,8 +199,16 @@ struct ntvfs_context {
struct socket_address *(*get_my_addr)(void *private_data, TALLOC_CTX *mem_ctx);
struct socket_address *(*get_peer_addr)(void *private_data, TALLOC_CTX *mem_ctx);
} client;
-};
+ struct {
+ void *private_data;
+ NTSTATUS (*create_new)(void *private_data, struct ntvfs_request *req, struct ntvfs_handle **h);
+ NTSTATUS (*make_valid)(void *private_data, struct ntvfs_handle *h);
+ void (*destroy)(void *private_data, struct ntvfs_handle *h);
+ struct ntvfs_handle *(*search_by_wire_key)(void *private_data, struct ntvfs_request *req, const DATA_BLOB *key);
+ DATA_BLOB (*get_wire_key)(void *private_data, struct ntvfs_handle *handle, TALLOC_CTX *mem_ctx);
+ } handles;
+};
/* a set of flags to control handling of request structures */
#define NTVFS_ASYNC_STATE_ASYNC (1<<1) /* the backend will answer this one later */
@@ -253,6 +261,28 @@ struct ntvfs_request {
/* the system time when the request arrived */
struct timeval request_time;
} statistics;
+
+ struct {
+ void *private_data;
+ } frontend_data;
+};
+
+struct ntvfs_handle {
+ struct ntvfs_context *ctx;
+
+ struct auth_session_info *session_info;
+
+ uint16_t smbpid;
+
+ struct ntvfs_handle_data {
+ struct ntvfs_handle_data *prev, *next;
+ struct ntvfs_module_context *owner;
+ void *private_data;/* this must be a valid talloc pointer */
+ } *backend_data;
+
+ struct {
+ void *private_data;
+ } frontend_data;
};
/* this structure is used by backends to determine the size of some critical types */
@@ -264,6 +294,8 @@ struct ntvfs_critical_sizes {
int sizeof_ntvfs_ops;
int sizeof_ntvfs_async_state;
int sizeof_ntvfs_request;
+ int sizeof_ntvfs_handle;
+ int sizeof_ntvfs_handle_data;
};
#define NTVFS_CURRENT_CRITICAL_SIZES(c) \
@@ -275,6 +307,8 @@ struct ntvfs_critical_sizes {
.sizeof_ntvfs_ops = sizeof(struct ntvfs_ops), \
.sizeof_ntvfs_async_state = sizeof(struct ntvfs_async_state), \
.sizeof_ntvfs_request = sizeof(struct ntvfs_request), \
+ .sizeof_ntvfs_handle = sizeof(struct ntvfs_handle), \
+ .sizeof_ntvfs_handle_data = sizeof(struct ntvfs_handle_data), \
}
struct messaging_context;