Coda Distributed File System
rec_dllist.h
Go to the documentation of this file.
1/* BLURB gpl
2
3 Coda File System
4 Release 8
5
6 Copyright (c) 2003-2021 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU General Public Licence Version 2, as shown in the
11file LICENSE. The technical and financial contributors to Coda are
12listed in the file CREDITS.
13
14 Additional copyrights
15 none currently
16#*/
17
18#ifndef _REC_DLLIST_H_
19#define _REC_DLLIST_H_
20
21#include <dllist.h>
22#include <rvmlib.h>
23
24/* persistent dllist helpers */
25
26static inline void
27rec_list_head_init(struct dllist_head *p) REQUIRES_TRANSACTION
28{
31}
32
33static inline void rec_list_add(struct dllist_head *p,
35{
37 RVMLIB_REC_OBJECT(h->next);
38 RVMLIB_REC_OBJECT(h->next->prev);
39 list_add(p, h);
40}
41
42static inline void rec_list_del(struct dllist_head *p) REQUIRES_TRANSACTION
43{
45 if (!list_empty(p)) {
46 RVMLIB_REC_OBJECT(p->next->prev);
47 RVMLIB_REC_OBJECT(p->prev->next);
48 }
49 list_del(p);
50}
51
52#endif /* _REC_DLLIST_H_ */
void list_head_init(struct dllist_head *ptr)
Definition: dllist.c:21
#define REQUIRES_TRANSACTION
Definition: coda_tsa.h:107
#define list_empty(head)
Definition: dllist.h:54
#define list_add(entry, head)
Definition: dllist.h:37
#define list_del(entry)
Definition: dllist.h:46
#define RVMLIB_REC_OBJECT(object)
Definition: rvmlib.h:126
Definition: dllist.h:30