diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 22:36:45 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-31 19:18:37 +0300 |
commit | d5eade93452bd1a892e2155e9bb723f04992bdac (patch) | |
tree | 2642da5698805104a8678fb49dd83da43cc8fa7b /fs/bcachefs/bbpos_types.h | |
parent | 633169035a7ccdfe3a9eba0202dc2135baa07c72 (diff) | |
download | linux-d5eade93452bd1a892e2155e9bb723f04992bdac.tar.xz |
bcachefs: move: convert to bbpos
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bbpos_types.h')
-rw-r--r-- | fs/bcachefs/bbpos_types.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/bcachefs/bbpos_types.h b/fs/bcachefs/bbpos_types.h new file mode 100644 index 000000000000..5198e94cf3b8 --- /dev/null +++ b/fs/bcachefs/bbpos_types.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _BCACHEFS_BBPOS_TYPES_H +#define _BCACHEFS_BBPOS_TYPES_H + +struct bbpos { + enum btree_id btree; + struct bpos pos; +}; + +static inline struct bbpos BBPOS(enum btree_id btree, struct bpos pos) +{ + return (struct bbpos) { btree, pos }; +} + +#define BBPOS_MIN BBPOS(0, POS_MIN) +#define BBPOS_MAX BBPOS(BTREE_ID_NR - 1, POS_MAX) + +#endif /* _BCACHEFS_BBPOS_TYPES_H */ |