diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-17 02:55:47 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:57 -0500 |
commit | fef617c31bd4a8be09449d6bc726c729ae758423 (patch) | |
tree | 4951f62b04442e046f786b88e76dc48aac901e3f /source4/ntvfs/posix/pvfs_read.c | |
parent | f6da6a10de7d7f101f6485f4a34ef4ef5b6ab6c0 (diff) | |
download | samba-fef617c31bd4a8be09449d6bc726c729ae758423.tar.gz samba-fef617c31bd4a8be09449d6bc726c729ae758423.tar.bz2 samba-fef617c31bd4a8be09449d6bc726c729ae758423.zip |
r3012: added initial support for byte range locking in the posix vfs. This is
enough for us to pass locktest, but does not yet support lock timeouts
and some of the other esoteric features.
(This used to be commit 58a92abd88f190bc60894a68e0528e95ae33fe39)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_read.c')
-rw-r--r-- | source4/ntvfs/posix/pvfs_read.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/ntvfs/posix/pvfs_read.c b/source4/ntvfs/posix/pvfs_read.c index e0c7e0b1f2..24142a81ee 100644 --- a/source4/ntvfs/posix/pvfs_read.c +++ b/source4/ntvfs/posix/pvfs_read.c @@ -32,6 +32,7 @@ NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs, struct pvfs_state *pvfs = ntvfs->private_data; ssize_t ret; struct pvfs_file *f; + NTSTATUS status; if (rd->generic.level != RAW_READ_READX) { return NT_STATUS_NOT_SUPPORTED; @@ -43,6 +44,14 @@ NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs, return NT_STATUS_INVALID_HANDLE; } + status = pvfs_check_lock(pvfs, f, req->smbpid, + rd->readx.in.offset, + rd->readx.in.maxcnt, + READ_LOCK); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + ret = pread(f->fd, rd->readx.out.data, rd->readx.in.maxcnt, |