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