xref: /haiku/src/add-ons/kernel/file_systems/websearchfs/vnidpool.h (revision 96e28a400a120f6f1289929c8c92f68bb2dbaf93)
1*96e28a40SPulkoMandy /*
2*96e28a40SPulkoMandy  * Copyright 2004-2008, François Revol, <revol@free.fr>.
3*96e28a40SPulkoMandy  * Distributed under the terms of the MIT License.
4*96e28a40SPulkoMandy  */
5*96e28a40SPulkoMandy #ifndef _VNIDPOOL_H
6*96e28a40SPulkoMandy #define _VNIDPOOL_H
7*96e28a40SPulkoMandy 
8*96e28a40SPulkoMandy #include "websearchfs.h"
9*96e28a40SPulkoMandy 
10*96e28a40SPulkoMandy typedef struct vnidpool {
11*96e28a40SPulkoMandy 	lock lock;
12*96e28a40SPulkoMandy 	ino_t nextvnid;
13*96e28a40SPulkoMandy 	uint32 *bitmap;
14*96e28a40SPulkoMandy 	size_t bmsize;
15*96e28a40SPulkoMandy } vnidpool;
16*96e28a40SPulkoMandy 
17*96e28a40SPulkoMandy status_t vnidpool_alloc(struct vnidpool **pool, size_t size);
18*96e28a40SPulkoMandy status_t vnidpool_free(struct vnidpool *pool);
19*96e28a40SPulkoMandy status_t vnidpool_get(struct vnidpool *pool, ino_t *vnid);
20*96e28a40SPulkoMandy status_t vnidpool_put(struct vnidpool *pool, ino_t vnid);
21*96e28a40SPulkoMandy 
22*96e28a40SPulkoMandy #endif /* _VNIDPOOL_H */
23