git: 27acf8db5b69 - stable/14 - Convert fsidcmp(9) from macro to inline function
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 02 Jan 2024 00:42:04 UTC
The branch stable/14 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=27acf8db5b69fb0cdc8f52ecdeb6da2f49ec69f1
commit 27acf8db5b69fb0cdc8f52ecdeb6da2f49ec69f1
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-12-26 19:39:33 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-01-02 00:41:39 +0000
Convert fsidcmp(9) from macro to inline function
(cherry picked from commit 3334a537ed385e487a47208dab8f36b25643bcdb)
---
sys/sys/mount.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 70f4bc2b834e..2c2d4a0a479d 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -52,7 +52,12 @@
typedef struct fsid { int32_t val[2]; } fsid_t; /* filesystem id type */
-#define fsidcmp(a, b) memcmp((a), (b), sizeof(fsid_t))
+/* Returns non-zero if fsids are different. */
+static inline int
+fsidcmp(const fsid_t *a, const fsid_t *b)
+{
+ return (a->val[0] != b->val[0] || a->val[1] != b->val[1]);
+}
/*
* File identifier.