summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-02-13 10:14:04 +1100
committerAndrew Tridgell <tridge@samba.org>2008-02-13 10:14:04 +1100
commit7714a91f6762bb8d6578d89a49bfd5672aca054c (patch)
tree60b4d72b94ecb96f95e4d8e7041bf8abe58e8fa8 /source4/ntvfs
parente94d710b0b959d8e69eb02ef0704ebcff56485fb (diff)
parent3cfac63d165f072464e93a12f7ad48450c66477b (diff)
downloadsamba-7714a91f6762bb8d6578d89a49bfd5672aca054c.tar.gz
samba-7714a91f6762bb8d6578d89a49bfd5672aca054c.tar.bz2
samba-7714a91f6762bb8d6578d89a49bfd5672aca054c.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit 11102681bcd70b0abb2df38bcdc7fdec51e71600)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/cifs/vfs_cifs.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c
index 910401f157..901dd2cf7c 100644
--- a/source4/ntvfs/cifs/vfs_cifs.c
+++ b/source4/ntvfs/cifs/vfs_cifs.c
@@ -64,12 +64,16 @@ struct async_info {
#define SETUP_PID private->tree->session->pid = req->smbpid
-#define SETUP_FILE do { \
- struct cvfs_file *f; \
+#define SETUP_FILE_HERE(f) do { \
f = ntvfs_handle_get_backend_data(io->generic.in.file.ntvfs, ntvfs); \
if (!f) return NT_STATUS_INVALID_HANDLE; \
io->generic.in.file.fnum = f->fnum; \
-} while (0)
+} while (0)
+
+#define SETUP_FILE do { \
+ struct cvfs_file *f; \
+ SETUP_FILE_HERE(f); \
+} while (0)
#define SETUP_PID_AND_FILE do { \
SETUP_PID; \
@@ -484,6 +488,7 @@ static void async_open(struct smbcli_request *c_req)
req->async_states->status = ntvfs_handle_set_backend_data(f->h, cvfs->ntvfs, f);
if (!NT_STATUS_IS_OK(req->async_states->status)) goto failed;
file->ntvfs = f->h;
+ DLIST_ADD(cvfs->files, f);
failed:
req->async_states->send_fn(req);
}
@@ -526,6 +531,7 @@ static NTSTATUS cvfs_open(struct ntvfs_module_context *ntvfs,
status = ntvfs_handle_set_backend_data(f->h, private->ntvfs, f);
NT_STATUS_NOT_OK_RETURN(status);
file->ntvfs = f->h;
+ DLIST_ADD(private->files, f);
return NT_STATUS_OK;
}
@@ -752,6 +758,7 @@ static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs,
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
+ struct cvfs_file *f;
SETUP_PID;
@@ -759,7 +766,12 @@ static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs,
private->map_generic) {
return ntvfs_map_close(ntvfs, req, io);
}
- SETUP_FILE;
+ SETUP_FILE_HERE(f);
+ /* Note, we aren't free-ing f, or it's h here. Should we?
+ even if file-close fails, we'll remove it from the list,
+ what else would we do? Maybe we should not remove until
+ after the proxied call completes? */
+ DLIST_REMOVE(private->files, f);
if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) {
return smb_raw_close(private->tree, io);