aboutsummaryrefslogtreecommitdiff
path: root/cddl/compat/opensolaris/include
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2007-05-06 01:39:39 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2007-05-06 01:39:39 +0000
commit7baf73a6c28bec6aec5d1e6ff656f7e527a6c8bc (patch)
tree155527b23b9a27cd3b08983c2dbd01ca5b09866d /cddl/compat/opensolaris/include
parentfab3f4465e807dea84f8c8200b6e384766ae0422 (diff)
downloadsrc-7baf73a6c28bec6aec5d1e6ff656f7e527a6c8bc.tar.gz
src-7baf73a6c28bec6aec5d1e6ff656f7e527a6c8bc.zip
Use provider's ident to handle situations when disks are moved around
and show up with different names: first try to open provider using remembered name and compare its ident, if equal, this is our provider, if not equal or there is no provider with such name, find provider with remembered ident and don't care about the name.
Notes
Notes: svn path=/head/; revision=169303
Diffstat (limited to 'cddl/compat/opensolaris/include')
-rw-r--r--cddl/compat/opensolaris/include/devid.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/cddl/compat/opensolaris/include/devid.h b/cddl/compat/opensolaris/include/devid.h
index 06839ddfe2f5..6718ce2b9fbc 100644
--- a/cddl/compat/opensolaris/include/devid.h
+++ b/cddl/compat/opensolaris/include/devid.h
@@ -27,23 +27,28 @@
#ifndef _OPENSOLARIS_DEVID_H_
#define _OPENSOLARIS_DEVID_H_
-#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/disk.h>
#include <stdlib.h>
-typedef int ddi_devid_t;
+typedef struct ddi_devid {
+ char devid[DISK_IDENT_SIZE];
+} ddi_devid_t;
typedef struct devid_nmlist {
- char *devname;
+ char devname[MAXPATHLEN];
dev_t dev;
} devid_nmlist_t;
-static inline int devid_str_decode(char *devidstr, ddi_devid_t *retdevid, char **retminor_name) { abort(); }
-static inline int devid_deviceid_to_nmlist(char *search_path, ddi_devid_t devid, char *minor_name, devid_nmlist_t **retlist) { abort(); }
-static inline void devid_str_free(char *str) { abort(); }
-static inline void devid_free(ddi_devid_t devid) { abort(); }
-static inline void devid_free_nmlist(devid_nmlist_t *list) { abort(); }
-static inline int devid_get(int fd, ddi_devid_t *retdevid) { return -1; }
-static inline int devid_get_minor_name(int fd, char **retminor_name) { abort(); }
-static inline char *devid_str_encode(ddi_devid_t devid, char *minor_name) { abort(); }
+int devid_str_decode(char *devidstr, ddi_devid_t *retdevid,
+ char **retminor_name);
+int devid_deviceid_to_nmlist(char *search_path, ddi_devid_t devid,
+ char *minor_name, devid_nmlist_t **retlist);
+void devid_str_free(char *str);
+void devid_free(ddi_devid_t devid);
+void devid_free_nmlist(devid_nmlist_t *list);
+int devid_get(int fd, ddi_devid_t *retdevid);
+int devid_get_minor_name(int fd, char **retminor_name);
+char *devid_str_encode(ddi_devid_t devid, char *minor_name);
#endif /* !_OPENSOLARIS_DEVID_H_ */