(FILECREATED "20-Apr-87 17:11:29" {ERIS}<DANIELS>LISP>PATCHES>DOVELFPATCH.;1 3316   

      changes to:  (VARS DOVELFPATCHCOMS))


(* Copyright (c) 1987 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT DOVELFPATCHCOMS)

(RPAQQ DOVELFPATCHCOMS ((DECLARE: EVAL@COMPILE DONTEVAL@LOAD DONTCOPY (FILES (LOADCOMP)
									       LOCALFILE))
			  (FNS \PFTransferFilePage)))
(DECLARE: EVAL@COMPILE DONTEVAL@LOAD DONTCOPY 
(FILESLOAD (LOADCOMP)
	   LOCALFILE)
)
(DEFINEQ

(\PFTransferFilePage
  [LAMBDA (file filePageNumber volumePageNumber frame operation runLength noBreak)
                                                             (* ; "Edited 16-Apr-87 19:53 by amd")
                                                             (* ;; 
							     
"file: FileDescriptor, filePageNumber: FIXP, volumePageNumber: FIXP, frame: Page, operation: (VVR VVW VWW)")
                                                             (* ;; "")
                                                             (* ;; 
							     
"Transfers a page to or from the disk. This function, unlike \PFTransferPage, deals in file- and volume-relative page numbers. It builds the correct label to be used for the transfer. NB: The only multi-page transfers occur during file allocation and deallocation. In these cases, FRAME is a junk page that will get written to every page being processed."
)
    (SETQ runLength (OR runLength 1))                    (* ;; 
							     
"Break up the run into chunks of at most 128 pages for the Daybreak. DiskHeadDove$InitIOCB will not create an IOCB with a run length longer than that for some reason. This is the most convenient place to put this patch for now -- ideally the driver should be changed to handle this. The DLion is not adversely affected, since it does cylinder-crossing runs one page at a time anyway."
)
    (FOR PAGE-OFFSET FROM 0 BY 128 AS PAGES-LEFT FROM runLength BY -128
       WHILE (IGREATERP PAGES-LEFT 0) DO (WITH-RESOURCE
						 label
						 (if (FIXP (fetch (FileDescriptor fileID)
								  of file))
						     then (replace (Label fileID) of label
							       with (fetch (FileDescriptor fileID)
									 of file))
						   else    (* ;; 
							     
"Logical volume pages, marker pages, and physical volume pages have a 5-word volume ID for their fileID in a label.  This is essentially a loophole to get around the normal declaration of the Label datatype, which expects a 2-word ID"
)
							  (MESASETQ label (fetch (FileDescriptor
										     fileID)
									     of file)
								    VolumeID))
						 (replace (Label attributesInAllPages)
						    of label with (fetch (FileDescriptor type)
									 of file))
						 (replace (Label filePage) of label
						    with (IPLUS filePageNumber PAGE-OFFSET))
						 (\PFTransferPage
						   (IPLUS (LvBasePageAddr (fetch (FileDescriptor
										       volNum)
									       of file))
							    volumePageNumber PAGE-OFFSET)
						   frame operation label (MIN PAGES-LEFT 128)
						   noBreak)))
    NIL])
)
(PUTPROPS DOVELFPATCH COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (477 3234 (\PFTransferFilePage 487 . 3232)))))
STOP