endif
if WITH_BTRFS
-libshadow_la_SOURCES += btrfs.c
+libshadow_la_SOURCES += btrfs.c btrfs.h
endif
if ENABLE_LASTLOG
+#include "config.h"
+
+#include "btrfs.h"
+
#include <linux/btrfs_tree.h>
#include <linux/magic.h>
#include <sys/statfs.h>
--- /dev/null
+// SPDX-FileCopyrightText: 2026, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#ifndef SHADOW_INCLUDE_LIB_BTRFS_H_
+#define SHADOW_INCLUDE_LIB_BTRFS_H_
+
+
+#include "config.h"
+
+#include <stdbool.h>
+#include <sys/statfs.h>
+
+
+#ifdef WITH_BTRFS
+int btrfs_create_subvolume(const char *path);
+int btrfs_remove_subvolume(const char *path);
+int btrfs_is_subvolume(const char *path);
+bool is_btrfs(const struct statfs *sfs);
+#endif
+
+
+#endif // include guard
#include <sys/socket.h>
#include <sys/stat.h>
-#include <sys/statfs.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
/* isexpired.c */
extern int isexpired (const struct passwd *, /*@null@*/const struct spwd *);
-/* btrfs.c */
-#ifdef WITH_BTRFS
-extern int btrfs_create_subvolume(const char *path);
-extern int btrfs_remove_subvolume(const char *path);
-extern int btrfs_is_subvolume(const char *path);
-extern bool is_btrfs(const struct statfs *sfs);
-#endif
-
/* basename() renamed to Basename() to avoid libc name space confusion */
/* basename.c */
extern /*@observer@*/const char *Basename (const char *str);
#include "alloc/malloc.h"
#include "atoi/a2i.h"
#include "atoi/getnum.h"
+#include "btrfs.h"
#include "chkname.h"
#include "defines.h"
#include "faillog.h"
#include <sys/types.h>
#include <unistd.h>
+#include "btrfs.h"
#include "defines.h"
#include "getdef.h"
#include "groupio.h"
#include "alloc/malloc.h"
#include "atoi/a2i.h"
#include "atoi/getnum.h"
+#include "btrfs.h"
#include "chkname.h"
#include "defines.h"
#include "faillog.h"