.. | .. |
---|
1 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
---|
2 | 2 | /* |
---|
3 | 3 | * fs/bfs/bfs.h |
---|
4 | | - * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com> |
---|
| 4 | + * Copyright (C) 1999-2018 Tigran Aivazian <aivazian.tigran@gmail.com> |
---|
5 | 5 | */ |
---|
6 | 6 | #ifndef _FS_BFS_BFS_H |
---|
7 | 7 | #define _FS_BFS_BFS_H |
---|
8 | 8 | |
---|
9 | 9 | #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 |
---|
10 | 17 | |
---|
11 | 18 | /* |
---|
12 | 19 | * BFS file system in-core superblock info |
---|
.. | .. |
---|
17 | 24 | unsigned long si_freei; |
---|
18 | 25 | unsigned long si_lf_eblk; |
---|
19 | 26 | unsigned long si_lasti; |
---|
20 | | - unsigned long *si_imap; |
---|
| 27 | + DECLARE_BITMAP(si_imap, BFS_MAX_LASTI+1); |
---|
21 | 28 | struct mutex bfs_lock; |
---|
22 | 29 | }; |
---|
23 | 30 | |
---|