diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-20 08:28:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:01:57 -0500 |
commit | 20d17b80571f0d0265c99c1ccdc21910c2eed043 (patch) | |
tree | f166a82fca637eaa303b21954e6bcb8b06efe70a /source4/ntvfs/cifs | |
parent | 8050be6ea343221da9e8866d71b66103ba7fb122 (diff) | |
download | samba-20d17b80571f0d0265c99c1ccdc21910c2eed043.tar.gz samba-20d17b80571f0d0265c99c1ccdc21910c2eed043.tar.xz samba-20d17b80571f0d0265c99c1ccdc21910c2eed043.zip |
r3081: several updates to ntvfs and server side async request handling in
preparation for the full share modes and ntcreatex code that I am
working on.
highlights include:
- changed the way a backend determines if it is allowed to process a
request asynchronously. The previous method of looking at the
send_fn caused problems when an intermediate ntvfs module disabled
it, and the caller then wanted to finished processing using this
function. The new method is a REQ_CONTROL_MAY_ASYNC flag in
req->control_flags, which is also a bit easier to read
- fixed 2 bugs in the readbraw server code. One related to trying to
answer a readbraw with smb signing (which can't work, and crashed
our signing code), the second related to error handling, which
attempted to send a normal SMB error packet, when readbraw must
send a 0 read reply (as it has no header)
- added several more ntvfs_generic.c generic mapping functions. This
means that backends no longer need to implement such esoteric
functions as SMBwriteunlock() if they don't want to. The backend
can just request the mapping layer turn it into a write followed by
an unlock. This makes the backends considerably simpler as they
only need to implement one style of each function for lock, read,
write, open etc, rather than the full host of functions that SMB
provides. A backend can still choose to implement them
individually, of course, and the CIFS backend does that.
- simplified the generic structures to make them identical to the
principal call for several common SMB calls (such as
RAW_WRITE_GENERIC now being an alias for RAW_WRITE_WRITEX).
- started rewriting the pvfs_open() code in preparation for the full
ntcreatex semantics.
- in pvfs_open and ipc_open, initially allocate the open file
structure as a child of the request, so on error we don't need to
clean up. Then when we are going to succeed the open steal the
pointer into the long term backend context. This makes for much
simpler error handling (and fixes some bugs)
- use a destructor in the ipc backend to make sure that everthing is
cleaned up on receive error conditions.
- switched the ipc backend to using idtree for fnum allocation
- in the ntvfs_generic mapping routines, use a allocated secondary
structure not a stack structure to ensure the request pointer
remains valid even if the backend replies async.
(This used to be commit 3457c1836c09c82956697eb21627dfa2ed37682e)
Diffstat (limited to 'source4/ntvfs/cifs')
-rw-r--r-- | source4/ntvfs/cifs/vfs_cifs.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c index 5b10e72411..feacc063b4 100644 --- a/source4/ntvfs/cifs/vfs_cifs.c +++ b/source4/ntvfs/cifs/vfs_cifs.c @@ -214,7 +214,7 @@ static NTSTATUS cvfs_unlink(struct ntvfs_module_context *ntvfs, /* see if the front end will allow us to perform this function asynchronously. */ - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_unlink(private->tree, unl); } @@ -245,7 +245,7 @@ static NTSTATUS cvfs_ioctl(struct ntvfs_module_context *ntvfs, /* see if the front end will allow us to perform this function asynchronously. */ - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_ioctl(private->tree, req, io); } @@ -263,7 +263,7 @@ static NTSTATUS cvfs_chkpath(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_chkpath(private->tree, cp); } @@ -292,7 +292,7 @@ static NTSTATUS cvfs_qpathinfo(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_pathinfo(private->tree, req, info); } @@ -321,7 +321,7 @@ static NTSTATUS cvfs_qfileinfo(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_fileinfo(private->tree, req, info); } @@ -340,7 +340,7 @@ static NTSTATUS cvfs_setpathinfo(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_setpathinfo(private->tree, st); } @@ -370,7 +370,7 @@ static NTSTATUS cvfs_open(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_open(private->tree, req, io); } @@ -388,7 +388,7 @@ static NTSTATUS cvfs_mkdir(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_mkdir(private->tree, md); } @@ -406,7 +406,7 @@ static NTSTATUS cvfs_rmdir(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_rmdir(private->tree, rd); } c_req = smb_raw_rmdir_send(private->tree, rd); @@ -423,7 +423,7 @@ static NTSTATUS cvfs_rename(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_rename(private->tree, ren); } @@ -461,7 +461,7 @@ static NTSTATUS cvfs_read(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_read(private->tree, rd); } @@ -490,7 +490,7 @@ static NTSTATUS cvfs_write(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_write(private->tree, wr); } @@ -526,7 +526,7 @@ static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_close(private->tree, io); } @@ -544,7 +544,7 @@ static NTSTATUS cvfs_exit(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_exit(private->tree->session); } @@ -582,7 +582,7 @@ static NTSTATUS cvfs_lock(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_lock(private->tree, lck); } @@ -600,7 +600,7 @@ static NTSTATUS cvfs_setfileinfo(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_setfileinfo(private->tree, info); } c_req = smb_raw_setfileinfo_send(private->tree, info); @@ -629,7 +629,7 @@ static NTSTATUS cvfs_fsinfo(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_fsinfo(private->tree, req, fs); } @@ -698,7 +698,7 @@ static NTSTATUS cvfs_trans2(struct ntvfs_module_context *ntvfs, struct cvfs_private *private = ntvfs->private_data; struct smbcli_request *c_req; - if (!req->async.send_fn) { + if (!(req->control_flags & REQ_CONTROL_MAY_ASYNC)) { return smb_raw_trans2(private->tree, req, trans2); } |