r14173: change smb interface structures to always use
[kai/samba-autobuild/.git] / source4 / ntvfs / ntvfs_interface.c
1 /* 
2    Unix SMB/CIFS implementation.
3    NTVFS interface functions
4
5    Copyright (C) Stefan (metze) Metzmacher 2004
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22 #include "includes.h"
23 #include "smb_server/smb_server.h"
24 #include "ntvfs/ntvfs.h"
25
26 /* connect/disconnect */
27 _PUBLIC_ NTSTATUS ntvfs_connect(struct ntvfs_request *req, const char *sharename)
28 {
29         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
30         if (!ntvfs->ops->connect) {
31                 return NT_STATUS_NOT_IMPLEMENTED;
32         }
33         return ntvfs->ops->connect(ntvfs, req, sharename);
34 }
35
36 _PUBLIC_ NTSTATUS ntvfs_disconnect(struct ntvfs_context *ntvfs_ctx)
37 {
38         struct ntvfs_module_context *ntvfs;
39         if (ntvfs_ctx == NULL) {
40                 return NT_STATUS_INVALID_CONNECTION;
41         }
42         ntvfs = ntvfs_ctx->modules;
43         if (!ntvfs->ops->disconnect) {
44                 return NT_STATUS_NOT_IMPLEMENTED;
45         }
46         return ntvfs->ops->disconnect(ntvfs);
47 }
48
49 /* async setup - called by a backend that wants to setup any state for
50    a async request */
51 _PUBLIC_ NTSTATUS ntvfs_async_setup(struct ntvfs_request *req, void *private)
52 {
53         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
54         if (!ntvfs->ops->async_setup) {
55                 return NT_STATUS_NOT_IMPLEMENTED;
56         }
57         return ntvfs->ops->async_setup(ntvfs, req, private);
58 }
59
60 /* filesystem operations */
61 _PUBLIC_ NTSTATUS ntvfs_fsinfo(struct ntvfs_request *req, union smb_fsinfo *fs)
62 {
63         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
64         if (!ntvfs->ops->fsinfo) {
65                 return NT_STATUS_NOT_IMPLEMENTED;
66         }
67         return ntvfs->ops->fsinfo(ntvfs, req, fs);
68 }
69
70 /* path operations */
71 _PUBLIC_ NTSTATUS ntvfs_unlink(struct ntvfs_request *req, union smb_unlink *unl)
72 {
73         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
74         if (!ntvfs->ops->unlink) {
75                 return NT_STATUS_NOT_IMPLEMENTED;
76         }
77         return ntvfs->ops->unlink(ntvfs, req, unl);
78 }
79
80 _PUBLIC_ NTSTATUS ntvfs_chkpath(struct ntvfs_request *req, union smb_chkpath *cp)
81 {
82         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
83         if (!ntvfs->ops->chkpath) {
84                 return NT_STATUS_NOT_IMPLEMENTED;
85         }
86         return ntvfs->ops->chkpath(ntvfs, req, cp);
87 }
88
89 _PUBLIC_ NTSTATUS ntvfs_qpathinfo(struct ntvfs_request *req, union smb_fileinfo *st)
90 {
91         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
92         if (!ntvfs->ops->qpathinfo) {
93                 return NT_STATUS_NOT_IMPLEMENTED;
94         }
95         return ntvfs->ops->qpathinfo(ntvfs, req, st);
96 }
97
98 _PUBLIC_ NTSTATUS ntvfs_setpathinfo(struct ntvfs_request *req, union smb_setfileinfo *st)
99 {
100         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
101         if (!ntvfs->ops->setpathinfo) {
102                 return NT_STATUS_NOT_IMPLEMENTED;
103         }
104         return ntvfs->ops->setpathinfo(ntvfs, req, st);
105 }
106
107 _PUBLIC_ NTSTATUS ntvfs_open(struct ntvfs_request *req, union smb_open *oi)
108 {
109         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
110         if (!ntvfs->ops->open) {
111                 return NT_STATUS_NOT_IMPLEMENTED;
112         }
113         return ntvfs->ops->open(ntvfs, req, oi);
114 }
115
116 _PUBLIC_ NTSTATUS ntvfs_mkdir(struct ntvfs_request *req, union smb_mkdir *md)
117 {
118         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
119         if (!ntvfs->ops->mkdir) {
120                 return NT_STATUS_NOT_IMPLEMENTED;
121         }
122         return ntvfs->ops->mkdir(ntvfs, req, md);
123 }
124
125 _PUBLIC_ NTSTATUS ntvfs_rmdir(struct ntvfs_request *req, struct smb_rmdir *rd)
126 {
127         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
128         if (!ntvfs->ops->rmdir) {
129                 return NT_STATUS_NOT_IMPLEMENTED;
130         }
131         return ntvfs->ops->rmdir(ntvfs, req, rd);
132 }
133
134 _PUBLIC_ NTSTATUS ntvfs_rename(struct ntvfs_request *req, union smb_rename *ren)
135 {
136         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
137         if (!ntvfs->ops->rename) {
138                 return NT_STATUS_NOT_IMPLEMENTED;
139         }
140         return ntvfs->ops->rename(ntvfs, req, ren);
141 }
142
143 _PUBLIC_ NTSTATUS ntvfs_copy(struct ntvfs_request *req, struct smb_copy *cp)
144 {
145         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
146         if (!ntvfs->ops->copy) {
147                 return NT_STATUS_NOT_IMPLEMENTED;
148         }
149         return ntvfs->ops->copy(ntvfs, req, cp);
150 }
151
152 /* directory search */
153 _PUBLIC_ NTSTATUS ntvfs_search_first(struct ntvfs_request *req, union smb_search_first *io, void *private,
154                                      BOOL ntvfs_callback(void *private, union smb_search_data *file))
155 {
156         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
157         if (!ntvfs->ops->search_first) {
158                 return NT_STATUS_NOT_IMPLEMENTED;
159         }
160         return ntvfs->ops->search_first(ntvfs, req, io, private, ntvfs_callback);
161 }
162
163 _PUBLIC_ NTSTATUS ntvfs_search_next(struct ntvfs_request *req, union smb_search_next *io, void *private,
164                                     BOOL ntvfs_callback(void *private, union smb_search_data *file))
165 {
166         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
167         if (!ntvfs->ops->search_next) {
168                 return NT_STATUS_NOT_IMPLEMENTED;
169         }
170         return ntvfs->ops->search_next(ntvfs, req, io, private, ntvfs_callback);
171 }
172
173 _PUBLIC_ NTSTATUS ntvfs_search_close(struct ntvfs_request *req, union smb_search_close *io)
174 {
175         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
176         if (!ntvfs->ops->search_close) {
177                 return NT_STATUS_NOT_IMPLEMENTED;
178         }
179         return ntvfs->ops->search_close(ntvfs, req, io);
180 }
181
182 /* operations on open files */
183 _PUBLIC_ NTSTATUS ntvfs_ioctl(struct ntvfs_request *req, union smb_ioctl *io)
184 {
185         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
186         if (!ntvfs->ops->ioctl) {
187                 return NT_STATUS_NOT_IMPLEMENTED;
188         }
189         return ntvfs->ops->ioctl(ntvfs, req, io);
190 }
191
192 _PUBLIC_ NTSTATUS ntvfs_read(struct ntvfs_request *req, union smb_read *io)
193 {
194         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
195         if (!ntvfs->ops->read) {
196                 return NT_STATUS_NOT_IMPLEMENTED;
197         }
198         return ntvfs->ops->read(ntvfs, req, io);
199 }
200
201 _PUBLIC_ NTSTATUS ntvfs_write(struct ntvfs_request *req, union smb_write *io)
202 {
203         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
204         if (!ntvfs->ops->write) {
205                 return NT_STATUS_NOT_IMPLEMENTED;
206         }
207         return ntvfs->ops->write(ntvfs, req, io);
208 }
209
210 _PUBLIC_ NTSTATUS ntvfs_seek(struct ntvfs_request *req, union smb_seek *io)
211 {
212         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
213         if (!ntvfs->ops->seek) {
214                 return NT_STATUS_NOT_IMPLEMENTED;
215         }
216         return ntvfs->ops->seek(ntvfs, req, io);
217 }
218
219 _PUBLIC_ NTSTATUS ntvfs_flush(struct ntvfs_request *req,
220                               union smb_flush *flush)
221 {
222         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
223         if (!ntvfs->ops->flush) {
224                 return NT_STATUS_NOT_IMPLEMENTED;
225         }
226         return ntvfs->ops->flush(ntvfs, req, flush);
227 }
228
229 _PUBLIC_ NTSTATUS ntvfs_lock(struct ntvfs_request *req, union smb_lock *lck)
230 {
231         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
232         if (!ntvfs->ops->lock) {
233                 return NT_STATUS_NOT_IMPLEMENTED;
234         }
235         return ntvfs->ops->lock(ntvfs, req, lck);
236 }
237
238 _PUBLIC_ NTSTATUS ntvfs_qfileinfo(struct ntvfs_request *req, union smb_fileinfo *info)
239 {
240         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
241         if (!ntvfs->ops->qfileinfo) {
242                 return NT_STATUS_NOT_IMPLEMENTED;
243         }
244         return ntvfs->ops->qfileinfo(ntvfs, req, info);
245 }
246
247 _PUBLIC_ NTSTATUS ntvfs_setfileinfo(struct ntvfs_request *req, union smb_setfileinfo *info)
248 {
249         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
250         if (!ntvfs->ops->setfileinfo) {
251                 return NT_STATUS_NOT_IMPLEMENTED;
252         }
253         return ntvfs->ops->setfileinfo(ntvfs, req, info);
254 }
255
256 _PUBLIC_ NTSTATUS ntvfs_close(struct ntvfs_request *req, union smb_close *io)
257 {
258         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
259         if (!ntvfs->ops->close) {
260                 return NT_STATUS_NOT_IMPLEMENTED;
261         }
262         return ntvfs->ops->close(ntvfs, req, io);
263 }
264
265 /* trans interface - used by IPC backend for pipes and RAP calls */
266 _PUBLIC_ NTSTATUS ntvfs_trans(struct ntvfs_request *req, struct smb_trans2 *trans)
267 {
268         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
269         if (!ntvfs->ops->trans) {
270                 return NT_STATUS_NOT_IMPLEMENTED;
271         }
272         return ntvfs->ops->trans(ntvfs, req, trans);
273 }
274
275 /* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
276 _PUBLIC_ NTSTATUS ntvfs_trans2(struct ntvfs_request *req, struct smb_trans2 *trans2)
277 {
278         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
279         if (!ntvfs->ops->trans2) {
280                 return NT_STATUS_NOT_IMPLEMENTED;
281         }
282         return ntvfs->ops->trans2(ntvfs, req, trans2);
283 }
284
285 /* printing specific operations */
286 _PUBLIC_ NTSTATUS ntvfs_lpq(struct ntvfs_request *req, union smb_lpq *lpq)
287 {
288         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
289         if (!ntvfs->ops->lpq) {
290                 return NT_STATUS_NOT_IMPLEMENTED;
291         }
292         return ntvfs->ops->lpq(ntvfs, req, lpq);
293 }
294
295 /* logoff - called when a vuid is closed */
296 _PUBLIC_ NTSTATUS ntvfs_logoff(struct ntvfs_request *req)
297 {
298         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
299         if (!ntvfs->ops->logoff) {
300                 return NT_STATUS_NOT_IMPLEMENTED;
301         }
302         return ntvfs->ops->logoff(ntvfs, req);
303 }
304
305 _PUBLIC_ NTSTATUS ntvfs_exit(struct ntvfs_request *req)
306 {
307         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
308         if (!ntvfs->ops->exit) {
309                 return NT_STATUS_NOT_IMPLEMENTED;
310         }
311         return ntvfs->ops->exit(ntvfs, req);
312 }
313
314 /*
315   change notify request
316 */
317 _PUBLIC_ NTSTATUS ntvfs_notify(struct ntvfs_request *req, union smb_notify *info)
318 {
319         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
320         if (!ntvfs->ops->notify) {
321                 return NT_STATUS_NOT_IMPLEMENTED;
322         }
323         return ntvfs->ops->notify(ntvfs, req, info);
324 }
325
326 /*
327   cancel an outstanding async request
328 */
329 _PUBLIC_ NTSTATUS ntvfs_cancel(struct ntvfs_request *req)
330 {
331         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
332         if (!ntvfs->ops->cancel) {
333                 return NT_STATUS_NOT_IMPLEMENTED;
334         }
335         return ntvfs->ops->cancel(ntvfs, req);
336 }
337
338 /* initial setup */
339 _PUBLIC_ NTSTATUS ntvfs_next_connect(struct ntvfs_module_context *ntvfs, 
340                                      struct ntvfs_request *req, const char *sharename)
341 {
342         if (!ntvfs->next || !ntvfs->next->ops->connect) {
343                 return NT_STATUS_NOT_IMPLEMENTED;
344         }
345         return ntvfs->next->ops->connect(ntvfs->next, req, sharename);
346 }
347
348 _PUBLIC_ NTSTATUS ntvfs_next_disconnect(struct ntvfs_module_context *ntvfs)
349 {
350         if (!ntvfs->next || !ntvfs->next->ops->disconnect) {
351                 return NT_STATUS_NOT_IMPLEMENTED;
352         }
353         return ntvfs->next->ops->disconnect(ntvfs->next);
354 }
355
356 /* async_setup - called when setting up for a async request */
357 _PUBLIC_ NTSTATUS ntvfs_next_async_setup(struct ntvfs_module_context *ntvfs, 
358                                          struct ntvfs_request *req, 
359                                          void *private)
360 {
361         if (!ntvfs->next || !ntvfs->next->ops->async_setup) {
362                 return NT_STATUS_NOT_IMPLEMENTED;
363         }
364         return ntvfs->next->ops->async_setup(ntvfs->next, req, private);
365 }
366
367 /* filesystem operations */
368 _PUBLIC_ NTSTATUS ntvfs_next_fsinfo(struct ntvfs_module_context *ntvfs, 
369                                     struct ntvfs_request *req,
370                                     union smb_fsinfo *fs)
371 {
372         if (!ntvfs->next || !ntvfs->next->ops->fsinfo) {
373                 return NT_STATUS_NOT_IMPLEMENTED;
374         }
375         return ntvfs->next->ops->fsinfo(ntvfs->next, req, fs);
376 }
377
378 /* path operations */
379 _PUBLIC_ NTSTATUS ntvfs_next_unlink(struct ntvfs_module_context *ntvfs, 
380                                     struct ntvfs_request *req,
381                                     union smb_unlink *unl)
382 {
383         if (!ntvfs->next || !ntvfs->next->ops->unlink) {
384                 return NT_STATUS_NOT_IMPLEMENTED;
385         }
386         return ntvfs->next->ops->unlink(ntvfs->next, req, unl);
387 }
388
389 _PUBLIC_ NTSTATUS ntvfs_next_chkpath(struct ntvfs_module_context *ntvfs, 
390                                      struct ntvfs_request *req,
391                                      union smb_chkpath *cp)
392 {
393         if (!ntvfs->next || !ntvfs->next->ops->chkpath) {
394                 return NT_STATUS_NOT_IMPLEMENTED;
395         }
396         return ntvfs->next->ops->chkpath(ntvfs->next, req, cp);
397 }
398
399 _PUBLIC_ NTSTATUS ntvfs_next_qpathinfo(struct ntvfs_module_context *ntvfs, 
400                                        struct ntvfs_request *req,
401                                        union smb_fileinfo *st)
402 {
403         if (!ntvfs->next || !ntvfs->next->ops->qpathinfo) {
404                 return NT_STATUS_NOT_IMPLEMENTED;
405         }
406         return ntvfs->next->ops->qpathinfo(ntvfs->next, req, st);
407 }
408
409 _PUBLIC_ NTSTATUS ntvfs_next_setpathinfo(struct ntvfs_module_context *ntvfs, 
410                                          struct ntvfs_request *req,
411                                          union smb_setfileinfo *st)
412 {
413         if (!ntvfs->next || !ntvfs->next->ops->setpathinfo) {
414                 return NT_STATUS_NOT_IMPLEMENTED;
415         }
416         return ntvfs->next->ops->setpathinfo(ntvfs->next, req, st);
417 }
418
419 _PUBLIC_ NTSTATUS ntvfs_next_mkdir(struct ntvfs_module_context *ntvfs, 
420                                    struct ntvfs_request *req,
421                                    union smb_mkdir *md)
422 {
423         if (!ntvfs->next || !ntvfs->next->ops->mkdir) {
424                 return NT_STATUS_NOT_IMPLEMENTED;
425         }
426         return ntvfs->next->ops->mkdir(ntvfs->next, req, md);
427 }
428
429 _PUBLIC_ NTSTATUS ntvfs_next_rmdir(struct ntvfs_module_context *ntvfs, 
430                                    struct ntvfs_request *req,
431                                    struct smb_rmdir *rd)
432 {
433         if (!ntvfs->next || !ntvfs->next->ops->rmdir) {
434                 return NT_STATUS_NOT_IMPLEMENTED;
435         }
436         return ntvfs->next->ops->rmdir(ntvfs->next, req, rd);
437 }
438
439 _PUBLIC_ NTSTATUS ntvfs_next_rename(struct ntvfs_module_context *ntvfs, 
440                                     struct ntvfs_request *req,
441                                     union smb_rename *ren)
442 {
443         if (!ntvfs->next || !ntvfs->next->ops->rename) {
444                 return NT_STATUS_NOT_IMPLEMENTED;
445         }
446         return ntvfs->next->ops->rename(ntvfs->next, req, ren);
447 }
448
449 _PUBLIC_ NTSTATUS ntvfs_next_copy(struct ntvfs_module_context *ntvfs, 
450                                   struct ntvfs_request *req,
451                                   struct smb_copy *cp)
452 {
453         if (!ntvfs->next || !ntvfs->next->ops->copy) {
454                 return NT_STATUS_NOT_IMPLEMENTED;
455         }
456         return ntvfs->next->ops->copy(ntvfs->next, req, cp);
457 }
458
459 _PUBLIC_ NTSTATUS ntvfs_next_open(struct ntvfs_module_context *ntvfs, 
460                                   struct ntvfs_request *req,
461                                   union smb_open *oi)
462 {
463         if (!ntvfs->next || !ntvfs->next->ops->open) {
464                 return NT_STATUS_NOT_IMPLEMENTED;
465         }
466         return ntvfs->next->ops->open(ntvfs->next, req, oi);
467 }
468
469
470 /* directory search */
471 _PUBLIC_ NTSTATUS ntvfs_next_search_first(struct ntvfs_module_context *ntvfs, 
472                                           struct ntvfs_request *req,
473                                           union smb_search_first *io, void *private,
474                                           BOOL (*callback)(void *private, union smb_search_data *file))
475 {
476         if (!ntvfs->next || !ntvfs->next->ops->search_first) {
477                 return NT_STATUS_NOT_IMPLEMENTED;
478         }
479         return ntvfs->next->ops->search_first(ntvfs->next, req, io, private, callback);
480 }
481
482 _PUBLIC_ NTSTATUS ntvfs_next_search_next(struct ntvfs_module_context *ntvfs, 
483                                          struct ntvfs_request *req,
484                                          union smb_search_next *io, void *private,
485                                          BOOL (*callback)(void *private, union smb_search_data *file))
486 {
487         if (!ntvfs->next || !ntvfs->next->ops->search_next) {
488                 return NT_STATUS_NOT_IMPLEMENTED;
489         }
490         return ntvfs->next->ops->search_next(ntvfs->next, req, io, private, callback);
491 }
492
493 _PUBLIC_ NTSTATUS ntvfs_next_search_close(struct ntvfs_module_context *ntvfs, 
494                                           struct ntvfs_request *req,
495                                           union smb_search_close *io)
496 {
497         if (!ntvfs->next || !ntvfs->next->ops->search_close) {
498                 return NT_STATUS_NOT_IMPLEMENTED;
499         }
500         return ntvfs->next->ops->search_close(ntvfs->next, req, io);
501 }
502
503 /* operations on open files */
504 _PUBLIC_ NTSTATUS ntvfs_next_ioctl(struct ntvfs_module_context *ntvfs, 
505                                    struct ntvfs_request *req,
506                                    union smb_ioctl *io)
507 {
508         if (!ntvfs->next || !ntvfs->next->ops->ioctl) {
509                 return NT_STATUS_NOT_IMPLEMENTED;
510         }
511         return ntvfs->next->ops->ioctl(ntvfs->next, req, io);
512 }
513
514 _PUBLIC_ NTSTATUS ntvfs_next_read(struct ntvfs_module_context *ntvfs, 
515                                   struct ntvfs_request *req,
516                                   union smb_read *io)
517 {
518         if (!ntvfs->next || !ntvfs->next->ops->read) {
519                 return NT_STATUS_NOT_IMPLEMENTED;
520         }
521         return ntvfs->next->ops->read(ntvfs->next, req, io);
522 }
523
524 _PUBLIC_ NTSTATUS ntvfs_next_write(struct ntvfs_module_context *ntvfs, 
525                                    struct ntvfs_request *req,
526                                    union smb_write *io)
527 {
528         if (!ntvfs->next || !ntvfs->next->ops->write) {
529                 return NT_STATUS_NOT_IMPLEMENTED;
530         }
531         return ntvfs->next->ops->write(ntvfs->next, req, io);
532 }
533
534 _PUBLIC_ NTSTATUS ntvfs_next_seek(struct ntvfs_module_context *ntvfs, 
535                                   struct ntvfs_request *req,
536                                   union smb_seek *io)
537 {
538         if (!ntvfs->next || !ntvfs->next->ops->seek) {
539                 return NT_STATUS_NOT_IMPLEMENTED;
540         }
541         return ntvfs->next->ops->seek(ntvfs->next, req, io);
542 }
543
544 _PUBLIC_ NTSTATUS ntvfs_next_flush(struct ntvfs_module_context *ntvfs, 
545                                    struct ntvfs_request *req,
546                                    union smb_flush *flush)
547 {
548         if (!ntvfs->next || !ntvfs->next->ops->flush) {
549                 return NT_STATUS_NOT_IMPLEMENTED;
550         }
551         return ntvfs->next->ops->flush(ntvfs->next, req, flush);
552 }
553
554 _PUBLIC_ NTSTATUS ntvfs_next_lock(struct ntvfs_module_context *ntvfs, 
555                                   struct ntvfs_request *req,
556                                   union smb_lock *lck)
557 {
558         if (!ntvfs->next || !ntvfs->next->ops->lock) {
559                 return NT_STATUS_NOT_IMPLEMENTED;
560         }
561         return ntvfs->next->ops->lock(ntvfs->next, req, lck);
562 }
563
564 _PUBLIC_ NTSTATUS ntvfs_next_qfileinfo(struct ntvfs_module_context *ntvfs, 
565                                        struct ntvfs_request *req,
566                                        union smb_fileinfo *info)
567 {
568         if (!ntvfs->next || !ntvfs->next->ops->qfileinfo) {
569                 return NT_STATUS_NOT_IMPLEMENTED;
570         }
571         return ntvfs->next->ops->qfileinfo(ntvfs->next, req, info);
572 }
573
574 _PUBLIC_ NTSTATUS ntvfs_next_setfileinfo(struct ntvfs_module_context *ntvfs, 
575                                          struct ntvfs_request *req,
576                                          union smb_setfileinfo *info)
577 {
578         if (!ntvfs->next || !ntvfs->next->ops->setfileinfo) {
579                 return NT_STATUS_NOT_IMPLEMENTED;
580         }
581         return ntvfs->next->ops->setfileinfo(ntvfs->next, req, info);
582 }
583
584 _PUBLIC_ NTSTATUS ntvfs_next_close(struct ntvfs_module_context *ntvfs, 
585                                    struct ntvfs_request *req,
586                                    union smb_close *io)
587 {
588         if (!ntvfs->next || !ntvfs->next->ops->close) {
589                 return NT_STATUS_NOT_IMPLEMENTED;
590         }
591         return ntvfs->next->ops->close(ntvfs->next, req, io);
592 }
593
594 /* trans interface - used by IPC backend for pipes and RAP calls */
595 _PUBLIC_ NTSTATUS ntvfs_next_trans(struct ntvfs_module_context *ntvfs, 
596                                    struct ntvfs_request *req,
597                                    struct smb_trans2 *trans)
598 {
599         if (!ntvfs->next || !ntvfs->next->ops->trans) {
600                 return NT_STATUS_NOT_IMPLEMENTED;
601         }
602         return ntvfs->next->ops->trans(ntvfs->next, req, trans);
603 }
604
605 /* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
606 _PUBLIC_ NTSTATUS ntvfs_next_trans2(struct ntvfs_module_context *ntvfs, 
607                                     struct ntvfs_request *req,
608                                     struct smb_trans2 *trans2)
609 {
610         if (!ntvfs->next || !ntvfs->next->ops->trans2) {
611                 return NT_STATUS_NOT_IMPLEMENTED;
612         }
613         return ntvfs->next->ops->trans2(ntvfs->next, req, trans2);
614 }
615
616 /*
617   change notify request
618 */
619 _PUBLIC_ NTSTATUS ntvfs_next_notify(struct ntvfs_module_context *ntvfs,
620                                     struct ntvfs_request *req,
621                                     union smb_notify *info)
622 {
623         if (!ntvfs->next || !ntvfs->next->ops->notify) {
624                 return NT_STATUS_NOT_IMPLEMENTED;
625         }
626         return ntvfs->next->ops->notify(ntvfs, req, info);
627 }
628
629 /* cancel - called to cancel an outstanding async request */
630 _PUBLIC_ NTSTATUS ntvfs_next_cancel(struct ntvfs_module_context *ntvfs, 
631                                     struct ntvfs_request *req)
632 {
633         if (!ntvfs->next || !ntvfs->next->ops->cancel) {
634                 return NT_STATUS_NOT_IMPLEMENTED;
635         }
636         return ntvfs->next->ops->cancel(ntvfs->next, req);
637 }
638
639 /* printing specific operations */
640 _PUBLIC_ NTSTATUS ntvfs_next_lpq(struct ntvfs_module_context *ntvfs, 
641                                  struct ntvfs_request *req,
642                                  union smb_lpq *lpq)
643 {
644         if (!ntvfs->next || !ntvfs->next->ops->lpq) {
645                 return NT_STATUS_NOT_IMPLEMENTED;
646         }
647         return ntvfs->next->ops->lpq(ntvfs->next, req, lpq);
648 }
649
650
651 /* logoff - called when a vuid is closed */
652 _PUBLIC_ NTSTATUS ntvfs_next_logoff(struct ntvfs_module_context *ntvfs, 
653                                     struct ntvfs_request *req)
654 {
655         if (!ntvfs->next || !ntvfs->next->ops->logoff) {
656                 return NT_STATUS_NOT_IMPLEMENTED;
657         }
658         return ntvfs->next->ops->logoff(ntvfs->next, req);
659 }
660
661 _PUBLIC_ NTSTATUS ntvfs_next_exit(struct ntvfs_module_context *ntvfs, 
662                                   struct ntvfs_request *req)
663 {
664         if (!ntvfs->next || !ntvfs->next->ops->exit) {
665                 return NT_STATUS_NOT_IMPLEMENTED;
666         }
667         return ntvfs->next->ops->exit(ntvfs->next, req);
668 }