diff options
author | Stefan Metzmacher <metze@samba.org> | 2004-09-29 13:17:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:30 -0500 |
commit | dcad0f6fd492506efd9a69b4e32c7bbfa5da90e5 (patch) | |
tree | 5dd39ae343981c37d3a735abf0cb799a86b1245b /source4/ntvfs/posix/pvfs_open.c | |
parent | cd5326a44ee1f83ff9a1d96d50b56db9a2eb0d94 (diff) | |
download | samba-dcad0f6fd492506efd9a69b4e32c7bbfa5da90e5.tar.gz samba-dcad0f6fd492506efd9a69b4e32c7bbfa5da90e5.tar.bz2 samba-dcad0f6fd492506efd9a69b4e32c7bbfa5da90e5.zip |
r2751: this is a new ntvfs design which tries to solve:
- the stacking of modules
- finding the modules private data
- hide the ntvfs details from the calling layer
- I set NTVFS_INTERFACE_VERSION 0 till we are closer to release
(because we need to solve some async problems with the module stacking)
metze
(This used to be commit 3ff03b5cb21bb79afdd3b1609be9635f6688a539)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_open.c')
-rw-r--r-- | source4/ntvfs/posix/pvfs_open.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index f3bec4085e..560d194a34 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -27,9 +27,9 @@ /* find open file handle given fnum */ -struct pvfs_file *pvfs_find_fd(struct smbsrv_request *req, uint16_t fnum) +struct pvfs_file *pvfs_find_fd(struct pvfs_state *pvfs, + struct smbsrv_request *req, uint16_t fnum) { - NTVFS_GET_PRIVATE(pvfs_state, pvfs, req); struct pvfs_file *f; for (f=pvfs->open_files;f;f=f->next) { if (f->fnum == fnum) { @@ -63,16 +63,17 @@ static int pvfs_fd_destructor(void *p) TODO: this is a temporary implementation derived from the simple backend its purpose is to allow other tests to run */ -NTSTATUS pvfs_open(struct smbsrv_request *req, union smb_open *io) +NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, union smb_open *io) { - NTVFS_GET_PRIVATE(pvfs_state, pvfs, req); + struct pvfs_state *pvfs = ntvfs->private_data; int fd, flags; struct pvfs_filename *name; struct pvfs_file *f; NTSTATUS status; if (io->generic.level != RAW_OPEN_GENERIC) { - return ntvfs_map_open(req, io, pvfs->ops); + return ntvfs_map_open(req, io, ntvfs); } /* resolve the cifs name to a posix name */ @@ -179,9 +180,10 @@ do_open: /* close a file */ -NTSTATUS pvfs_close(struct smbsrv_request *req, union smb_close *io) +NTSTATUS pvfs_close(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req, union smb_close *io) { - NTVFS_GET_PRIVATE(pvfs_state, pvfs, req); + struct pvfs_state *pvfs = ntvfs->private_data; struct pvfs_file *f; NTSTATUS status; @@ -190,7 +192,7 @@ NTSTATUS pvfs_close(struct smbsrv_request *req, union smb_close *io) return NT_STATUS_INVALID_LEVEL; } - f = pvfs_find_fd(req, io->close.in.fnum); + f = pvfs_find_fd(pvfs, req, io->close.in.fnum); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -213,9 +215,10 @@ NTSTATUS pvfs_close(struct smbsrv_request *req, union smb_close *io) /* logoff - close all file descriptors open by a vuid */ -NTSTATUS pvfs_logoff(struct smbsrv_request *req) +NTSTATUS pvfs_logoff(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req) { - NTVFS_GET_PRIVATE(pvfs_state, pvfs, req); + struct pvfs_state *pvfs = ntvfs->private_data; struct pvfs_file *f, *next; for (f=pvfs->open_files;f;f=next) { @@ -234,9 +237,10 @@ NTSTATUS pvfs_logoff(struct smbsrv_request *req) /* exit - close files for the current pid */ -NTSTATUS pvfs_exit(struct smbsrv_request *req) +NTSTATUS pvfs_exit(struct ntvfs_module_context *ntvfs, + struct smbsrv_request *req) { - NTVFS_GET_PRIVATE(pvfs_state, pvfs, req); + struct pvfs_state *pvfs = ntvfs->private_data; struct pvfs_file *f, *next; for (f=pvfs->open_files;f;f=next) { @@ -250,4 +254,3 @@ NTSTATUS pvfs_exit(struct smbsrv_request *req) return NT_STATUS_OK; } - |