summaryrefslogtreecommitdiff
path: root/source4/ntvfs/ntvfs_generic.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-05-20 08:15:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:10 -0500
commit9ef33f5f5c786b83311ca088357fb2f0aa72fc9e (patch)
tree66335dced1641119f94e6c656dd1ccc673218d0c /source4/ntvfs/ntvfs_generic.c
parent0dcecc314899b6f36e9215e0b3881220062ba4f9 (diff)
downloadsamba-9ef33f5f5c786b83311ca088357fb2f0aa72fc9e.tar.gz
samba-9ef33f5f5c786b83311ca088357fb2f0aa72fc9e.tar.bz2
samba-9ef33f5f5c786b83311ca088357fb2f0aa72fc9e.zip
r15734: This is a major change to the NTVFS subsystem:
- to use a struct ntvfs_handle instead of a uint16_t fnum. (to make it independend from the frontend protocol) - the allocation of handles now is provided by the frontend (smbsrv_*) via callbacks and not by each backend module - this also makes sure that file handles are only passed to the ntvfs subsystem when the tcon and session matches, so modules can rely on this and need to check this. - this allows multiple modules in the ntvfs module chain to allocate file handles. This can be used for virtual files like "\\$Extend\\$Quota:$Q:$INDEX_ALLOCATION"... - also this will make SMB2 with 128 bit file handles possible metze (This used to be commit 287fc1c22d670f6e568014b420f7f4cb31dc7958)
Diffstat (limited to 'source4/ntvfs/ntvfs_generic.c')
-rw-r--r--source4/ntvfs/ntvfs_generic.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c
index b04a3af21e..5058225ceb 100644
--- a/source4/ntvfs/ntvfs_generic.c
+++ b/source4/ntvfs/ntvfs_generic.c
@@ -153,7 +153,7 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs,
switch (io->generic.level) {
case RAW_OPEN_OPEN:
- io->openold.out.file.fnum = io2->generic.out.file.fnum;
+ io->openold.out.file.ntvfs = io2->generic.out.file.ntvfs;
io->openold.out.attrib = io2->generic.out.attrib;
io->openold.out.write_time = nt_time_to_unix(io2->generic.out.write_time);
io->openold.out.size = io2->generic.out.size;
@@ -161,7 +161,7 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs,
break;
case RAW_OPEN_OPENX:
- io->openx.out.file.fnum = io2->generic.out.file.fnum;
+ io->openx.out.file.ntvfs = io2->generic.out.file.ntvfs;
io->openx.out.attrib = io2->generic.out.attrib;
io->openx.out.write_time = nt_time_to_unix(io2->generic.out.write_time);
io->openx.out.size = io2->generic.out.size;
@@ -181,7 +181,7 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs,
break;
case RAW_OPEN_T2OPEN:
- io->t2open.out.file.fnum = io2->generic.out.file.fnum;
+ io->t2open.out.file.ntvfs = io2->generic.out.file.ntvfs;
io->t2open.out.attrib = io2->generic.out.attrib;
io->t2open.out.write_time = nt_time_to_unix(io2->generic.out.write_time);
io->t2open.out.size = io2->generic.out.size;
@@ -194,12 +194,12 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs,
case RAW_OPEN_MKNEW:
case RAW_OPEN_CREATE:
- io->mknew.out.file.fnum = io2->generic.out.file.fnum;
+ io->mknew.out.file.ntvfs= io2->generic.out.file.ntvfs;
write_time = io->mknew.in.write_time;
break;
case RAW_OPEN_CTEMP:
- io->ctemp.out.file.fnum = io2->generic.out.file.fnum;
+ io->ctemp.out.file.ntvfs= io2->generic.out.file.ntvfs;
io->ctemp.out.name = talloc_strdup(req, io2->generic.in.fname +
strlen(io->ctemp.in.directory) + 1);
NT_STATUS_HAVE_NO_MEMORY(io->ctemp.out.name);
@@ -218,7 +218,7 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs,
sf = talloc(req, union smb_setfileinfo);
NT_STATUS_HAVE_NO_MEMORY(sf);
sf->generic.level = RAW_SFILEINFO_STANDARD;
- sf->generic.in.file.fnum = io2->generic.out.file.fnum;
+ sf->generic.in.file.ntvfs = io2->generic.out.file.ntvfs;
sf->standard.in.create_time = 0;
sf->standard.in.write_time = write_time;
sf->standard.in.access_time = 0;
@@ -229,7 +229,7 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs,
sf = talloc(req, union smb_setfileinfo);
NT_STATUS_HAVE_NO_MEMORY(sf);
sf->generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
- sf->generic.in.file.fnum = io2->generic.out.file.fnum;
+ sf->generic.in.file.ntvfs = io2->generic.out.file.ntvfs;
sf->end_of_file_info.in.size = set_size;
status = ntvfs->ops->setfileinfo(ntvfs, req, sf);
if (NT_STATUS_IS_OK(status)) {
@@ -859,7 +859,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_qfileinfo(struct ntvfs_module_context *ntvfs,
/* ask the backend for the generic info */
info2->generic.level = RAW_FILEINFO_GENERIC;
- info2->generic.in.file.fnum = info->generic.in.file.fnum;
+ info2->generic.in.file.ntvfs= info->generic.in.file.ntvfs;
/* only used by the simple backend, which doesn't do async */
req->async_states->state &= ~NTVFS_ASYNC_STATE_MAY_ASYNC;
@@ -941,7 +941,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs,
}
lck2->generic.level = RAW_LOCK_GENERIC;
- lck2->generic.in.file.fnum = lck->lock.in.file.fnum;
+ lck2->generic.in.file.ntvfs= lck->lock.in.file.ntvfs;
lck2->generic.in.mode = 0;
lck2->generic.in.timeout = 0;
lck2->generic.in.locks = locks;
@@ -988,10 +988,10 @@ static NTSTATUS ntvfs_map_write_finish(struct ntvfs_module_context *ntvfs,
return NT_STATUS_NO_MEMORY;
}
- lck->unlock.level = RAW_LOCK_UNLOCK;
- lck->unlock.in.file.fnum= wr->writeunlock.in.file.fnum;
- lck->unlock.in.count = wr->writeunlock.in.count;
- lck->unlock.in.offset = wr->writeunlock.in.offset;
+ lck->unlock.level = RAW_LOCK_UNLOCK;
+ lck->unlock.in.file.ntvfs = wr->writeunlock.in.file.ntvfs;
+ lck->unlock.in.count = wr->writeunlock.in.count;
+ lck->unlock.in.offset = wr->writeunlock.in.offset;
if (lck->unlock.in.count != 0) {
/* do the lock sync for now */
@@ -1011,7 +1011,7 @@ static NTSTATUS ntvfs_map_write_finish(struct ntvfs_module_context *ntvfs,
}
cl->close.level = RAW_CLOSE_CLOSE;
- cl->close.in.file.fnum = wr->writeclose.in.file.fnum;
+ cl->close.in.file.ntvfs = wr->writeclose.in.file.ntvfs;
cl->close.in.write_time = wr->writeclose.in.mtime;
if (wr2->generic.in.count != 0) {
@@ -1062,7 +1062,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_write(struct ntvfs_module_context *ntvfs,
break;
case RAW_WRITE_WRITE:
- wr2->writex.in.file.fnum = wr->write.in.file.fnum;
+ wr2->writex.in.file.ntvfs= wr->write.in.file.ntvfs;
wr2->writex.in.offset = wr->write.in.offset;
wr2->writex.in.wmode = 0;
wr2->writex.in.remaining = wr->write.in.remaining;
@@ -1072,7 +1072,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_write(struct ntvfs_module_context *ntvfs,
break;
case RAW_WRITE_WRITEUNLOCK:
- wr2->writex.in.file.fnum = wr->writeunlock.in.file.fnum;
+ wr2->writex.in.file.ntvfs= wr->writeunlock.in.file.ntvfs;
wr2->writex.in.offset = wr->writeunlock.in.offset;
wr2->writex.in.wmode = 0;
wr2->writex.in.remaining = wr->writeunlock.in.remaining;
@@ -1082,7 +1082,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_write(struct ntvfs_module_context *ntvfs,
break;
case RAW_WRITE_WRITECLOSE:
- wr2->writex.in.file.fnum = wr->writeclose.in.file.fnum;
+ wr2->writex.in.file.ntvfs= wr->writeclose.in.file.ntvfs;
wr2->writex.in.offset = wr->writeclose.in.offset;
wr2->writex.in.wmode = 0;
wr2->writex.in.remaining = 0;
@@ -1092,7 +1092,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_write(struct ntvfs_module_context *ntvfs,
break;
case RAW_WRITE_SPLWRITE:
- wr2->writex.in.file.fnum = wr->splwrite.in.file.fnum;
+ wr2->writex.in.file.ntvfs= wr->splwrite.in.file.ntvfs;
wr2->writex.in.offset = 0;
wr2->writex.in.wmode = 0;
wr2->writex.in.remaining = 0;
@@ -1164,7 +1164,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_read(struct ntvfs_module_context *ntvfs,
break;
case RAW_READ_READ:
- rd2->readx.in.file.fnum = rd->read.in.file.fnum;
+ rd2->readx.in.file.ntvfs= rd->read.in.file.ntvfs;
rd2->readx.in.offset = rd->read.in.offset;
rd2->readx.in.mincnt = rd->read.in.count;
rd2->readx.in.maxcnt = rd->read.in.count;
@@ -1174,7 +1174,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_read(struct ntvfs_module_context *ntvfs,
break;
case RAW_READ_READBRAW:
- rd2->readx.in.file.fnum = rd->readbraw.in.file.fnum;
+ rd2->readx.in.file.ntvfs= rd->readbraw.in.file.ntvfs;
rd2->readx.in.offset = rd->readbraw.in.offset;
rd2->readx.in.mincnt = rd->readbraw.in.mincnt;
rd2->readx.in.maxcnt = rd->readbraw.in.maxcnt;
@@ -1194,13 +1194,13 @@ _PUBLIC_ NTSTATUS ntvfs_map_read(struct ntvfs_module_context *ntvfs,
goto done;
}
lck->lock.level = RAW_LOCK_LOCK;
- lck->lock.in.file.fnum = rd->lockread.in.file.fnum;
+ lck->lock.in.file.ntvfs = rd->lockread.in.file.ntvfs;
lck->lock.in.count = rd->lockread.in.count;
lck->lock.in.offset = rd->lockread.in.offset;
status = ntvfs->ops->lock(ntvfs, req, lck);
req->async_states->state = state;
- rd2->readx.in.file.fnum = rd->lockread.in.file.fnum;
+ rd2->readx.in.file.ntvfs= rd->lockread.in.file.ntvfs;
rd2->readx.in.offset = rd->lockread.in.offset;
rd2->readx.in.mincnt = rd->lockread.in.count;
rd2->readx.in.maxcnt = rd->lockread.in.count;
@@ -1238,7 +1238,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_close(struct ntvfs_module_context *ntvfs,
case RAW_CLOSE_SPLCLOSE:
cl2->close.level = RAW_CLOSE_CLOSE;
- cl2->close.in.file.fnum = cl->splclose.in.file.fnum;
+ cl2->close.in.file.ntvfs= cl->splclose.in.file.ntvfs;
break;
}