2 Unix SMB/CIFS implementation.
4 Copyright (C) Stefan Metzmacher 2004
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 this implements common utility functions that many NTVFS backends may wish to use
25 #include "dlinklist.h"
26 #include "smb_server/smb_server.h"
29 NTSTATUS ntvfs_async_state_push(struct smbsrv_request *req,
31 void (*send_fn)(struct smbsrv_request *),
32 struct ntvfs_module_context *ntvfs)
34 struct ntvfs_async_state *async;
36 async = talloc(req, struct ntvfs_async_state);
38 return NT_STATUS_NO_MEMORY;
41 async->state = req->async_states->state;
42 async->private_data = private_data;
43 async->send_fn = send_fn;
44 async->status = NT_STATUS_INTERNAL_ERROR;
48 DLIST_ADD(req->async_states, async);
53 void ntvfs_async_state_pop(struct smbsrv_request *req)
55 struct ntvfs_async_state *async;
57 async = req->async_states;
59 DLIST_REMOVE(req->async_states, async);
61 req->async_states->state = async->state;
62 req->async_states->status = async->status;