Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / include / darwin / obd.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Copyright (C) 2001, 2002 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 #ifndef __DARWIN_OBD_H
11 #define __DARWIN_OBD_H
12
13 #ifndef __OBD_H
14 #error Do not #include this file directly. #include <obd.h> instead
15 #endif
16
17 #include <libcfs/libcfs.h>
18
19 typedef struct semaphore client_obd_lock_t;
20
21 static inline void client_obd_list_lock_init(client_obd_lock_t *lock)
22 {
23         sema_init(lock, 1);
24 }
25
26 static inline void client_obd_list_lock_done(client_obd_lock_t *lock)
27 {}
28
29 static inline void client_obd_list_lock(client_obd_lock_t *lock)
30 {
31         mutex_down(lock);
32 }
33
34 static inline void client_obd_list_unlock(client_obd_lock_t *lock)
35 {
36         mutex_up(lock);
37 }
38
39 #endif /* __DARWIN_OBD_H */