diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-03-08 03:54:24 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:52:36 -0500 |
commit | 0ad70bfd83b4a03c0e67f11f63822b833be67aa1 (patch) | |
tree | ead5b392ef17d4072d64a694d3681ecbd1213361 /source/ntvfs/cifs | |
parent | e8075e6a062ce5edb84485e45d0b841c2ee2af7d (diff) | |
download | samba-0ad70bfd83b4a03c0e67f11f63822b833be67aa1.tar.gz |
r14011: - added a ntvfs_notify op to allow backends to support change notify
- converted the nttrans server side code to be async (needed for change notify)
This is the start of some work on supporting change notify via a new
approach. More soon.
Diffstat (limited to 'source/ntvfs/cifs')
-rw-r--r-- | source/ntvfs/cifs/vfs_cifs.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/ntvfs/cifs/vfs_cifs.c b/source/ntvfs/cifs/vfs_cifs.c index 138c9d566ff..44d4d069e8f 100644 --- a/source/ntvfs/cifs/vfs_cifs.c +++ b/source/ntvfs/cifs/vfs_cifs.c @@ -838,6 +838,36 @@ static NTSTATUS cvfs_trans(struct ntvfs_module_context *ntvfs, } /* + a handler for async change notify replies + */ +static void async_changenotify(struct smbcli_request *c_req) +{ + struct async_info *async = c_req->async.private; + struct smbsrv_request *req = async->req; + req->async_states->status = smb_raw_changenotify_recv(c_req, req, async->parms); + req->async_states->send_fn(req); +} + +/* change notify request - always async */ +static NTSTATUS cvfs_notify(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, struct smb_notify *info) +{ + struct cvfs_private *private = ntvfs->private_data; + struct smbcli_request *c_req; + + SETUP_PID; + + /* this request doesn't make sense unless its async */ + if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { + return NT_STATUS_INVALID_PARAMETER; + } + + c_req = smb_raw_changenotify_send(private->tree, info); + + ASYNC_RECV_TAIL(info, async_changenotify); +} + +/* initialise the CIFS->CIFS backend, registering ourselves with the ntvfs subsystem */ NTSTATUS ntvfs_cifs_init(void) @@ -882,6 +912,7 @@ NTSTATUS ntvfs_cifs_init(void) ops.logoff = cvfs_logoff; ops.async_setup = cvfs_async_setup; ops.cancel = cvfs_cancel; + ops.notify = cvfs_notify; if (lp_parm_bool(-1, "cifs", "maptrans2", False)) { ops.trans2 = cvfs_trans2; |