diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-05-02 11:05:35 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-05-02 11:05:35 -0700 |
commit | 73c7683481de663df47a1422b7d0f012dbecfd8f (patch) | |
tree | 2e6ad9c5d034b8c9ebaae71dd47afa51e6043e0c | |
parent | 75c58d3e49e288e491b53d58bec7d8cdbccfe190 (diff) | |
download | consfigurator-73c7683481de663df47a1422b7d0f012dbecfd8f.tar.gz |
fix ordering of OPEN-VOLUME definitions
Pure code motion.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/property/disk.lisp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/property/disk.lisp b/src/property/disk.lisp index 874b026..096449c 100644 --- a/src/property/disk.lisp +++ b/src/property/disk.lisp @@ -132,6 +132,29 @@ Return values, if any, should be ignored.")) ;;;; Opened volumes +(defgeneric open-volume (volume file) + (:documentation "Renders contents of VOLUME directly accessible. +FILE is something in the filesystem which serves as a means of accessing +VOLUME, for types of VOLUME where that makes sense, and explicitly nil +otherwise. + +Returns as a first value a fresh instance of OPENED-VOLUME corresponding to +VOLUME. In this case, it is legitimate to subsequently call OPEN-VOLUME on +the VOLUME-CONTENTS of VOLUME. + +If opening this kind of volume results in opening its VOLUME-CONTENTS too, +also return as a second value a list of fresh OPENED-VOLUME values +corresponding to the VOLUME-CONTENTS of VOLUME. In this case, the caller +should not attempt to call OPEN-VOLUME on the VOLUME-CONTENTS of VOLUME.")) + +(defgeneric close-volume (volume) + (:documentation + "Inverse of OPEN-VOLUME: `kpartx -d`, `cryptsetup luksClose`, etc. +Return values, if any, should be ignored.") + (:method ((volume volume)) + "Default implementation: assume there is nothing to close." + (values))) + (defclass opened-volume (volume) ((device-file :type pathname @@ -180,29 +203,6 @@ SUBCLASS-OF-VOLUME should be a symbol naming a subclass of VOLUME." (setf (slot-value new 'device-file) device-file) (reinitialize-instance new)))))) -(defgeneric open-volume (volume file) - (:documentation "Renders contents of VOLUME directly accessible. -FILE is something in the filesystem which serves as a means of accessing -VOLUME, for types of VOLUME where that makes sense, and explicitly nil -otherwise. - -Returns as a first value a fresh instance of OPENED-VOLUME corresponding to -VOLUME. In this case, it is legitimate to subsequently call OPEN-VOLUME on -the VOLUME-CONTENTS of VOLUME. - -If opening this kind of volume results in opening its VOLUME-CONTENTS too, -also return as a second value a list of fresh OPENED-VOLUME values -corresponding to the VOLUME-CONTENTS of VOLUME. In this case, the caller -should not attempt to call OPEN-VOLUME on the VOLUME-CONTENTS of VOLUME.")) - -(defgeneric close-volume (volume) - (:documentation - "Inverse of OPEN-VOLUME: `kpartx -d`, `cryptsetup luksClose`, etc. -Return values, if any, should be ignored.") - (:method ((volume volume)) - "Default implementation: assume there is nothing to close." - (values))) - (defclass physical-disk (top-level-volume opened-volume) () (:documentation "A physical disk drive attached to the machine, which always has a |