8 #define NODE_NAME_SIZE 224
9 #define PATH_STR_SIZE 16
10 #define PARAMS_SIZE 1024
11 #define FILE_NAME_SIZE 256
12 #define CALLOUT_MAX_SIZE 256
13 #define BLK_DEV_SIZE 33
18 #define SCSI_VENDOR_SIZE 9
19 #define SCSI_PRODUCT_SIZE 17
20 #define SCSI_REV_SIZE 5
21 #define SCSI_STATE_SIZE 9
23 #define NO_PATH_RETRY_UNDEF 0
24 #define NO_PATH_RETRY_FAIL -1
25 #define NO_PATH_RETRY_QUEUE -2
66 enum queue_without_daemon_states {
90 enum log_checker_err_states {
113 char dev[FILE_NAME_SIZE];
114 struct scsi_idlun scsi_id;
119 # define HDIO_GETGEO 0x0301 /* get device geometry */
123 unsigned char sectors;
124 unsigned short cylinders;
129 char dev[FILE_NAME_SIZE];
130 char dev_t[BLK_DEV_SIZE];
131 struct udev_device *udev;
132 struct scsi_idlun scsi_id;
134 struct hd_geometry geom;
135 char wwid[WWID_SIZE];
136 char vendor_id[SCSI_VENDOR_SIZE];
137 char product_id[SCSI_PRODUCT_SIZE];
138 char rev[SCSI_REV_SIZE];
139 char serial[SERIAL_SIZE];
140 char tgt_node_name[NODE_NAME_SIZE];
141 unsigned long long size;
142 unsigned int checkint;
153 struct checker checker;
154 struct multipath * mpp;
157 /* configlet pointers */
158 struct hwentry * hwe;
161 typedef int (pgpolicyfn) (struct multipath *);
164 char wwid[WWID_SIZE];
165 char alias_old[WWID_SIZE];
167 pgpolicyfn *pgpolicyfn;
175 int nr_active; /* current available(= not known as failed) paths */
176 int no_path_retry; /* number of retries after all paths are down */
177 int retry_tick; /* remaining times for retries */
180 int flush_on_last_del;
183 unsigned int dev_loss;
187 unsigned long long size;
190 struct dm_info * dmi;
192 /* configlet pointers */
198 struct mpentry * mpe;
199 struct hwentry * hwe;
205 unsigned int stat_switchgroup;
206 unsigned int stat_path_failures;
207 unsigned int stat_map_loads;
208 unsigned int stat_total_queueing_time;
209 unsigned int stat_queueing_timeouts;
211 /* checkers shared data */
214 /* persistent management data*/
215 unsigned char * reservation_key;
216 unsigned char prflag;
228 struct path * alloc_path (void);
229 struct pathgroup * alloc_pathgroup (void);
230 struct multipath * alloc_multipath (void);
231 void free_path (struct path *);
232 void free_pathvec (vector vec, enum free_path_mode free_paths);
233 void free_pathgroup (struct pathgroup * pgp, enum free_path_mode free_paths);
234 void free_pgvec (vector pgvec, enum free_path_mode free_paths);
235 void free_multipath (struct multipath *, enum free_path_mode free_paths);
236 void free_multipath_attributes (struct multipath *);
237 void drop_multipath (vector mpvec, char * wwid, enum free_path_mode free_paths);
238 void free_multipathvec (vector mpvec, enum free_path_mode free_paths);
240 int store_path (vector pathvec, struct path * pp);
241 int store_pathgroup (vector pgvec, struct pathgroup * pgp);
243 struct multipath * find_mp_by_alias (vector mp, char * alias);
244 struct multipath * find_mp_by_wwid (vector mp, char * wwid);
245 struct multipath * find_mp_by_str (vector mp, char * wwid);
246 struct multipath * find_mp_by_minor (vector mp, int minor);
248 struct path * find_path_by_devt (vector pathvec, char * devt);
249 struct path * find_path_by_dev (vector pathvec, char * dev);
250 struct path * first_path (struct multipath * mpp);
252 int pathcountgr (struct pathgroup *, int);
253 int pathcount (struct multipath *, int);
254 int pathcmp (struct pathgroup *, struct pathgroup *);
255 void setup_feature(struct multipath *, char *);
256 int add_feature (char **, char *);
257 int remove_feature (char **, char *);
259 extern char sysfs_path[PATH_SIZE];
261 #endif /* _STRUCTS_H */