hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/bfs/bfs.h
....@@ -1,12 +1,19 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 /*
33 * fs/bfs/bfs.h
4
- * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com>
4
+ * Copyright (C) 1999-2018 Tigran Aivazian <aivazian.tigran@gmail.com>
55 */
66 #ifndef _FS_BFS_BFS_H
77 #define _FS_BFS_BFS_H
88
99 #include <linux/bfs_fs.h>
10
+
11
+/* In theory BFS supports up to 512 inodes, numbered from 2 (for /) up to 513 inclusive.
12
+ In actual fact, attempting to create the 512th inode (i.e. inode No. 513 or file No. 511)
13
+ will fail with ENOSPC in bfs_add_entry(): the root directory cannot contain so many entries, counting '..'.
14
+ So, mkfs.bfs(8) should really limit its -N option to 511 and not 512. For now, we just print a warning
15
+ if a filesystem is mounted with such "impossible to fill up" number of inodes */
16
+#define BFS_MAX_LASTI 513
1017
1118 /*
1219 * BFS file system in-core superblock info
....@@ -17,7 +24,7 @@
1724 unsigned long si_freei;
1825 unsigned long si_lf_eblk;
1926 unsigned long si_lasti;
20
- unsigned long *si_imap;
27
+ DECLARE_BITMAP(si_imap, BFS_MAX_LASTI+1);
2128 struct mutex bfs_lock;
2229 };
2330