r4489: Remove an obsolete file.
[Samba/gebeck_regimport.git] / source4 / ntvfs / ntvfs_util.c
blob41e1b04d49e774e7b40b1de8b1193579a683553e
1 /*
2 Unix SMB/CIFS implementation.
3 NTVFS utility code
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
24 #include "includes.h"
25 #include "dlinklist.h"
26 #include "smb_server/smb_server.h"
29 NTSTATUS ntvfs_async_state_push(struct smbsrv_request *req,
30 void *private_data,
31 void (*send_fn)(struct smbsrv_request *),
32 struct ntvfs_module_context *ntvfs)
34 struct ntvfs_async_state *async;
36 async = talloc_p(req, struct ntvfs_async_state);
37 if (!async) {
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;
46 async->ntvfs = ntvfs;
48 DLIST_ADD(req->async_states, async);
50 return NT_STATUS_OK;
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;
64 talloc_free(async);