Whamcloud - gitweb
Update copyright and license information.
[fs/lustre-release.git] / lustre / include / linux / obd_class.h
1 #ifndef __LINUX_CLASS_OBD_H
2 #define __LINUX_CLASS_OBD_H
3 /*
4  * Copyright (C) 2001  Cluster File Systems, Inc.
5  *
6  * This code is issued under the GNU General Public License.
7  * See the file COPYING in this distribution
8  */
9
10 #include <linux/fs.h>
11 #include <linux/time.h>
12 #include <linux/obd.h>
13
14 #include <linux/obd_ext2.h>
15 #include <linux/obd_snap.h>
16 #include <linux/obd_trace.h>
17 /* #include <linux/obd_fc.h> */
18 #include <linux/obd_raid1.h>
19 #include <linux/obd_rpc.h>
20
21
22 /*
23  *  ======== OBD type Declarations ===========
24  */
25
26 typedef uint64_t        obd_id;
27 typedef uint64_t        obd_gr;
28 typedef uint64_t        obd_time;
29 typedef uint64_t        obd_size;
30 typedef uint64_t        obd_off;
31 typedef uint64_t        obd_blocks;
32 typedef uint32_t        obd_blksize;
33 typedef uint32_t        obd_mode;
34 typedef uint32_t        obd_uid;
35 typedef uint32_t        obd_gid;
36 typedef uint32_t        obd_flag;
37 typedef uint32_t        obd_count;
38
39 #define OBD_FL_INLINEDATA       (0x00000001UL)  
40 #define OBD_FL_OBDMDEXISTS      (0x00000002UL)
41
42 #define OBD_INLINESZ    60
43 #define OBD_OBDMDSZ     60
44 /* Note: 64-bit types are 64-bit aligned in structure */
45 struct obdo {
46         obd_id                  o_id;
47         obd_gr                  o_gr;
48         obd_time                o_atime;
49         obd_time                o_mtime;
50         obd_time                o_ctime;
51         obd_size                o_size;
52         obd_blocks              o_blocks;
53         obd_blksize             o_blksize;
54         obd_mode                o_mode;
55         obd_uid                 o_uid;
56         obd_gid                 o_gid;
57         obd_flag                o_flags;
58         obd_flag                o_obdflags;
59         obd_count               o_nlink;
60         obd_count               o_generation;
61         obd_flag                o_valid;        /* hot fields in this obdo */
62         char                    o_inline[OBD_INLINESZ];
63         char                    o_obdmd[OBD_OBDMDSZ];
64         struct list_head        o_list;
65         struct obd_ops          *o_op;
66 };
67
68 #define OBD_MD_FLALL    (~0UL)
69 #define OBD_MD_FLID     (0x00000001UL)
70 #define OBD_MD_FLATIME  (0x00000002UL)
71 #define OBD_MD_FLMTIME  (0x00000004UL)
72 #define OBD_MD_FLCTIME  (0x00000008UL)
73 #define OBD_MD_FLSIZE   (0x00000010UL)
74 #define OBD_MD_FLBLOCKS (0x00000020UL)
75 #define OBD_MD_FLBLKSZ  (0x00000040UL)
76 #define OBD_MD_FLMODE   (0x00000080UL)
77 #define OBD_MD_FLUID    (0x00000100UL)
78 #define OBD_MD_FLGID    (0x00000200UL)
79 #define OBD_MD_FLFLAGS  (0x00000400UL)
80 #define OBD_MD_FLOBDFLG (0x00000800UL)
81 #define OBD_MD_FLNLINK  (0x00001000UL)
82 #define OBD_MD_FLGENER  (0x00002000UL)
83 #define OBD_MD_FLINLINE (0x00004000UL)
84 #define OBD_MD_FLOBDMD  (0x00008000UL)
85 #define OBD_MD_FLNOTOBD (~(OBD_MD_FLOBDMD | OBD_MD_FLOBDFLG | OBD_MD_FLBLOCKS))
86
87 /*
88  *  ======== OBD Device Declarations ===========
89  */
90
91
92 #define OBD_PSDEV_MAJOR 186
93 #define MAX_OBD_DEVICES 8
94 #define MAX_MULTI       16
95
96
97 extern struct obd_device obd_dev[MAX_OBD_DEVICES];
98
99
100 #define OBD_ATTACHED 0x1
101 #define OBD_SET_UP   0x2
102
103 struct obd_conn {
104         struct obd_device *oc_dev;
105         uint32_t oc_id;
106 };
107
108 typedef struct {
109         uint32_t len;
110         char *   name;
111         struct dentry *dentry;   /* file system obd device names */
112         __u8           _uuid[16]; /* uuid obd device names */
113 } obd_devicename;
114
115 /* corresponds to one of the obdx */
116 struct obd_device {
117         struct obd_type *obd_type;
118         int obd_minor;
119         int obd_flags;
120         int obd_refcnt; 
121         obd_devicename obd_fsname; 
122         struct proc_dir_entry *obd_proc_entry;
123         int obd_multi_count;
124         struct obd_conn obd_multi_conn[MAX_MULTI];
125         unsigned int obd_gen_last_id;
126         unsigned long obd_gen_prealloc_quota;
127         struct list_head obd_gen_clients;
128         union {
129                 struct ext2_obd ext2;
130                 struct raid1_obd raid1;
131                 struct snap_obd snap;
132                 struct trace_obd trace;
133                 /* struct fc_obd fc; */
134         } u;
135 };
136
137 extern struct proc_dir_entry *proc_lustre_register_obd_device(struct obd_device *obd);
138 extern void proc_lustre_release_obd_device(struct obd_device *obd);
139 extern void proc_lustre_remove_obd_entry(const char* name, struct obd_device *obd);
140
141
142 /*
143  *  ======== OBD Operations Declarations ===========
144  */
145
146 #define OBD_BRW_READ    (READ)
147 #define OBD_BRW_WRITE   (WRITE)
148 #define OBD_BRW_RWMASK  (READ | WRITE)
149 #define OBD_BRW_CREATE  (0x00000010UL)
150
151 struct obd_ops {
152         int (*o_iocontrol)(int cmd, struct obd_conn *, int len, void *karg,
153                            void *uarg);
154         int (*o_get_info)(struct obd_conn *, obd_count keylen, void *key,
155                           obd_count *vallen, void **val);
156         int (*o_set_info)(struct obd_conn *, obd_count keylen, void *key,
157                           obd_count vallen, void *val);
158         int (*o_attach)(struct obd_device *dev, obd_count len, void *data);
159         int (*o_detach)(struct obd_device *dev);
160         int (*o_setup) (struct obd_device *dev, obd_count len, void *data);
161         int (*o_cleanup)(struct obd_device *dev);
162         int (*o_connect)(struct obd_conn *conn);
163         int (*o_disconnect)(struct obd_conn *conn);
164         int (*o_statfs)(struct obd_conn *conn, struct statfs *statfs);
165         int (*o_preallocate)(struct obd_conn *, obd_count *req, obd_id *ids);
166         int (*o_create)(struct obd_conn *conn,  struct obdo *oa);
167         int (*o_destroy)(struct obd_conn *conn, struct obdo *oa);
168         int (*o_setattr)(struct obd_conn *conn, struct obdo *oa);
169         int (*o_getattr)(struct obd_conn *conn, struct obdo *oa);
170         int (*o_read)(struct obd_conn *conn, struct obdo *oa, char *buf,
171                       obd_size *count, obd_off offset);
172         int (*o_write)(struct obd_conn *conn, struct obdo *oa, char *buf,
173                        obd_size *count, obd_off offset);
174         int (*o_brw)(int rw, struct obd_conn *conn, obd_count num_oa,
175                      struct obdo **oa, obd_count *oa_bufs, char **buf,
176                      obd_size *count, obd_off *offset, obd_flag *flags);
177         int (*o_punch)(struct obd_conn *conn, struct obdo *tgt, obd_size count,
178                        obd_off offset);
179         int (*o_sync)(struct obd_conn *conn, struct obdo *tgt, obd_size count,
180                       obd_off offset);
181         int (*o_migrate)(struct obd_conn *conn, struct obdo *dst,
182                          struct obdo *src, obd_size count, obd_off offset);
183         int (*o_copy)(struct obd_conn *dstconn, struct obdo *dst,
184                       struct obd_conn *srconn, struct obdo *src,
185                       obd_size count, obd_off offset);
186         int (*o_iterate)(struct obd_conn *conn, int (*)(obd_id, obd_gr, void *),
187                          obd_id *startid, obd_gr group, void *data);
188 };
189
190 #define OBT(dev)        dev->obd_type->typ_ops
191 #define OBP(dev,op)     dev->obd_type->typ_ops->o_ ## op
192
193 /* This value is not arbitrarily chosen.  KIO_STATIC_PAGES from linux/iobuf.h */
194 #define MAX_IOVEC       (KIO_STATIC_PAGES - 1)
195
196
197 /*
198  *  ======== OBD Metadata Support  ===========
199  */
200
201 extern int obd_init_obdo_cache(void);
202 extern void obd_cleanup_obdo_cache(void);
203
204
205 static inline int obdo_has_inline(struct obdo *obdo)
206 {
207         return (obdo->o_valid & OBD_MD_FLINLINE &&
208                 obdo->o_obdflags & OBD_FL_INLINEDATA);
209 };
210
211 static inline int obdo_has_obdmd(struct obdo *obdo)
212 {
213         return (obdo->o_valid & OBD_MD_FLOBDMD &&
214                 obdo->o_obdflags & OBD_FL_OBDMDEXISTS);
215 };
216
217 /* support routines */
218 extern kmem_cache_t *obdo_cachep;
219
220 static __inline__ struct obdo *obdo_alloc(void)
221 {
222         struct obdo *oa = NULL;
223
224         oa = kmem_cache_alloc(obdo_cachep, SLAB_KERNEL);
225         memset(oa, 0, sizeof (*oa));
226
227         return oa;
228 }
229
230 static __inline__ void obdo_free(struct obdo *oa)
231 {
232         if ( !oa ) 
233                 return;
234         kmem_cache_free(obdo_cachep, oa);
235 }
236
237
238
239 static __inline__ struct obdo *obdo_fromid(struct obd_conn *conn, obd_id id,
240                                            obd_flag valid)
241 {
242         struct obdo *oa;
243         int err;
244
245         ENTRY;
246         oa = obdo_alloc();
247         if ( !oa ) {
248                 EXIT;
249                 return ERR_PTR(-ENOMEM);
250         }
251         memset(oa, 0, sizeof(*oa));
252         oa->o_id = id;
253         oa->o_valid = valid;
254         if ((err = OBP(conn->oc_dev, getattr)(conn, oa))) {
255                 obdo_free(oa);
256                 EXIT;
257                 return ERR_PTR(err);
258         }
259         EXIT;
260         return oa;
261 }
262
263 static inline void obdo_from_iattr(struct obdo *oa, struct iattr *attr)
264 {
265         unsigned int ia_valid = attr->ia_valid;
266
267         if (ia_valid & ATTR_ATIME) {
268                 oa->o_atime = attr->ia_atime;
269                 oa->o_valid |= OBD_MD_FLATIME;
270         }
271         if (ia_valid & ATTR_MTIME) {
272                 oa->o_mtime = attr->ia_mtime;
273                 oa->o_valid |= OBD_MD_FLMTIME;
274         }
275         if (ia_valid & ATTR_CTIME) {
276                 oa->o_ctime = attr->ia_ctime;
277                 oa->o_valid |= OBD_MD_FLCTIME;
278         }
279         if (ia_valid & ATTR_SIZE) {
280                 oa->o_size = attr->ia_size;
281                 oa->o_valid |= OBD_MD_FLSIZE;
282         }
283         if (ia_valid & ATTR_MODE) {
284                 oa->o_mode = attr->ia_mode;
285                 oa->o_valid |= OBD_MD_FLMODE;
286                 if (!in_group_p(oa->o_gid) && !capable(CAP_FSETID))
287                         oa->o_mode &= ~S_ISGID;
288         }
289         if (ia_valid & ATTR_UID)
290         {
291                 oa->o_uid = attr->ia_uid;
292                 oa->o_valid |= OBD_MD_FLUID;
293         }
294         if (ia_valid & ATTR_GID) {
295                 oa->o_gid = attr->ia_gid;
296                 oa->o_valid |= OBD_MD_FLGID;
297         }
298 }
299
300
301 static __inline__ void obdo_cpy_md(struct obdo *dst, struct obdo *src)
302 {
303         CDEBUG(D_INODE, "src obdo %Ld valid 0x%x, dst obdo %Ld\n",
304                src->o_id, src->o_valid, dst->o_id);
305         if ( src->o_valid & OBD_MD_FLATIME ) 
306                 dst->o_atime = src->o_atime;
307         if ( src->o_valid & OBD_MD_FLMTIME ) 
308                 dst->o_mtime = src->o_mtime;
309         if ( src->o_valid & OBD_MD_FLCTIME ) 
310                 dst->o_ctime = src->o_ctime;
311         if ( src->o_valid & OBD_MD_FLSIZE ) 
312                 dst->o_size = src->o_size;
313         if ( src->o_valid & OBD_MD_FLBLOCKS ) /* allocation of space */
314                 dst->o_blocks = src->o_blocks;
315         if ( src->o_valid & OBD_MD_FLBLKSZ )
316                 dst->o_blksize = src->o_blksize;
317         if ( src->o_valid & OBD_MD_FLMODE ) 
318                 dst->o_mode = src->o_mode;
319         if ( src->o_valid & OBD_MD_FLUID ) 
320                 dst->o_uid = src->o_uid;
321         if ( src->o_valid & OBD_MD_FLGID ) 
322                 dst->o_gid = src->o_gid;
323         if ( src->o_valid & OBD_MD_FLFLAGS ) 
324                 dst->o_flags = src->o_flags;
325         /*
326         if ( src->o_valid & OBD_MD_FLOBDFLG ) 
327                 dst->o_obdflags = src->o_obdflags;
328         */
329         if ( src->o_valid & OBD_MD_FLNLINK ) 
330                 dst->o_nlink = src->o_nlink;
331         if ( src->o_valid & OBD_MD_FLGENER ) 
332                 dst->o_generation = src->o_generation;
333         if ( src->o_valid & OBD_MD_FLINLINE &&
334              src->o_obdflags & OBD_FL_INLINEDATA) {
335                 memcpy(dst->o_inline, src->o_inline, sizeof(src->o_inline));
336                 dst->o_obdflags |= OBD_FL_INLINEDATA;
337         }
338         if ( src->o_valid & OBD_MD_FLOBDMD &&
339              src->o_obdflags & OBD_FL_OBDMDEXISTS) {
340                 memcpy(dst->o_obdmd, src->o_obdmd, sizeof(src->o_obdmd));
341                 dst->o_obdflags |= OBD_FL_OBDMDEXISTS;
342         }
343
344         dst->o_valid |= src->o_valid;
345 }
346
347 static __inline__ void obdo_from_inode(struct obdo *dst, struct inode *src)
348 {
349         if ( dst->o_valid & OBD_MD_FLID )
350                 dst->o_id = src->i_ino;
351         if ( dst->o_valid & OBD_MD_FLATIME )
352                 dst->o_atime = src->i_atime;
353         if ( dst->o_valid & OBD_MD_FLMTIME )
354                 dst->o_mtime = src->i_mtime;
355         if ( dst->o_valid & OBD_MD_FLCTIME )
356                 dst->o_ctime = src->i_ctime;
357         if ( dst->o_valid & OBD_MD_FLSIZE )
358                 dst->o_size = src->i_size;
359         if ( dst->o_valid & OBD_MD_FLBLOCKS )   /* allocation of space */
360                 dst->o_blocks = src->i_blocks;
361         if ( dst->o_valid & OBD_MD_FLBLKSZ )
362                 dst->o_blksize = src->i_blksize;
363         if ( dst->o_valid & OBD_MD_FLMODE )
364                 dst->o_mode = src->i_mode;
365         if ( dst->o_valid & OBD_MD_FLUID )
366                 dst->o_uid = src->i_uid;
367         if ( dst->o_valid & OBD_MD_FLGID )
368                 dst->o_gid = src->i_gid;
369         if ( dst->o_valid & OBD_MD_FLFLAGS )
370                 dst->o_flags = src->i_flags;
371         if ( dst->o_valid & OBD_MD_FLNLINK )
372                 dst->o_nlink = src->i_nlink;
373         if ( dst->o_valid & OBD_MD_FLGENER ) 
374                 dst->o_generation = src->i_generation;
375 }
376
377 static __inline__ void obdo_to_inode(struct inode *dst, struct obdo *src)
378 {
379
380         if ( src->o_valid & OBD_MD_FLID )
381                 dst->i_ino = src->o_id;
382         if ( src->o_valid & OBD_MD_FLATIME ) 
383                 dst->i_atime = src->o_atime;
384         if ( src->o_valid & OBD_MD_FLMTIME ) 
385                 dst->i_mtime = src->o_mtime;
386         if ( src->o_valid & OBD_MD_FLCTIME ) 
387                 dst->i_ctime = src->o_ctime;
388         if ( src->o_valid & OBD_MD_FLSIZE ) 
389                 dst->i_size = src->o_size;
390         if ( src->o_valid & OBD_MD_FLBLOCKS ) /* allocation of space */
391                 dst->i_blocks = src->o_blocks;
392         if ( src->o_valid & OBD_MD_FLBLKSZ )
393                 dst->i_blksize = src->o_blksize;
394         if ( src->o_valid & OBD_MD_FLMODE ) 
395                 dst->i_mode = src->o_mode;
396         if ( src->o_valid & OBD_MD_FLUID ) 
397                 dst->i_uid = src->o_uid;
398         if ( src->o_valid & OBD_MD_FLGID ) 
399                 dst->i_gid = src->o_gid;
400         if ( src->o_valid & OBD_MD_FLFLAGS ) 
401                 dst->i_flags = src->o_flags;
402         if ( src->o_valid & OBD_MD_FLNLINK )
403                 dst->i_nlink = src->o_nlink;
404         if ( src->o_valid & OBD_MD_FLGENER )
405                 dst->i_generation = src->o_generation;
406 }
407
408 /* returns FALSE if comparison (by flags) is same, TRUE if changed */
409 static __inline__ int obdo_cmp_md(struct obdo *dst, struct obdo *src,
410                                   obd_flag compare)
411 {
412         int res = 0;
413
414         if ( compare & OBD_MD_FLATIME )
415                 res = (res || (dst->o_atime != src->o_atime));
416         if ( compare & OBD_MD_FLMTIME )
417                 res = (res || (dst->o_mtime != src->o_mtime));
418         if ( compare & OBD_MD_FLCTIME )
419                 res = (res || (dst->o_ctime != src->o_ctime));
420         if ( compare & OBD_MD_FLSIZE )
421                 res = (res || (dst->o_size != src->o_size));
422         if ( compare & OBD_MD_FLBLOCKS ) /* allocation of space */
423                 res = (res || (dst->o_blocks != src->o_blocks));
424         if ( compare & OBD_MD_FLBLKSZ )
425                 res = (res || (dst->o_blksize != src->o_blksize));
426         if ( compare & OBD_MD_FLMODE )
427                 res = (res || (dst->o_mode != src->o_mode));
428         if ( compare & OBD_MD_FLUID )
429                 res = (res || (dst->o_uid != src->o_uid));
430         if ( compare & OBD_MD_FLGID )
431                 res = (res || (dst->o_gid != src->o_gid));
432         if ( compare & OBD_MD_FLFLAGS ) 
433                 res = (res || (dst->o_flags != src->o_flags));
434         if ( compare & OBD_MD_FLNLINK )
435                 res = (res || (dst->o_nlink != src->o_nlink));
436         if ( compare & OBD_MD_FLGENER )
437                 res = (res || (dst->o_generation != src->o_generation));
438         /* XXX Don't know if thses should be included here - wasn't previously
439         if ( compare & OBD_MD_FLINLINE )
440                 res = (res || memcmp(dst->o_inline, src->o_inline));
441         if ( compare & OBD_MD_FLOBDMD )
442                 res = (res || memcmp(dst->o_obdmd, src->o_obdmd));
443         */
444         return res;
445 }
446
447
448
449 int obd_register_type(struct obd_ops *ops, char *nm);
450 int obd_unregister_type(char *nm);
451
452 struct obd_client {
453         struct list_head cli_chain;
454         struct obd_device *cli_obd;
455         unsigned int cli_id;
456         unsigned long cli_prealloc_quota;
457         struct list_head cli_prealloc_inodes;
458 };
459
460
461 struct obd_prealloc_inode {
462         struct list_head obd_prealloc_chain;
463         unsigned long inode;
464 };
465
466 /* generic operations shared by various OBD types */
467 int gen_multi_setup(struct obd_device *obddev, uint32_t len, void *data);
468 int gen_multi_cleanup(struct obd_device *obddev);
469 int gen_multi_attach(struct obd_device *obddev, uint32_t len, void *data);
470 int gen_multi_detach(struct obd_device *obddev);
471 int gen_connect (struct obd_conn *conn);
472 int gen_disconnect(struct obd_conn *conn);
473 struct obd_client *gen_client(const struct obd_conn *);
474 int gen_cleanup(struct obd_device *obddev);
475 int gen_copy_data(struct obd_conn *dst_conn, struct obdo *dst,
476                   struct obd_conn *src_conn, struct obdo *src,
477                   obd_size count, obd_off offset);
478
479
480
481 /*
482  *  ======== OBD IOCL Declarations ===========
483  */
484 struct oic_generic {
485         uint32_t att_connid;
486         int      att_typelen;
487         void    *att_type;
488         int      att_datalen;
489         void    *att_data;
490 };
491
492
493 /* for preallocation */
494 struct oic_prealloc_s {
495         uint32_t         conn_id;
496         uint32_t         alloc; /* user sets it to the number of inodes
497                                  * requesting to be preallocated.  kernel
498                                  * sets it to the actual number of
499                                  * succesfully preallocated inodes */
500         obd_id           ids[32]; /* actual inode numbers */
501 };
502
503 /* for getattr, setattr, create, destroy */
504 struct oic_attr_s {
505         uint32_t         conn_id;
506         struct obdo      obdo;
507 };
508
509 /* for copy, migrate */
510 struct ioc_mv_s {
511         uint32_t         src_conn_id;
512         struct obdo      src;
513         uint32_t         dst_conn_id;
514         struct obdo      dst;
515 };
516
517 /* for read/write */
518 struct oic_rw_s {
519         uint32_t         conn_id;
520         struct obdo      obdo;
521         char            *buf;
522         obd_size         count;
523         obd_off          offset;
524 };
525
526 /* for punch, sync */
527 struct oic_range_s {
528         uint32_t         conn_id;
529         struct obdo      obdo;
530         obd_size         count;
531         obd_off          offset;
532 };
533
534
535 #define OBD_IOC_CREATE                 _IOR ('f',  3, long)
536 #define OBD_IOC_SETUP                  _IOW ('f',  4, long)
537 #define OBD_IOC_CLEANUP                _IO  ('f',  5      )
538 #define OBD_IOC_DESTROY                _IOW ('f',  6, long)
539 #define OBD_IOC_PREALLOCATE            _IOWR('f',  7, long)
540 #define OBD_IOC_DEC_USE_COUNT          _IO  ('f',  8      )
541 #define OBD_IOC_SETATTR                _IOW ('f',  9, long)
542 #define OBD_IOC_GETATTR                _IOR ('f', 10, long)
543 #define OBD_IOC_READ                   _IOWR('f', 11, long)
544 #define OBD_IOC_WRITE                  _IOWR('f', 12, long)
545 #define OBD_IOC_CONNECT                _IOR ('f', 13, long)
546 #define OBD_IOC_DISCONNECT             _IOW ('f', 14, long)
547 #define OBD_IOC_STATFS                 _IOWR('f', 15, long)
548 #define OBD_IOC_SYNC                   _IOR ('f', 16, long)
549 #define OBD_IOC_READ2                  _IOWR('f', 17, long)
550 #define OBD_IOC_FORMAT                 _IOWR('f', 18, long)
551 #define OBD_IOC_PARTITION              _IOWR('f', 19, long)
552 #define OBD_IOC_ATTACH                 _IOWR('f', 20, long)
553 #define OBD_IOC_DETACH                 _IOWR('f', 21, long)
554 #define OBD_IOC_COPY                   _IOWR('f', 22, long)
555 #define OBD_IOC_MIGR                   _IOWR('f', 23, long)
556 #define OBD_IOC_PUNCH                  _IOWR('f', 24, long)
557
558 #define OBD_IOC_DEC_FS_USE_COUNT       _IO  ('f', 32      )
559
560
561 /* sysctl.c */
562 extern void obd_sysctl_init (void);
563 extern void obd_sysctl_clean (void);
564
565 #define CHKCONN(conn)   do { if (!gen_client(conn)) {\
566                 printk("%s %d invalid client %u\n", __FILE__, __LINE__, \
567                        conn->oc_id);\
568                 return -EINVAL; }} while (0) 
569
570
571
572 #endif /* __LINUX_CLASS_OBD_H */