From 307e43bb5628e8b53a930c2928279af994281ba5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 10 Mar 2006 20:49:20 +0000 Subject: r14173: change smb interface structures to always use a union smb_file, to abtract - const char *path fot qpathinfo and setpathinfo - uint16_t fnum for SMB - smb2_handle handle for SMB2 the idea is to later add a struct ntvfs_handle *ntvfs so that the ntvfs subsystem don't need to know the difference between SMB and SMB2 metze (This used to be commit 2ef3f5970901b5accdb50f0d0115b5d46b0c788f) --- source4/ntvfs/ntvfs_generic.c | 48 +++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'source4/ntvfs/ntvfs_generic.c') diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index 5133f63268..e373c7a28e 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -155,7 +155,7 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs, switch (io->generic.level) { case RAW_OPEN_OPEN: - io->openold.out.fnum = io2->generic.out.fnum; + io->openold.file.fnum = io2->generic.file.fnum; 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; @@ -163,7 +163,7 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs, break; case RAW_OPEN_OPENX: - io->openx.out.fnum = io2->generic.out.fnum; + io->openx.file.fnum = io2->generic.file.fnum; 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; @@ -183,7 +183,7 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs, break; case RAW_OPEN_T2OPEN: - io->t2open.out.fnum = io2->generic.out.fnum; + io->t2open.file.fnum = io2->generic.file.fnum; 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; @@ -196,14 +196,14 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs, case RAW_OPEN_MKNEW: case RAW_OPEN_CREATE: - io->mknew.out.fnum = io2->generic.out.fnum; + io->mknew.file.fnum = io2->generic.file.fnum; write_time = io->mknew.in.write_time; break; case RAW_OPEN_CTEMP: - io->ctemp.out.fnum = io2->generic.out.fnum; - io->ctemp.out.name = talloc_strdup(req, io2->generic.in.fname + - strlen(io->ctemp.in.directory) + 1); + io->ctemp.file.fnum = io2->generic.file.fnum; + 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); break; @@ -220,7 +220,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.file.fnum = io2->generic.out.fnum; + sf->generic.file.fnum = io2->generic.file.fnum; sf->standard.in.create_time = 0; sf->standard.in.write_time = write_time; sf->standard.in.access_time = 0; @@ -231,7 +231,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.file.fnum = io2->generic.out.fnum; + sf->generic.file.fnum = io2->generic.file.fnum; sf->end_of_file_info.in.size = set_size; status = ntvfs->ops->setfileinfo(ntvfs, req, sf); if (NT_STATUS_IS_OK(status)) { @@ -861,7 +861,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.fnum = info->generic.in.fnum; + info2->generic.file.fnum = info->generic.file.fnum; /* only used by the simple backend, which doesn't do async */ req->async_states->state &= ~NTVFS_ASYNC_STATE_MAY_ASYNC; @@ -894,7 +894,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_qpathinfo(struct ntvfs_module_context *ntvfs, /* ask the backend for the generic info */ info2->generic.level = RAW_FILEINFO_GENERIC; - info2->generic.in.fname = info->generic.in.fname; + info2->generic.file.path = info->generic.file.path; /* only used by the simple backend, which doesn't do async */ req->async_states->state &= ~NTVFS_ASYNC_STATE_MAY_ASYNC; @@ -943,7 +943,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs, } lck2->generic.level = RAW_LOCK_GENERIC; - lck2->generic.in.fnum = lck->lock.in.fnum; + lck2->generic.file.fnum = lck->lock.file.fnum; lck2->generic.in.mode = 0; lck2->generic.in.timeout = 0; lck2->generic.in.locks = locks; @@ -991,7 +991,7 @@ static NTSTATUS ntvfs_map_write_finish(struct ntvfs_module_context *ntvfs, } lck->unlock.level = RAW_LOCK_UNLOCK; - lck->unlock.in.fnum = wr->writeunlock.in.fnum; + lck->unlock.file.fnum = wr->writeunlock.file.fnum; lck->unlock.in.count = wr->writeunlock.in.count; lck->unlock.in.offset = wr->writeunlock.in.offset; @@ -1013,7 +1013,7 @@ static NTSTATUS ntvfs_map_write_finish(struct ntvfs_module_context *ntvfs, } cl->close.level = RAW_CLOSE_CLOSE; - cl->close.in.fnum = wr->writeclose.in.fnum; + cl->close.file.fnum = wr->writeclose.file.fnum; cl->close.in.write_time = wr->writeclose.in.mtime; if (wr2->generic.in.count != 0) { @@ -1064,7 +1064,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_write(struct ntvfs_module_context *ntvfs, break; case RAW_WRITE_WRITE: - wr2->writex.in.fnum = wr->write.in.fnum; + wr2->writex.file.fnum = wr->write.file.fnum; wr2->writex.in.offset = wr->write.in.offset; wr2->writex.in.wmode = 0; wr2->writex.in.remaining = wr->write.in.remaining; @@ -1074,7 +1074,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_write(struct ntvfs_module_context *ntvfs, break; case RAW_WRITE_WRITEUNLOCK: - wr2->writex.in.fnum = wr->writeunlock.in.fnum; + wr2->writex.file.fnum = wr->writeunlock.file.fnum; wr2->writex.in.offset = wr->writeunlock.in.offset; wr2->writex.in.wmode = 0; wr2->writex.in.remaining = wr->writeunlock.in.remaining; @@ -1084,7 +1084,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_write(struct ntvfs_module_context *ntvfs, break; case RAW_WRITE_WRITECLOSE: - wr2->writex.in.fnum = wr->writeclose.in.fnum; + wr2->writex.file.fnum = wr->writeclose.file.fnum; wr2->writex.in.offset = wr->writeclose.in.offset; wr2->writex.in.wmode = 0; wr2->writex.in.remaining = 0; @@ -1094,7 +1094,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_write(struct ntvfs_module_context *ntvfs, break; case RAW_WRITE_SPLWRITE: - wr2->writex.in.fnum = wr->splwrite.in.fnum; + wr2->writex.file.fnum = wr->splwrite.file.fnum; wr2->writex.in.offset = 0; wr2->writex.in.wmode = 0; wr2->writex.in.remaining = 0; @@ -1165,7 +1165,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_read(struct ntvfs_module_context *ntvfs, break; case RAW_READ_READ: - rd2->readx.in.fnum = rd->read.in.fnum; + rd2->readx.file.fnum = rd->read.file.fnum; rd2->readx.in.offset = rd->read.in.offset; rd2->readx.in.mincnt = rd->read.in.count; rd2->readx.in.maxcnt = rd->read.in.count; @@ -1175,7 +1175,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_read(struct ntvfs_module_context *ntvfs, break; case RAW_READ_READBRAW: - rd2->readx.in.fnum = rd->readbraw.in.fnum; + rd2->readx.file.fnum = rd->readbraw.file.fnum; rd2->readx.in.offset = rd->readbraw.in.offset; rd2->readx.in.mincnt = rd->readbraw.in.mincnt; rd2->readx.in.maxcnt = rd->readbraw.in.maxcnt; @@ -1195,13 +1195,13 @@ _PUBLIC_ NTSTATUS ntvfs_map_read(struct ntvfs_module_context *ntvfs, goto done; } lck->lock.level = RAW_LOCK_LOCK; - lck->lock.in.fnum = rd->lockread.in.fnum; + lck->lock.file.fnum = rd->lockread.file.fnum; 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.fnum = rd->lockread.in.fnum; + rd2->readx.file.fnum = rd->lockread.file.fnum; 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,8 +1238,8 @@ _PUBLIC_ NTSTATUS ntvfs_map_close(struct ntvfs_module_context *ntvfs, return NT_STATUS_INVALID_LEVEL; case RAW_CLOSE_SPLCLOSE: - cl2->close.level = RAW_CLOSE_CLOSE; - cl2->close.in.fnum = cl->splclose.in.fnum; + cl2->close.level = RAW_CLOSE_CLOSE; + cl2->close.file.fnum = cl->splclose.file.fnum; break; } -- cgit