Whamcloud - gitweb
LU-13048 mdd: allow release after a non-blocking migrate
[fs/lustre-release.git] / lustre / utils / ofd_access_batch.h
1 #ifndef _OFD_ACCESS_BATCH_H_
2 #define _OFD_ACCESS_BATCH_H_
3 #include <pthread.h>
4 #include <sys/types.h>
5 #include <linux/types.h>
6 #include <libcfs/util/list.h>
7
8 struct lu_fid;
9 struct alr_batch;
10
11 struct alr_batch *alr_batch_create(unsigned int shift);
12 void alr_batch_destroy(struct alr_batch *alrb);
13 int alr_batch_add(struct alr_batch *alrb, const char *obd_name,
14                 const struct lu_fid *pfid, time_t time, __u64 begin, __u64 end,
15                 __u32 size, __u32 segment_count, __u32 flags);
16 int alr_batch_print(struct alr_batch *alrb, FILE *file,
17                     pthread_mutex_t *file_mutex, int fraction);
18
19 /*
20  * The code is inspired by the kernel list implementation. Hence, this has
21  * a weird param order to be consistent with the kernel list_replace_init().
22  */
23 static inline void list_replace_init(struct list_head *old_node,
24                                      struct list_head *new_node)
25 {
26         list_add(new_node, old_node);
27         list_del_init(old_node);
28 }
29
30 #endif /* _OFD_ACCESS_BATCH_H_ */