From 0c7ea66f57ad0b0bfbb0aba6f5cb3de9b8650ef8 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 2 Apr 2018 09:15:19 -0700 Subject: [PATCH] scoutfs: add SIC_EXACT Add an item count call that lets the caller give the exact item count instead of basing it on the operation they're performing. Signed-off-by: Zach Brown --- kmod/src/count.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kmod/src/count.h b/kmod/src/count.h index fc2f993e..0135fb81 100644 --- a/kmod/src/count.h +++ b/kmod/src/count.h @@ -22,6 +22,18 @@ struct scoutfs_item_count { signed vals; }; +/* The caller knows exactly what they're doing. */ +static inline const struct scoutfs_item_count SIC_EXACT(signed items, + signed vals) +{ + struct scoutfs_item_count cnt = { + .items = items, + .vals = vals, + }; + + return cnt; +} + /* * Allocating an inode creates a new set of indexed items. */