BTRFS: Node now holding Volume instead of cache to retrieve more values
[haiku.git] / src / add-ons / kernel / file_systems / btrfs / Utility.h
blob6f7430fb2f68ac5c8d8d8c565d241bd13aa80d4c
1 /*
2 * Copyright 2001-2009, Axel Dörfler, axeld@pinc-software.de.
3 * This file may be used under the terms of the MIT License.
4 */
5 #ifndef UTILITY_H
6 #define UTILITY_H
9 #include "btrfs.h"
12 enum inode_type {
13 S_DIRECTORY = S_IFDIR,
14 S_FILE = S_IFREG,
15 S_SYMLINK = S_IFLNK,
17 S_INDEX_TYPES = (S_STR_INDEX | S_INT_INDEX | S_UINT_INDEX
18 | S_LONG_LONG_INDEX | S_ULONG_LONG_INDEX
19 | S_FLOAT_INDEX | S_DOUBLE_INDEX),
21 S_EXTENDED_TYPES = (S_ATTR_DIR | S_ATTR | S_INDEX_DIR)
25 /*! Converts the open mode, the open flags given to bfs_open(), into
26 access modes, e.g. since O_RDONLY requires read access to the
27 file, it will be converted to R_OK.
29 inline int
30 open_mode_to_access(int openMode)
32 openMode &= O_RWMASK;
33 if (openMode == O_RDONLY)
34 return R_OK;
35 if (openMode == O_WRONLY)
36 return W_OK;
38 return R_OK | W_OK;
42 #endif // UTILITY_H