aboutsummaryrefslogtreecommitdiff
path: root/src/property/disk.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-02 11:05:35 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-02 11:05:35 -0700
commit73c7683481de663df47a1422b7d0f012dbecfd8f (patch)
tree2e6ad9c5d034b8c9ebaae71dd47afa51e6043e0c /src/property/disk.lisp
parent75c58d3e49e288e491b53d58bec7d8cdbccfe190 (diff)
downloadconsfigurator-73c7683481de663df47a1422b7d0f012dbecfd8f.tar.gz
fix ordering of OPEN-VOLUME definitions
Pure code motion. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/disk.lisp')
-rw-r--r--src/property/disk.lisp46
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