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"
27 NTSTATUS ntvfs_async_state_push(struct smbsrv_request *req,
29 void (*send_fn)(struct smbsrv_request *),
30 struct ntvfs_module_context *ntvfs)
32 struct ntvfs_async_state *async;
34 async = talloc_p(req, struct ntvfs_async_state);
36 return NT_STATUS_NO_MEMORY;
39 async->state = req->async_states->state;
40 async->private_data = private_data;
41 async->send_fn = send_fn;
42 async->status = NT_STATUS_INTERNAL_ERROR;
46 DLIST_ADD(req->async_states, async);
51 void ntvfs_async_state_pop(struct smbsrv_request *req)
53 struct ntvfs_async_state *async;
55 async = req->async_states;
57 DLIST_REMOVE(req->async_states, async);
59 req->async_states->state = async->state;
60 req->async_states->status = async->status;