Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102817374
D37337.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D37337.diff
View Options
diff --git a/stand/libsa/libsa.3 b/stand/libsa/libsa.3
--- a/stand/libsa/libsa.3
+++ b/stand/libsa/libsa.3
@@ -710,7 +710,9 @@
int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data);
int (*dv_print)(int verbose);
void (*dv_cleanup)(void);
- void (*dv_fmtdev)(struct devdesc *);
+ char * (*dv_fmtdev)(struct devdesc *);
+ int (*dv_parsedev)(struct devdesc **dev, const char *devpart,
+ const char **path);
};
.Ed
.Bl -tag -width ".Fn dv_strategy"
@@ -751,6 +753,34 @@
.It Fn dv_fmtdev
Converts the specified devdesc to the canonical string representation
for that device.
+.It Fn dv_parsedev
+Parses the device portion of a file path.
+The
+.Dv devpart
+will point to the
+.Sq tail
+of device name, possibly followed by a colon and a path within the device.
+The
+.Sq tail
+is, by convention, the part of the device specification that follows the
+.Fa dv_name
+part of the string.
+So when parsing the string
+.Dq disk3p5:/xxx
+.Dv devpart
+will point to the
+.Sq 3
+in that string.
+The parsing routine is expected to allocate a new
+.Dv struct devdesc
+or subclass and return it in
+.Dv dev
+when successful.
+This routine should set
+.Dv path
+to point to the portion of the string after device specification, or
+.Dq /xxx
+in the earlier example.
.El
.Sh HISTORY
The
diff --git a/stand/libsa/stand.h b/stand/libsa/stand.h
--- a/stand/libsa/stand.h
+++ b/stand/libsa/stand.h
@@ -160,6 +160,7 @@
int (*dv_print)(int verbose); /* print device information */
void (*dv_cleanup)(void);
char * (*dv_fmtdev)(struct devdesc *);
+ int (*dv_parsedev)(struct devdesc **, const char *, const char **);
};
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 2:02 PM (20 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14698956
Default Alt Text
D37337.diff (1 KB)
Attached To
Mode
D37337: stand: Introduce new dv_parsedev routine
Attached
Detach File
Event Timeline
Log In to Comment