nwconn: enable Release Physical Record
All checks were successful
Source release / source-package (push) Successful in 48s
All checks were successful
Source release / source-package (push) Successful in 48s
Wire NCP 0x1c Release Physical Record to the existing physical-record unlock path. The Novell SDK documents NCP 0x2222/28 as releasing one byte range held by the calling client without removing it from the client data byte range table. The byte range remains logged and may be relocked by a later Lock Physical Record Set call. The request carries a reserved byte, a 6-byte NetWare file handle, a start offset, and a record length; the reply carries no data and reports Unlock Error through the completion code. The neighboring handler already supported NCP 0x1a Log Physical Record and NCP 0x1e Clear Physical Record. Reuse the same request layout and distinguish release from clear by passing lock_flag -1 for release/unlock only and lock_flag -2 for clear/unlock plus unlog. Add the SDK request/reply semantics to the inline endpoint comment and make the previously missing 0x1c endpoint reachable. This only enables the documented endpoint path; the underlying physical-record locking implementation is unchanged.
This commit is contained in:
42
src/nwconn.c
42
src/nwconn.c
@@ -1983,15 +1983,39 @@ static int handle_ncp_serv(void)
|
||||
return(-1); /* nwbind must do a little rest */
|
||||
break;
|
||||
|
||||
case 0x1a : /* Log Physical Record */
|
||||
case 0x1e : /* Clear Physical Record */
|
||||
case 0x1a : /* Log Physical Record */
|
||||
case 0x1c : /* Release Physical Record */
|
||||
case 0x1e : /* Clear Physical Record */
|
||||
{
|
||||
/*
|
||||
* SDK: NCP 0x2222/26 Log Physical Record records one
|
||||
* byte range in the caller's logged data block table.
|
||||
* Lock Flag 0 logs for future locking, 1 locks
|
||||
* exclusive, and 3 locks shareable/read-only.
|
||||
*
|
||||
* SDK: NCP 0x2222/28 Release Physical Record releases
|
||||
* one locked byte range but leaves it in the logged
|
||||
* table so a later Lock Physical Record Set can relock
|
||||
* it. The request carries a reserved byte, a 6-byte
|
||||
* NetWare file handle, Start Offset, and Record Length;
|
||||
* it returns no reply data and reports Unlock Error
|
||||
* through the completion code.
|
||||
*
|
||||
* SDK: NCP 0x2222/30 Clear Physical Record releases the
|
||||
* range if it is locked and removes it from the logged
|
||||
* table.
|
||||
*
|
||||
* MARS-NWE currently routes both release and clear through
|
||||
* the existing physical-record unlock path; the low-level
|
||||
* physical-record table is still shared with the existing
|
||||
* nw_log_physical_record() implementation.
|
||||
*/
|
||||
struct INPUT {
|
||||
uint8 header[7]; /* Requestheader */
|
||||
uint8 lock_flag; /* 0=log, 1=excl */
|
||||
/* 3=shared */
|
||||
uint8 ext_fhandle[2]; /* all zero */
|
||||
uint8 fhandle[4]; /* Filehandle */
|
||||
uint8 lock_flag; /* 0=log/reserved, 1=excl */
|
||||
/* 3=shared */
|
||||
uint8 ext_fhandle[2]; /* all zero / high handle */
|
||||
uint8 fhandle[4]; /* Filehandle */
|
||||
uint8 offset[4];
|
||||
uint8 size[4];
|
||||
uint8 timeout[2];
|
||||
@@ -2000,7 +2024,7 @@ static int handle_ncp_serv(void)
|
||||
uint32 offset= GET_BE32(input->offset);
|
||||
uint32 size = GET_BE32(input->size);
|
||||
uint16 timeout = GET_BE16(input->timeout);
|
||||
if (function == 0x1a) /* lockfile */
|
||||
if (function == 0x1a) /* log or lock */
|
||||
completition = (uint8)(-nw_log_physical_record(
|
||||
fhandle,
|
||||
offset,
|
||||
@@ -2013,7 +2037,9 @@ static int handle_ncp_serv(void)
|
||||
offset,
|
||||
size,
|
||||
timeout,
|
||||
-2 /* unlock + unlog */
|
||||
(function == 0x1c)
|
||||
? -1 /* unlock only */
|
||||
: -2 /* unlock + unlog */
|
||||
));
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user