diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-01-13 12:10:48 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-01-13 12:10:48 +0000 |
commit | 826446ddef1ef0f462c02932d11e3713f00497c7 (patch) | |
tree | dc50881b2f2d2e9c54e13c99bf7642f483a66990 /source3/smbd/reply.c | |
parent | 6c2a1fdf360a8fcb100543fdb994860fe6268102 (diff) | |
download | samba-826446ddef1ef0f462c02932d11e3713f00497c7.tar.gz samba-826446ddef1ef0f462c02932d11e3713f00497c7.tar.bz2 samba-826446ddef1ef0f462c02932d11e3713f00497c7.zip |
changes to reflect the new syntax of the locking calls.
(This used to be commit 44117df2c908d473b3e1a1020b22af6d584809ef)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r-- | source3/smbd/reply.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index aa7e95294d..1e90ff4c4f 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2129,7 +2129,7 @@ int reply_readbraw(connection_struct *conn, char *inbuf, char *outbuf, int dum_s maxcount = MIN(65535,maxcount); maxcount = MAX(mincount,maxcount); - if (!is_locked(fsp,conn,maxcount,startpos, F_RDLCK)) + if (!is_locked(fsp,conn,maxcount,startpos, READ_LOCK)) { SMB_OFF_T size = fsp->size; SMB_OFF_T sizeneeded = startpos + maxcount; @@ -2227,7 +2227,7 @@ int reply_lockread(connection_struct *conn, char *inbuf,char *outbuf, int length * for a write lock. JRA. */ - if(!do_lock( fsp, conn, numtoread, startpos, F_WRLCK, &eclass, &ecode)) { + if(!do_lock( fsp, conn, numtoread, startpos, WRITE_LOCK, &eclass, &ecode)) { if((ecode == ERRlock) && lp_blocking_locks(SNUM(conn))) { /* * A blocking lock was requested. Package up @@ -2281,7 +2281,7 @@ int reply_read(connection_struct *conn, char *inbuf,char *outbuf, int size, int numtoread = MIN(BUFFER_SIZE-outsize,numtoread); data = smb_buf(outbuf) + 3; - if (is_locked(fsp,conn,numtoread,startpos, F_RDLCK)) + if (is_locked(fsp,conn,numtoread,startpos, READ_LOCK)) return(ERROR(ERRDOS,ERRlock)); if (numtoread > 0) @@ -2349,7 +2349,7 @@ int reply_read_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt } - if (is_locked(fsp,conn,smb_maxcnt,startpos, F_RDLCK)) + if (is_locked(fsp,conn,smb_maxcnt,startpos, READ_LOCK)) return(ERROR(ERRDOS,ERRlock)); nread = read_file(fsp,data,startpos,smb_maxcnt); @@ -2404,7 +2404,7 @@ int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int size, CVAL(inbuf,smb_com) = SMBwritec; CVAL(outbuf,smb_com) = SMBwritec; - if (is_locked(fsp,conn,tcount,startpos, F_WRLCK)) + if (is_locked(fsp,conn,tcount,startpos, WRITE_LOCK)) return(ERROR(ERRDOS,ERRlock)); if (numtowrite>0) @@ -2490,7 +2490,7 @@ int reply_writeunlock(connection_struct *conn, char *inbuf,char *outbuf, int siz startpos = IVAL(inbuf,smb_vwv2); data = smb_buf(inbuf) + 3; - if (is_locked(fsp,conn,numtowrite,startpos, F_WRLCK)) + if (is_locked(fsp,conn,numtowrite,startpos, WRITE_LOCK)) return(ERROR(ERRDOS,ERRlock)); /* The special X/Open SMB protocol handling of @@ -2544,7 +2544,7 @@ int reply_write(connection_struct *conn, char *inbuf,char *outbuf,int size,int d startpos = IVAL(inbuf,smb_vwv2); data = smb_buf(inbuf) + 3; - if (is_locked(fsp,conn,numtowrite,startpos, F_WRLCK)) + if (is_locked(fsp,conn,numtowrite,startpos, WRITE_LOCK)) return(ERROR(ERRDOS,ERRlock)); /* X/Open SMB protocol says that if smb_vwv1 is @@ -2623,7 +2623,7 @@ int reply_write_and_X(connection_struct *conn, char *inbuf,char *outbuf,int leng #endif /* LARGE_SMB_OFF_T */ } - if (is_locked(fsp,conn,numtowrite,startpos, F_WRLCK)) + if (is_locked(fsp,conn,numtowrite,startpos, WRITE_LOCK)) return(ERROR(ERRDOS,ERRlock)); /* X/Open SMB protocol says that, unlike SMBwrite @@ -2877,7 +2877,7 @@ int reply_writeclose(connection_struct *conn, mtime = make_unix_date3(inbuf+smb_vwv4); data = smb_buf(inbuf) + 1; - if (is_locked(fsp,conn,numtowrite,startpos, F_WRLCK)) + if (is_locked(fsp,conn,numtowrite,startpos, WRITE_LOCK)) return(ERROR(ERRDOS,ERRlock)); nwritten = write_file(fsp,data,startpos,numtowrite); @@ -2926,7 +2926,7 @@ int reply_lock(connection_struct *conn, DEBUG(3,("lock fd=%d fnum=%d offset=%.0f count=%.0f\n", fsp->fd_ptr->fd, fsp->fnum, (double)offset, (double)count)); - if (!do_lock(fsp, conn, count, offset, F_WRLCK, &eclass, &ecode)) { + if (!do_lock(fsp, conn, count, offset, WRITE_LOCK, &eclass, &ecode)) { if((ecode == ERRlock) && lp_blocking_locks(SNUM(conn))) { /* * A blocking lock was requested. Package up @@ -2946,7 +2946,6 @@ int reply_lock(connection_struct *conn, /**************************************************************************** reply to a unlock ****************************************************************************/ - int reply_unlock(connection_struct *conn, char *inbuf,char *outbuf, int size, int dum_buffsize) { int outsize = set_message(outbuf,0,0,True); @@ -4248,7 +4247,7 @@ no oplock granted on this file (%s).\n", fsp->fnum, fsp->fsp_name)); DEBUG(10,("reply_lockingX: unlock start=%.0f, len=%.0f for file %s\n", (double)offset, (double)count, fsp->fsp_name )); - if(!do_unlock(fsp,conn,count,offset,&eclass, &ecode)) + if(!do_unlock(fsp,conn,count,offset, &eclass, &ecode)) return ERROR(eclass,ecode); } @@ -4274,7 +4273,7 @@ no oplock granted on this file (%s).\n", fsp->fnum, fsp->fsp_name)); DEBUG(10,("reply_lockingX: lock start=%.0f, len=%.0f for file %s\n", (double)offset, (double)count, fsp->fsp_name )); - if(!do_lock(fsp,conn,count,offset, ((locktype & 1) ? F_RDLCK : F_WRLCK), + if(!do_lock(fsp,conn,count,offset, ((locktype & 1) ? READ_LOCK : WRITE_LOCK), &eclass, &ecode)) { if((ecode == ERRlock) && (lock_timeout != 0) && lp_blocking_locks(SNUM(conn))) { /* @@ -4354,7 +4353,7 @@ int reply_readbmpx(connection_struct *conn, char *inbuf,char *outbuf,int length, tcount = maxcount; total_read = 0; - if (is_locked(fsp,conn,maxcount,startpos, F_RDLCK)) + if (is_locked(fsp,conn,maxcount,startpos, READ_LOCK)) return(ERROR(ERRDOS,ERRlock)); do @@ -4416,7 +4415,7 @@ int reply_writebmpx(connection_struct *conn, char *inbuf,char *outbuf, int size, not an SMBwritebmpx - set this up now so we don't forget */ CVAL(outbuf,smb_com) = SMBwritec; - if (is_locked(fsp,conn,tcount,startpos,F_WRLCK)) + if (is_locked(fsp,conn,tcount,startpos,WRITE_LOCK)) return(ERROR(ERRDOS,ERRlock)); nwritten = write_file(fsp,data,startpos,numtowrite); |