Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: filesystems: convert sysv-fs.txt to ReST

- Add a SPDX header;
- Add a document title;
- Some whitespace fixes and new line breaks;
- Mark literal blocks as such;
- Add table markups;
- Add it to filesystems/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/5b96a6efba95773af439ab25a7dbe4d0edf8c867.1581955849.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
826a613d 86beb976

+112 -44
+1
Documentation/filesystems/index.rst
··· 88 88 romfs 89 89 squashfs 90 90 sysfs 91 + sysv-fs 91 92 virtiofs 92 93 vfat
+111 -44
Documentation/filesystems/sysv-fs.txt Documentation/filesystems/sysv-fs.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + ================== 4 + SystemV Filesystem 5 + ================== 6 + 1 7 It implements all of 2 8 - Xenix FS, 3 9 - SystemV/386 FS, 4 10 - Coherent FS. 5 11 6 12 To install: 13 + 7 14 * Answer the 'System V and Coherent filesystem support' question with 'y' 8 15 when configuring the kernel. 9 - * To mount a disk or a partition, use 16 + * To mount a disk or a partition, use:: 17 + 10 18 mount [-r] -t sysv device mountpoint 11 - The file system type names 19 + 20 + The file system type names:: 21 + 12 22 -t sysv 13 23 -t xenix 14 24 -t coherent 25 + 15 26 may be used interchangeably, but the last two will eventually disappear. 16 27 17 28 Bugs in the present implementation: 29 + 18 30 - Coherent FS: 31 + 19 32 - The "free list interleave" n:m is currently ignored. 20 33 - Only file systems with no filesystem name and no pack name are recognized. 21 - (See Coherent "man mkfs" for a description of these features.) 34 + (See Coherent "man mkfs" for a description of these features.) 35 + 22 36 - SystemV Release 2 FS: 37 + 23 38 The superblock is only searched in the blocks 9, 15, 18, which 24 39 corresponds to the beginning of track 1 on floppy disks. No support 25 40 for this FS on hard disk yet. ··· 43 28 These filesystems are rather similar. Here is a comparison with Minix FS: 44 29 45 30 * Linux fdisk reports on partitions 31 + 46 32 - Minix FS 0x81 Linux/Minix 47 33 - Xenix FS ?? 48 34 - SystemV FS ?? 49 35 - Coherent FS 0x08 AIX bootable 50 36 51 37 * Size of a block or zone (data allocation unit on disk) 38 + 52 39 - Minix FS 1024 53 40 - Xenix FS 1024 (also 512 ??) 54 41 - SystemV FS 1024 (also 512 and 2048) ··· 62 45 all the block numbers (including the super block) are offset by one track. 63 46 64 47 * Byte ordering of "short" (16 bit entities) on disk: 48 + 65 49 - Minix FS little endian 0 1 66 50 - Xenix FS little endian 0 1 67 51 - SystemV FS little endian 0 1 68 52 - Coherent FS little endian 0 1 53 + 69 54 Of course, this affects only the file system, not the data of files on it! 70 55 71 56 * Byte ordering of "long" (32 bit entities) on disk: 57 + 72 58 - Minix FS little endian 0 1 2 3 73 59 - Xenix FS little endian 0 1 2 3 74 60 - SystemV FS little endian 0 1 2 3 75 61 - Coherent FS PDP-11 2 3 0 1 62 + 76 63 Of course, this affects only the file system, not the data of files on it! 77 64 78 65 * Inode on disk: "short", 0 means non-existent, the root dir ino is: 79 - - Minix FS 1 80 - - Xenix FS, SystemV FS, Coherent FS 2 66 + 67 + ================================= == 68 + Minix FS 1 69 + Xenix FS, SystemV FS, Coherent FS 2 70 + ================================= == 81 71 82 72 * Maximum number of hard links to a file: 83 - - Minix FS 250 84 - - Xenix FS ?? 85 - - SystemV FS ?? 86 - - Coherent FS >=10000 73 + 74 + =========== ========= 75 + Minix FS 250 76 + Xenix FS ?? 77 + SystemV FS ?? 78 + Coherent FS >=10000 79 + =========== ========= 87 80 88 81 * Free inode management: 89 - - Minix FS a bitmap 82 + 83 + - Minix FS 84 + a bitmap 90 85 - Xenix FS, SystemV FS, Coherent FS 91 86 There is a cache of a certain number of free inodes in the super-block. 92 87 When it is exhausted, new free inodes are found using a linear search. 93 88 94 89 * Free block management: 95 - - Minix FS a bitmap 90 + 91 + - Minix FS 92 + a bitmap 96 93 - Xenix FS, SystemV FS, Coherent FS 97 94 Free blocks are organized in a "free list". Maybe a misleading term, 98 95 since it is not true that every free block contains a pointer to ··· 117 86 0 on Xenix FS and SystemV FS, with a block zeroed out on Coherent FS. 118 87 119 88 * Super-block location: 120 - - Minix FS block 1 = bytes 1024..2047 121 - - Xenix FS block 1 = bytes 1024..2047 122 - - SystemV FS bytes 512..1023 123 - - Coherent FS block 1 = bytes 512..1023 89 + 90 + =========== ========================== 91 + Minix FS block 1 = bytes 1024..2047 92 + Xenix FS block 1 = bytes 1024..2047 93 + SystemV FS bytes 512..1023 94 + Coherent FS block 1 = bytes 512..1023 95 + =========== ========================== 124 96 125 97 * Super-block layout: 126 - - Minix FS 98 + 99 + - Minix FS:: 100 + 127 101 unsigned short s_ninodes; 128 102 unsigned short s_nzones; 129 103 unsigned short s_imap_blocks; ··· 137 101 unsigned short s_log_zone_size; 138 102 unsigned long s_max_size; 139 103 unsigned short s_magic; 140 - - Xenix FS, SystemV FS, Coherent FS 104 + 105 + - Xenix FS, SystemV FS, Coherent FS:: 106 + 141 107 unsigned short s_firstdatazone; 142 108 unsigned long s_nzones; 143 109 unsigned short s_fzone_count; ··· 158 120 unsigned short s_interleave_m,s_interleave_n; -- Coherent FS only 159 121 char s_fname[6]; 160 122 char s_fpack[6]; 123 + 161 124 then they differ considerably: 162 - Xenix FS 125 + 126 + Xenix FS:: 127 + 163 128 char s_clean; 164 129 char s_fill[371]; 165 130 long s_magic; 166 131 long s_type; 167 - SystemV FS 132 + 133 + SystemV FS:: 134 + 168 135 long s_fill[12 or 14]; 169 136 long s_state; 170 137 long s_magic; 171 138 long s_type; 172 - Coherent FS 139 + 140 + Coherent FS:: 141 + 173 142 unsigned long s_unique; 143 + 174 144 Note that Coherent FS has no magic. 175 145 176 146 * Inode layout: 177 - - Minix FS 147 + 148 + - Minix FS:: 149 + 178 150 unsigned short i_mode; 179 151 unsigned short i_uid; 180 152 unsigned long i_size; ··· 192 144 unsigned char i_gid; 193 145 unsigned char i_nlinks; 194 146 unsigned short i_zone[7+1+1]; 195 - - Xenix FS, SystemV FS, Coherent FS 147 + 148 + - Xenix FS, SystemV FS, Coherent FS:: 149 + 196 150 unsigned short i_mode; 197 151 unsigned short i_nlink; 198 152 unsigned short i_uid; ··· 205 155 unsigned long i_mtime; 206 156 unsigned long i_ctime; 207 157 208 - * Regular file data blocks are organized as 209 - - Minix FS 210 - 7 direct blocks 211 - 1 indirect block (pointers to blocks) 212 - 1 double-indirect block (pointer to pointers to blocks) 213 - - Xenix FS, SystemV FS, Coherent FS 214 - 10 direct blocks 215 - 1 indirect block (pointers to blocks) 216 - 1 double-indirect block (pointer to pointers to blocks) 217 - 1 triple-indirect block (pointer to pointers to pointers to blocks) 218 158 219 - * Inode size, inodes per block 220 - - Minix FS 32 32 221 - - Xenix FS 64 16 222 - - SystemV FS 64 16 223 - - Coherent FS 64 8 159 + * Regular file data blocks are organized as 160 + 161 + - Minix FS: 162 + 163 + - 7 direct blocks 164 + - 1 indirect block (pointers to blocks) 165 + - 1 double-indirect block (pointer to pointers to blocks) 166 + 167 + - Xenix FS, SystemV FS, Coherent FS: 168 + 169 + - 10 direct blocks 170 + - 1 indirect block (pointers to blocks) 171 + - 1 double-indirect block (pointer to pointers to blocks) 172 + - 1 triple-indirect block (pointer to pointers to pointers to blocks) 173 + 174 + 175 + =========== ========== ================ 176 + Inode size inodes per block 177 + =========== ========== ================ 178 + Minix FS 32 32 179 + Xenix FS 64 16 180 + SystemV FS 64 16 181 + Coherent FS 64 8 182 + =========== ========== ================ 224 183 225 184 * Directory entry on disk 226 - - Minix FS 185 + 186 + - Minix FS:: 187 + 227 188 unsigned short inode; 228 189 char name[14/30]; 229 - - Xenix FS, SystemV FS, Coherent FS 190 + 191 + - Xenix FS, SystemV FS, Coherent FS:: 192 + 230 193 unsigned short inode; 231 194 char name[14]; 232 195 233 - * Dir entry size, dir entries per block 234 - - Minix FS 16/32 64/32 235 - - Xenix FS 16 64 236 - - SystemV FS 16 64 237 - - Coherent FS 16 32 196 + =========== ============== ===================== 197 + Dir entry size dir entries per block 198 + =========== ============== ===================== 199 + Minix FS 16/32 64/32 200 + Xenix FS 16 64 201 + SystemV FS 16 64 202 + Coherent FS 16 32 203 + =========== ============== ===================== 238 204 239 205 * How to implement symbolic links such that the host fsck doesn't scream: 206 + 240 207 - Minix FS normal 241 208 - Xenix FS kludge: as regular files with chmod 1000 242 209 - SystemV FS ??