aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r--Documentation/filesystems/autofs4-mount-control.txt393
-rw-r--r--Documentation/filesystems/ext3.txt8
-rw-r--r--Documentation/filesystems/ext4.txt51
-rw-r--r--Documentation/filesystems/fiemap.txt228
-rw-r--r--Documentation/filesystems/nfsroot.txt2
-rw-r--r--Documentation/filesystems/ocfs2.txt6
-rw-r--r--Documentation/filesystems/proc.txt114
-rw-r--r--Documentation/filesystems/ramfs-rootfs-initramfs.txt2
8 files changed, 728 insertions, 76 deletions
diff --git a/Documentation/filesystems/autofs4-mount-control.txt b/Documentation/filesystems/autofs4-mount-control.txt
new file mode 100644
index 000000000000..c6341745df37
--- /dev/null
+++ b/Documentation/filesystems/autofs4-mount-control.txt
@@ -0,0 +1,393 @@
1
2Miscellaneous Device control operations for the autofs4 kernel module
3====================================================================
4
5The problem
6===========
7
8There is a problem with active restarts in autofs (that is to say
9restarting autofs when there are busy mounts).
10
11During normal operation autofs uses a file descriptor opened on the
12directory that is being managed in order to be able to issue control
13operations. Using a file descriptor gives ioctl operations access to
14autofs specific information stored in the super block. The operations
15are things such as setting an autofs mount catatonic, setting the
16expire timeout and requesting expire checks. As is explained below,
17certain types of autofs triggered mounts can end up covering an autofs
18mount itself which prevents us being able to use open(2) to obtain a
19file descriptor for these operations if we don't already have one open.
20
21Currently autofs uses "umount -l" (lazy umount) to clear active mounts
22at restart. While using lazy umount works for most cases, anything that
23needs to walk back up the mount tree to construct a path, such as
24getcwd(2) and the proc file system /proc/<pid>/cwd, no longer works
25because the point from which the path is constructed has been detached
26from the mount tree.
27
28The actual problem with autofs is that it can't reconnect to existing
29mounts. Immediately one thinks of just adding the ability to remount
30autofs file systems would solve it, but alas, that can't work. This is
31because autofs direct mounts and the implementation of "on demand mount
32and expire" of nested mount trees have the file system mounted directly
33on top of the mount trigger directory dentry.
34
35For example, there are two types of automount maps, direct (in the kernel
36module source you will see a third type called an offset, which is just
37a direct mount in disguise) and indirect.
38
39Here is a master map with direct and indirect map entries:
40
41/- /etc/auto.direct
42/test /etc/auto.indirect
43
44and the corresponding map files:
45
46/etc/auto.direct:
47
48/automount/dparse/g6 budgie:/autofs/export1
49/automount/dparse/g1 shark:/autofs/export1
50and so on.
51
52/etc/auto.indirect:
53
54g1 shark:/autofs/export1
55g6 budgie:/autofs/export1
56and so on.
57
58For the above indirect map an autofs file system is mounted on /test and
59mounts are triggered for each sub-directory key by the inode lookup
60operation. So we see a mount of shark:/autofs/export1 on /test/g1, for
61example.
62
63The way that direct mounts are handled is by making an autofs mount on
64each full path, such as /automount/dparse/g1, and using it as a mount
65trigger. So when we walk on the path we mount shark:/autofs/export1 "on
66top of this mount point". Since these are always directories we can
67use the follow_link inode operation to trigger the mount.
68
69But, each entry in direct and indirect maps can have offsets (making
70them multi-mount map entries).
71
72For example, an indirect mount map entry could also be:
73
74g1 \
75 / shark:/autofs/export5/testing/test \
76 /s1 shark:/autofs/export/testing/test/s1 \
77 /s2 shark:/autofs/export5/testing/test/s2 \
78 /s1/ss1 shark:/autofs/export1 \
79 /s2/ss2 shark:/autofs/export2
80
81and a similarly a direct mount map entry could also be:
82
83/automount/dparse/g1 \
84 / shark:/autofs/export5/testing/test \
85 /s1 shark:/autofs/export/testing/test/s1 \
86 /s2 shark:/autofs/export5/testing/test/s2 \
87 /s1/ss1 shark:/autofs/export2 \
88 /s2/ss2 shark:/autofs/export2
89
90One of the issues with version 4 of autofs was that, when mounting an
91entry with a large number of offsets, possibly with nesting, we needed
92to mount and umount all of the offsets as a single unit. Not really a
93problem, except for people with a large number of offsets in map entries.
94This mechanism is used for the well known "hosts" map and we have seen
95cases (in 2.4) where the available number of mounts are exhausted or
96where the number of privileged ports available is exhausted.
97
98In version 5 we mount only as we go down the tree of offsets and
99similarly for expiring them which resolves the above problem. There is
100somewhat more detail to the implementation but it isn't needed for the
101sake of the problem explanation. The one important detail is that these
102offsets are implemented using the same mechanism as the direct mounts
103above and so the mount points can be covered by a mount.
104
105The current autofs implementation uses an ioctl file descriptor opened
106on the mount point for control operations. The references held by the
107descriptor are accounted for in checks made to determine if a mount is
108in use and is also used to access autofs file system information held
109in the mount super block. So the use of a file handle needs to be
110retained.
111
112
113The Solution
114============
115
116To be able to restart autofs leaving existing direct, indirect and
117offset mounts in place we need to be able to obtain a file handle
118for these potentially covered autofs mount points. Rather than just
119implement an isolated operation it was decided to re-implement the
120existing ioctl interface and add new operations to provide this
121functionality.
122
123In addition, to be able to reconstruct a mount tree that has busy mounts,
124the uid and gid of the last user that triggered the mount needs to be
125available because these can be used as macro substitution variables in
126autofs maps. They are recorded at mount request time and an operation
127has been added to retrieve them.
128
129Since we're re-implementing the control interface, a couple of other
130problems with the existing interface have been addressed. First, when
131a mount or expire operation completes a status is returned to the
132kernel by either a "send ready" or a "send fail" operation. The
133"send fail" operation of the ioctl interface could only ever send
134ENOENT so the re-implementation allows user space to send an actual
135status. Another expensive operation in user space, for those using
136very large maps, is discovering if a mount is present. Usually this
137involves scanning /proc/mounts and since it needs to be done quite
138often it can introduce significant overhead when there are many entries
139in the mount table. An operation to lookup the mount status of a mount
140point dentry (covered or not) has also been added.
141
142Current kernel development policy recommends avoiding the use of the
143ioctl mechanism in favor of systems such as Netlink. An implementation
144using this system was attempted to evaluate its suitability and it was
145found to be inadequate, in this case. The Generic Netlink system was
146used for this as raw Netlink would lead to a significant increase in
147complexity. There's no question that the Generic Netlink system is an
148elegant solution for common case ioctl functions but it's not a complete
149replacement probably because it's primary purpose in life is to be a
150message bus implementation rather than specifically an ioctl replacement.
151While it would be possible to work around this there is one concern
152that lead to the decision to not use it. This is that the autofs
153expire in the daemon has become far to complex because umount
154candidates are enumerated, almost for no other reason than to "count"
155the number of times to call the expire ioctl. This involves scanning
156the mount table which has proved to be a big overhead for users with
157large maps. The best way to improve this is try and get back to the
158way the expire was done long ago. That is, when an expire request is
159issued for a mount (file handle) we should continually call back to
160the daemon until we can't umount any more mounts, then return the
161appropriate status to the daemon. At the moment we just expire one
162mount at a time. A Generic Netlink implementation would exclude this
163possibility for future development due to the requirements of the
164message bus architecture.
165
166
167autofs4 Miscellaneous Device mount control interface
168====================================================
169
170The control interface is opening a device node, typically /dev/autofs.
171
172All the ioctls use a common structure to pass the needed parameter
173information and return operation results:
174
175struct autofs_dev_ioctl {
176 __u32 ver_major;
177 __u32 ver_minor;
178 __u32 size; /* total size of data passed in
179 * including this struct */
180 __s32 ioctlfd; /* automount command fd */
181
182 __u32 arg1; /* Command parameters */
183 __u32 arg2;
184
185 char path[0];
186};
187
188The ioctlfd field is a mount point file descriptor of an autofs mount
189point. It is returned by the open call and is used by all calls except
190the check for whether a given path is a mount point, where it may
191optionally be used to check a specific mount corresponding to a given
192mount point file descriptor, and when requesting the uid and gid of the
193last successful mount on a directory within the autofs file system.
194
195The fields arg1 and arg2 are used to communicate parameters and results of
196calls made as described below.
197
198The path field is used to pass a path where it is needed and the size field
199is used account for the increased structure length when translating the
200structure sent from user space.
201
202This structure can be initialized before setting specific fields by using
203the void function call init_autofs_dev_ioctl(struct autofs_dev_ioctl *).
204
205All of the ioctls perform a copy of this structure from user space to
206kernel space and return -EINVAL if the size parameter is smaller than
207the structure size itself, -ENOMEM if the kernel memory allocation fails
208or -EFAULT if the copy itself fails. Other checks include a version check
209of the compiled in user space version against the module version and a
210mismatch results in a -EINVAL return. If the size field is greater than
211the structure size then a path is assumed to be present and is checked to
212ensure it begins with a "/" and is NULL terminated, otherwise -EINVAL is
213returned. Following these checks, for all ioctl commands except
214AUTOFS_DEV_IOCTL_VERSION_CMD, AUTOFS_DEV_IOCTL_OPENMOUNT_CMD and
215AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD the ioctlfd is validated and if it is
216not a valid descriptor or doesn't correspond to an autofs mount point
217an error of -EBADF, -ENOTTY or -EINVAL (not an autofs descriptor) is
218returned.
219
220
221The ioctls
222==========
223
224An example of an implementation which uses this interface can be seen
225in autofs version 5.0.4 and later in file lib/dev-ioctl-lib.c of the
226distribution tar available for download from kernel.org in directory
227/pub/linux/daemons/autofs/v5.
228
229The device node ioctl operations implemented by this interface are:
230
231
232AUTOFS_DEV_IOCTL_VERSION
233------------------------
234
235Get the major and minor version of the autofs4 device ioctl kernel module
236implementation. It requires an initialized struct autofs_dev_ioctl as an
237input parameter and sets the version information in the passed in structure.
238It returns 0 on success or the error -EINVAL if a version mismatch is
239detected.
240
241
242AUTOFS_DEV_IOCTL_PROTOVER_CMD and AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD
243------------------------------------------------------------------
244
245Get the major and minor version of the autofs4 protocol version understood
246by loaded module. This call requires an initialized struct autofs_dev_ioctl
247with the ioctlfd field set to a valid autofs mount point descriptor
248and sets the requested version number in structure field arg1. These
249commands return 0 on success or one of the negative error codes if
250validation fails.
251
252
253AUTOFS_DEV_IOCTL_OPENMOUNT and AUTOFS_DEV_IOCTL_CLOSEMOUNT
254----------------------------------------------------------
255
256Obtain and release a file descriptor for an autofs managed mount point
257path. The open call requires an initialized struct autofs_dev_ioctl with
258the the path field set and the size field adjusted appropriately as well
259as the arg1 field set to the device number of the autofs mount. The
260device number can be obtained from the mount options shown in
261/proc/mounts. The close call requires an initialized struct
262autofs_dev_ioct with the ioctlfd field set to the descriptor obtained
263from the open call. The release of the file descriptor can also be done
264with close(2) so any open descriptors will also be closed at process exit.
265The close call is included in the implemented operations largely for
266completeness and to provide for a consistent user space implementation.
267
268
269AUTOFS_DEV_IOCTL_READY_CMD and AUTOFS_DEV_IOCTL_FAIL_CMD
270--------------------------------------------------------
271
272Return mount and expire result status from user space to the kernel.
273Both of these calls require an initialized struct autofs_dev_ioctl
274with the ioctlfd field set to the descriptor obtained from the open
275call and the arg1 field set to the wait queue token number, received
276by user space in the foregoing mount or expire request. The arg2 field
277is set to the status to be returned. For the ready call this is always
2780 and for the fail call it is set to the errno of the operation.
279
280
281AUTOFS_DEV_IOCTL_SETPIPEFD_CMD
282------------------------------
283
284Set the pipe file descriptor used for kernel communication to the daemon.
285Normally this is set at mount time using an option but when reconnecting
286to a existing mount we need to use this to tell the autofs mount about
287the new kernel pipe descriptor. In order to protect mounts against
288incorrectly setting the pipe descriptor we also require that the autofs
289mount be catatonic (see next call).
290
291The call requires an initialized struct autofs_dev_ioctl with the
292ioctlfd field set to the descriptor obtained from the open call and
293the arg1 field set to descriptor of the pipe. On success the call
294also sets the process group id used to identify the controlling process
295(eg. the owning automount(8) daemon) to the process group of the caller.
296
297
298AUTOFS_DEV_IOCTL_CATATONIC_CMD
299------------------------------
300
301Make the autofs mount point catatonic. The autofs mount will no longer
302issue mount requests, the kernel communication pipe descriptor is released
303and any remaining waits in the queue released.
304
305The call requires an initialized struct autofs_dev_ioctl with the
306ioctlfd field set to the descriptor obtained from the open call.
307
308
309AUTOFS_DEV_IOCTL_TIMEOUT_CMD
310----------------------------
311
312Set the expire timeout for mounts withing an autofs mount point.
313
314The call requires an initialized struct autofs_dev_ioctl with the
315ioctlfd field set to the descriptor obtained from the open call.
316
317
318AUTOFS_DEV_IOCTL_REQUESTER_CMD
319------------------------------
320
321Return the uid and gid of the last process to successfully trigger a the
322mount on the given path dentry.
323
324The call requires an initialized struct autofs_dev_ioctl with the path
325field set to the mount point in question and the size field adjusted
326appropriately as well as the arg1 field set to the device number of the
327containing autofs mount. Upon return the struct field arg1 contains the
328uid and arg2 the gid.
329
330When reconstructing an autofs mount tree with active mounts we need to
331re-connect to mounts that may have used the original process uid and
332gid (or string variations of them) for mount lookups within the map entry.
333This call provides the ability to obtain this uid and gid so they may be
334used by user space for the mount map lookups.
335
336
337AUTOFS_DEV_IOCTL_EXPIRE_CMD
338---------------------------
339
340Issue an expire request to the kernel for an autofs mount. Typically
341this ioctl is called until no further expire candidates are found.
342
343The call requires an initialized struct autofs_dev_ioctl with the
344ioctlfd field set to the descriptor obtained from the open call. In
345addition an immediate expire, independent of the mount timeout, can be
346requested by setting the arg1 field to 1. If no expire candidates can
347be found the ioctl returns -1 with errno set to EAGAIN.
348
349This call causes the kernel module to check the mount corresponding
350to the given ioctlfd for mounts that can be expired, issues an expire
351request back to the daemon and waits for completion.
352
353AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD
354------------------------------
355
356Checks if an autofs mount point is in use.
357
358The call requires an initialized struct autofs_dev_ioctl with the
359ioctlfd field set to the descriptor obtained from the open call and
360it returns the result in the arg1 field, 1 for busy and 0 otherwise.
361
362
363AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD
364---------------------------------
365
366Check if the given path is a mountpoint.
367
368The call requires an initialized struct autofs_dev_ioctl. There are two
369possible variations. Both use the path field set to the path of the mount
370point to check and the size field adjusted appropriately. One uses the
371ioctlfd field to identify a specific mount point to check while the other
372variation uses the path and optionaly arg1 set to an autofs mount type.
373The call returns 1 if this is a mount point and sets arg1 to the device
374number of the mount and field arg2 to the relevant super block magic
375number (described below) or 0 if it isn't a mountpoint. In both cases
376the the device number (as returned by new_encode_dev()) is returned
377in field arg1.
378
379If supplied with a file descriptor we're looking for a specific mount,
380not necessarily at the top of the mounted stack. In this case the path
381the descriptor corresponds to is considered a mountpoint if it is itself
382a mountpoint or contains a mount, such as a multi-mount without a root
383mount. In this case we return 1 if the descriptor corresponds to a mount
384point and and also returns the super magic of the covering mount if there
385is one or 0 if it isn't a mountpoint.
386
387If a path is supplied (and the ioctlfd field is set to -1) then the path
388is looked up and is checked to see if it is the root of a mount. If a
389type is also given we are looking for a particular autofs mount and if
390a match isn't found a fail is returned. If the the located path is the
391root of a mount 1 is returned along with the super magic of the mount
392or 0 otherwise.
393
diff --git a/Documentation/filesystems/ext3.txt b/Documentation/filesystems/ext3.txt
index b45f3c1b8b43..9dd2a3bb2acc 100644
--- a/Documentation/filesystems/ext3.txt
+++ b/Documentation/filesystems/ext3.txt
@@ -96,6 +96,11 @@ errors=remount-ro(*) Remount the filesystem read-only on an error.
96errors=continue Keep going on a filesystem error. 96errors=continue Keep going on a filesystem error.
97errors=panic Panic and halt the machine if an error occurs. 97errors=panic Panic and halt the machine if an error occurs.
98 98
99data_err=ignore(*) Just print an error message if an error occurs
100 in a file data buffer in ordered mode.
101data_err=abort Abort the journal if an error occurs in a file
102 data buffer in ordered mode.
103
99grpid Give objects the same group ID as their creator. 104grpid Give objects the same group ID as their creator.
100bsdgroups 105bsdgroups
101 106
@@ -193,6 +198,5 @@ kernel source: <file:fs/ext3/>
193programs: http://e2fsprogs.sourceforge.net/ 198programs: http://e2fsprogs.sourceforge.net/
194 http://ext2resize.sourceforge.net 199 http://ext2resize.sourceforge.net
195 200
196useful links: http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html 201useful links: http://www-106.ibm.com/developerworks/linux/library/l-fs7/
197 http://www-106.ibm.com/developerworks/linux/library/l-fs7/
198 http://www-106.ibm.com/developerworks/linux/library/l-fs8/ 202 http://www-106.ibm.com/developerworks/linux/library/l-fs8/
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt
index 0d5394920a31..174eaff7ded9 100644
--- a/Documentation/filesystems/ext4.txt
+++ b/Documentation/filesystems/ext4.txt
@@ -2,19 +2,24 @@
2Ext4 Filesystem 2Ext4 Filesystem
3=============== 3===============
4 4
5This is a development version of the ext4 filesystem, an advanced level 5Ext4 is an an advanced level of the ext3 filesystem which incorporates
6of the ext3 filesystem which incorporates scalability and reliability 6scalability and reliability enhancements for supporting large filesystems
7enhancements for supporting large filesystems (64 bit) in keeping with 7(64 bit) in keeping with increasing disk capacities and state-of-the-art
8increasing disk capacities and state-of-the-art feature requirements. 8feature requirements.
9 9
10Mailing list: linux-ext4@vger.kernel.org 10Mailing list: linux-ext4@vger.kernel.org
11Web site: http://ext4.wiki.kernel.org
11 12
12 13
131. Quick usage instructions: 141. Quick usage instructions:
14=========================== 15===========================
15 16
17Note: More extensive information for getting started with ext4 can be
18 found at the ext4 wiki site at the URL:
19 http://ext4.wiki.kernel.org/index.php/Ext4_Howto
20
16 - Compile and install the latest version of e2fsprogs (as of this 21 - Compile and install the latest version of e2fsprogs (as of this
17 writing version 1.41) from: 22 writing version 1.41.3) from:
18 23
19 http://sourceforge.net/project/showfiles.php?group_id=2406 24 http://sourceforge.net/project/showfiles.php?group_id=2406
20 25
@@ -32,28 +37,26 @@ Mailing list: linux-ext4@vger.kernel.org
32 you will need to merge your changes with the version from e2fsprogs 37 you will need to merge your changes with the version from e2fsprogs
33 1.41.x. 38 1.41.x.
34 39
35 - Create a new filesystem using the ext4dev filesystem type: 40 - Create a new filesystem using the ext4 filesystem type:
36 41
37 # mke2fs -t ext4dev /dev/hda1 42 # mke2fs -t ext4 /dev/hda1
38 43
39 Or configure an existing ext3 filesystem to support extents and set 44 Or to configure an existing ext3 filesystem to support extents:
40 the test_fs flag to indicate that it's ok for an in-development
41 filesystem to touch this filesystem:
42 45
43 # tune2fs -O extents -E test_fs /dev/hda1 46 # tune2fs -O extents /dev/hda1
44 47
45 If the filesystem was created with 128 byte inodes, it can be 48 If the filesystem was created with 128 byte inodes, it can be
46 converted to use 256 byte for greater efficiency via: 49 converted to use 256 byte for greater efficiency via:
47 50
48 # tune2fs -I 256 /dev/hda1 51 # tune2fs -I 256 /dev/hda1
49 52
50 (Note: we currently do not have tools to convert an ext4dev 53 (Note: we currently do not have tools to convert an ext4
51 filesystem back to ext3; so please do not do try this on production 54 filesystem back to ext3; so please do not do try this on production
52 filesystems.) 55 filesystems.)
53 56
54 - Mounting: 57 - Mounting:
55 58
56 # mount -t ext4dev /dev/hda1 /wherever 59 # mount -t ext4 /dev/hda1 /wherever
57 60
58 - When comparing performance with other filesystems, remember that 61 - When comparing performance with other filesystems, remember that
59 ext3/4 by default offers higher data integrity guarantees than most. 62 ext3/4 by default offers higher data integrity guarantees than most.
@@ -104,8 +107,8 @@ exist yet so I'm not sure they're in the near-term roadmap.
104The big performance win will come with mballoc, delalloc and flex_bg 107The big performance win will come with mballoc, delalloc and flex_bg
105grouping of bitmaps and inode tables. Some test results available here: 108grouping of bitmaps and inode tables. Some test results available here:
106 109
107 - http://www.bullopensource.org/ext4/20080530/ffsb-write-2.6.26-rc2.html 110 - http://www.bullopensource.org/ext4/20080818-ffsb/ffsb-write-2.6.27-rc1.html
108 - http://www.bullopensource.org/ext4/20080530/ffsb-readwrite-2.6.26-rc2.html 111 - http://www.bullopensource.org/ext4/20080818-ffsb/ffsb-readwrite-2.6.27-rc1.html
109 112
1103. Options 1133. Options
111========== 114==========
@@ -177,6 +180,11 @@ barrier=<0|1(*)> This enables/disables the use of write barriers in
177 your disks are battery-backed in one way or another, 180 your disks are battery-backed in one way or another,
178 disabling barriers may safely improve performance. 181 disabling barriers may safely improve performance.
179 182
183inode_readahead=n This tuning parameter controls the maximum
184 number of inode table blocks that ext4's inode
185 table readahead algorithm will pre-read into
186 the buffer cache. The default value is 32 blocks.
187
180orlov (*) This enables the new Orlov block allocator. It is 188orlov (*) This enables the new Orlov block allocator. It is
181 enabled by default. 189 enabled by default.
182 190
@@ -209,15 +217,17 @@ noreservation
209bsddf (*) Make 'df' act like BSD. 217bsddf (*) Make 'df' act like BSD.
210minixdf Make 'df' act like Minix. 218minixdf Make 'df' act like Minix.
211 219
212check=none Don't do extra checking of bitmaps on mount.
213nocheck
214
215debug Extra debugging information is sent to syslog. 220debug Extra debugging information is sent to syslog.
216 221
217errors=remount-ro(*) Remount the filesystem read-only on an error. 222errors=remount-ro(*) Remount the filesystem read-only on an error.
218errors=continue Keep going on a filesystem error. 223errors=continue Keep going on a filesystem error.
219errors=panic Panic and halt the machine if an error occurs. 224errors=panic Panic and halt the machine if an error occurs.
220 225
226data_err=ignore(*) Just print an error message if an error occurs
227 in a file data buffer in ordered mode.
228data_err=abort Abort the journal if an error occurs in a file
229 data buffer in ordered mode.
230
221grpid Give objects the same group ID as their creator. 231grpid Give objects the same group ID as their creator.
222bsdgroups 232bsdgroups
223 233
@@ -243,8 +253,6 @@ nobh (a) cache disk block mapping information
243 "nobh" option tries to avoid associating buffer 253 "nobh" option tries to avoid associating buffer
244 heads (supported only for "writeback" mode). 254 heads (supported only for "writeback" mode).
245 255
246mballoc (*) Use the multiple block allocator for block allocation
247nomballoc disabled multiple block allocator for block allocation.
248stripe=n Number of filesystem blocks that mballoc will try 256stripe=n Number of filesystem blocks that mballoc will try
249 to use for allocation size and alignment. For RAID5/6 257 to use for allocation size and alignment. For RAID5/6
250 systems this should be the number of data 258 systems this should be the number of data
@@ -252,6 +260,7 @@ stripe=n Number of filesystem blocks that mballoc will try
252delalloc (*) Deferring block allocation until write-out time. 260delalloc (*) Deferring block allocation until write-out time.
253nodelalloc Disable delayed allocation. Blocks are allocation 261nodelalloc Disable delayed allocation. Blocks are allocation
254 when data is copied from user to page cache. 262 when data is copied from user to page cache.
263
255Data Mode 264Data Mode
256========= 265=========
257There are 3 different data modes: 266There are 3 different data modes:
diff --git a/Documentation/filesystems/fiemap.txt b/Documentation/filesystems/fiemap.txt
new file mode 100644
index 000000000000..1e3defcfe50b
--- /dev/null
+++ b/Documentation/filesystems/fiemap.txt
@@ -0,0 +1,228 @@
1============
2Fiemap Ioctl
3============
4
5The fiemap ioctl is an efficient method for userspace to get file
6extent mappings. Instead of block-by-block mapping (such as bmap), fiemap
7returns a list of extents.
8
9
10Request Basics
11--------------
12
13A fiemap request is encoded within struct fiemap:
14
15struct fiemap {
16 __u64 fm_start; /* logical offset (inclusive) at
17 * which to start mapping (in) */
18 __u64 fm_length; /* logical length of mapping which
19 * userspace cares about (in) */
20 __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */
21 __u32 fm_mapped_extents; /* number of extents that were
22 * mapped (out) */
23 __u32 fm_extent_count; /* size of fm_extents array (in) */
24 __u32 fm_reserved;
25 struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */
26};
27
28
29fm_start, and fm_length specify the logical range within the file
30which the process would like mappings for. Extents returned mirror
31those on disk - that is, the logical offset of the 1st returned extent
32may start before fm_start, and the range covered by the last returned
33extent may end after fm_length. All offsets and lengths are in bytes.
34
35Certain flags to modify the way in which mappings are looked up can be
36set in fm_flags. If the kernel doesn't understand some particular
37flags, it will return EBADR and the contents of fm_flags will contain
38the set of flags which caused the error. If the kernel is compatible
39with all flags passed, the contents of fm_flags will be unmodified.
40It is up to userspace to determine whether rejection of a particular
41flag is fatal to it's operation. This scheme is intended to allow the
42fiemap interface to grow in the future but without losing
43compatibility with old software.
44
45fm_extent_count specifies the number of elements in the fm_extents[] array
46that can be used to return extents. If fm_extent_count is zero, then the
47fm_extents[] array is ignored (no extents will be returned), and the
48fm_mapped_extents count will hold the number of extents needed in
49fm_extents[] to hold the file's current mapping. Note that there is
50nothing to prevent the file from changing between calls to FIEMAP.
51
52The following flags can be set in fm_flags:
53
54* FIEMAP_FLAG_SYNC
55If this flag is set, the kernel will sync the file before mapping extents.
56
57* FIEMAP_FLAG_XATTR
58If this flag is set, the extents returned will describe the inodes
59extended attribute lookup tree, instead of it's data tree.
60
61
62Extent Mapping
63--------------
64
65Extent information is returned within the embedded fm_extents array
66which userspace must allocate along with the fiemap structure. The
67number of elements in the fiemap_extents[] array should be passed via
68fm_extent_count. The number of extents mapped by kernel will be
69returned via fm_mapped_extents. If the number of fiemap_extents
70allocated is less than would be required to map the requested range,
71the maximum number of extents that can be mapped in the fm_extent[]
72array will be returned and fm_mapped_extents will be equal to
73fm_extent_count. In that case, the last extent in the array will not
74complete the requested range and will not have the FIEMAP_EXTENT_LAST
75flag set (see the next section on extent flags).
76
77Each extent is described by a single fiemap_extent structure as
78returned in fm_extents.
79
80struct fiemap_extent {
81 __u64 fe_logical; /* logical offset in bytes for the start of
82 * the extent */
83 __u64 fe_physical; /* physical offset in bytes for the start
84 * of the extent */
85 __u64 fe_length; /* length in bytes for the extent */
86 __u64 fe_reserved64[2];
87 __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */
88 __u32 fe_reserved[3];
89};
90
91All offsets and lengths are in bytes and mirror those on disk. It is valid
92for an extents logical offset to start before the request or it's logical
93length to extend past the request. Unless FIEMAP_EXTENT_NOT_ALIGNED is
94returned, fe_logical, fe_physical, and fe_length will be aligned to the
95block size of the file system. With the exception of extents flagged as
96FIEMAP_EXTENT_MERGED, adjacent extents will not be merged.
97
98The fe_flags field contains flags which describe the extent returned.
99A special flag, FIEMAP_EXTENT_LAST is always set on the last extent in
100the file so that the process making fiemap calls can determine when no
101more extents are available, without having to call the ioctl again.
102
103Some flags are intentionally vague and will always be set in the
104presence of other more specific flags. This way a program looking for
105a general property does not have to know all existing and future flags
106which imply that property.
107
108For example, if FIEMAP_EXTENT_DATA_INLINE or FIEMAP_EXTENT_DATA_TAIL
109are set, FIEMAP_EXTENT_NOT_ALIGNED will also be set. A program looking
110for inline or tail-packed data can key on the specific flag. Software
111which simply cares not to try operating on non-aligned extents
112however, can just key on FIEMAP_EXTENT_NOT_ALIGNED, and not have to
113worry about all present and future flags which might imply unaligned
114data. Note that the opposite is not true - it would be valid for
115FIEMAP_EXTENT_NOT_ALIGNED to appear alone.
116
117* FIEMAP_EXTENT_LAST
118This is the last extent in the file. A mapping attempt past this
119extent will return nothing.
120
121* FIEMAP_EXTENT_UNKNOWN
122The location of this extent is currently unknown. This may indicate
123the data is stored on an inaccessible volume or that no storage has
124been allocated for the file yet.
125
126* FIEMAP_EXTENT_DELALLOC
127 - This will also set FIEMAP_EXTENT_UNKNOWN.
128Delayed allocation - while there is data for this extent, it's
129physical location has not been allocated yet.
130
131* FIEMAP_EXTENT_ENCODED
132This extent does not consist of plain filesystem blocks but is
133encoded (e.g. encrypted or compressed). Reading the data in this
134extent via I/O to the block device will have undefined results.
135
136Note that it is *always* undefined to try to update the data
137in-place by writing to the indicated location without the
138assistance of the filesystem, or to access the data using the
139information returned by the FIEMAP interface while the filesystem
140is mounted. In other words, user applications may only read the
141extent data via I/O to the block device while the filesystem is
142unmounted, and then only if the FIEMAP_EXTENT_ENCODED flag is
143clear; user applications must not try reading or writing to the
144filesystem via the block device under any other circumstances.
145
146* FIEMAP_EXTENT_DATA_ENCRYPTED
147 - This will also set FIEMAP_EXTENT_ENCODED
148The data in this extent has been encrypted by the file system.
149
150* FIEMAP_EXTENT_NOT_ALIGNED
151Extent offsets and length are not guaranteed to be block aligned.
152
153* FIEMAP_EXTENT_DATA_INLINE
154 This will also set FIEMAP_EXTENT_NOT_ALIGNED
155Data is located within a meta data block.
156
157* FIEMAP_EXTENT_DATA_TAIL
158 This will also set FIEMAP_EXTENT_NOT_ALIGNED
159Data is packed into a block with data from other files.
160
161* FIEMAP_EXTENT_UNWRITTEN
162Unwritten extent - the extent is allocated but it's data has not been
163initialized. This indicates the extent's data will be all zero if read
164through the filesystem but the contents are undefined if read directly from
165the device.
166
167* FIEMAP_EXTENT_MERGED
168This will be set when a file does not support extents, i.e., it uses a block
169based addressing scheme. Since returning an extent for each block back to
170userspace would be highly inefficient, the kernel will try to merge most
171adjacent blocks into 'extents'.
172
173
174VFS -> File System Implementation
175---------------------------------
176
177File systems wishing to support fiemap must implement a ->fiemap callback on
178their inode_operations structure. The fs ->fiemap call is responsible for
179defining it's set of supported fiemap flags, and calling a helper function on
180each discovered extent:
181
182struct inode_operations {
183 ...
184
185 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
186 u64 len);
187
188->fiemap is passed struct fiemap_extent_info which describes the
189fiemap request:
190
191struct fiemap_extent_info {
192 unsigned int fi_flags; /* Flags as passed from user */
193 unsigned int fi_extents_mapped; /* Number of mapped extents */
194 unsigned int fi_extents_max; /* Size of fiemap_extent array */
195 struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent array */
196};
197
198It is intended that the file system should not need to access any of this
199structure directly.
200
201
202Flag checking should be done at the beginning of the ->fiemap callback via the
203fiemap_check_flags() helper:
204
205int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
206
207The struct fieinfo should be passed in as recieved from ioctl_fiemap(). The
208set of fiemap flags which the fs understands should be passed via fs_flags. If
209fiemap_check_flags finds invalid user flags, it will place the bad values in
210fieinfo->fi_flags and return -EBADR. If the file system gets -EBADR, from
211fiemap_check_flags(), it should immediately exit, returning that error back to
212ioctl_fiemap().
213
214
215For each extent in the request range, the file system should call
216the helper function, fiemap_fill_next_extent():
217
218int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,
219 u64 phys, u64 len, u32 flags, u32 dev);
220
221fiemap_fill_next_extent() will use the passed values to populate the
222next free extent in the fm_extents array. 'General' extent flags will
223automatically be set from specific flags on behalf of the calling file
224system so that the userspace API is not broken.
225
226fiemap_fill_next_extent() returns 0 on success, and 1 when the
227user-supplied fm_extents array is full. If an error is encountered
228while copying the extent to user memory, -EFAULT will be returned.
diff --git a/Documentation/filesystems/nfsroot.txt b/Documentation/filesystems/nfsroot.txt
index 31b329172343..68baddf3c3e0 100644
--- a/Documentation/filesystems/nfsroot.txt
+++ b/Documentation/filesystems/nfsroot.txt
@@ -169,7 +169,7 @@ They depend on various facilities being available:
1693.1) Booting from a floppy using syslinux 1693.1) Booting from a floppy using syslinux
170 170
171 When building kernels, an easy way to create a boot floppy that uses 171 When building kernels, an easy way to create a boot floppy that uses
172 syslinux is to use the zdisk or bzdisk make targets which use 172 syslinux is to use the zdisk or bzdisk make targets which use zimage
173 and bzimage images respectively. Both targets accept the 173 and bzimage images respectively. Both targets accept the
174 FDARGS parameter which can be used to set the kernel command line. 174 FDARGS parameter which can be used to set the kernel command line.
175 175
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt
index c318a8bbb1ef..4340cc825796 100644
--- a/Documentation/filesystems/ocfs2.txt
+++ b/Documentation/filesystems/ocfs2.txt
@@ -76,3 +76,9 @@ localalloc=8(*) Allows custom localalloc size in MB. If the value is too
76 large, the fs will silently revert it to the default. 76 large, the fs will silently revert it to the default.
77 Localalloc is not enabled for local mounts. 77 Localalloc is not enabled for local mounts.
78localflocks This disables cluster aware flock. 78localflocks This disables cluster aware flock.
79inode64 Indicates that Ocfs2 is allowed to create inodes at
80 any location in the filesystem, including those which
81 will result in inode numbers occupying more than 32
82 bits of significance.
83user_xattr (*) Enables Extended User Attributes.
84nouser_xattr Disables Extended User Attributes.
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index f566ad9bcb7b..bcceb99b81dd 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -923,45 +923,44 @@ CPUs.
923The "procs_blocked" line gives the number of processes currently blocked, 923The "procs_blocked" line gives the number of processes currently blocked,
924waiting for I/O to complete. 924waiting for I/O to complete.
925 925
926
9261.9 Ext4 file system parameters 9271.9 Ext4 file system parameters
927------------------------------ 928------------------------------
928Ext4 file system have one directory per partition under /proc/fs/ext4/
929# ls /proc/fs/ext4/hdc/
930group_prealloc max_to_scan mb_groups mb_history min_to_scan order2_req
931stats stream_req
932
933mb_groups:
934This file gives the details of multiblock allocator buddy cache of free blocks
935
936mb_history:
937Multiblock allocation history.
938
939stats:
940This file indicate whether the multiblock allocator should start collecting
941statistics. The statistics are shown during unmount
942 929
943group_prealloc: 930Information about mounted ext4 file systems can be found in
944The multiblock allocator normalize the block allocation request to 931/proc/fs/ext4. Each mounted filesystem will have a directory in
945group_prealloc filesystem blocks if we don't have strip value set. 932/proc/fs/ext4 based on its device name (i.e., /proc/fs/ext4/hdc or
946The stripe value can be specified at mount time or during mke2fs. 933/proc/fs/ext4/dm-0). The files in each per-device directory are shown
934in Table 1-10, below.
947 935
948max_to_scan: 936Table 1-10: Files in /proc/fs/ext4/<devname>
949How long multiblock allocator can look for a best extent (in found extents) 937..............................................................................
950 938 File Content
951min_to_scan: 939 mb_groups details of multiblock allocator buddy cache of free blocks
952How long multiblock allocator must look for a best extent 940 mb_history multiblock allocation history
953 941 stats controls whether the multiblock allocator should start
954order2_req: 942 collecting statistics, which are shown during the unmount
955Multiblock allocator use 2^N search using buddies only for requests greater 943 group_prealloc the multiblock allocator will round up allocation
956than or equal to order2_req. The request size is specfied in file system 944 requests to a multiple of this tuning parameter if the
957blocks. A value of 2 indicate only if the requests are greater than or equal 945 stripe size is not set in the ext4 superblock
958to 4 blocks. 946 max_to_scan The maximum number of extents the multiblock allocator
947 will search to find the best extent
948 min_to_scan The minimum number of extents the multiblock allocator
949 will search to find the best extent
950 order2_req Tuning parameter which controls the minimum size for
951 requests (as a power of 2) where the buddy cache is
952 used
953 stream_req Files which have fewer blocks than this tunable
954 parameter will have their blocks allocated out of a
955 block group specific preallocation pool, so that small
956 files are packed closely together. Each large file
957 will have its blocks allocated out of its own unique
958 preallocation pool.
959inode_readahead Tuning parameter which controls the maximum number of
960 inode table blocks that ext4's inode table readahead
961 algorithm will pre-read into the buffer cache
962..............................................................................
959 963
960stream_req:
961Files smaller than stream_req are served by the stream allocator, whose
962purpose is to pack requests as close each to other as possible to
963produce smooth I/O traffic. Avalue of 16 indicate that file smaller than 16
964filesystem block size will use group based preallocation.
965 964
966------------------------------------------------------------------------------ 965------------------------------------------------------------------------------
967Summary 966Summary
@@ -1322,6 +1321,18 @@ debugging information is displayed on console.
1322NMI switch that most IA32 servers have fires unknown NMI up, for example. 1321NMI switch that most IA32 servers have fires unknown NMI up, for example.
1323If a system hangs up, try pressing the NMI switch. 1322If a system hangs up, try pressing the NMI switch.
1324 1323
1324panic_on_unrecovered_nmi
1325------------------------
1326
1327The default Linux behaviour on an NMI of either memory or unknown is to continue
1328operation. For many environments such as scientific computing it is preferable
1329that the box is taken out and the error dealt with than an uncorrected
1330parity/ECC error get propogated.
1331
1332A small number of systems do generate NMI's for bizarre random reasons such as
1333power management so the default is off. That sysctl works like the existing
1334panic controls already in that directory.
1335
1325nmi_watchdog 1336nmi_watchdog
1326------------ 1337------------
1327 1338
@@ -1332,13 +1343,6 @@ determine whether or not they are still functioning properly.
1332Because the NMI watchdog shares registers with oprofile, by disabling the NMI 1343Because the NMI watchdog shares registers with oprofile, by disabling the NMI
1333watchdog, oprofile may have more registers to utilize. 1344watchdog, oprofile may have more registers to utilize.
1334 1345
1335maps_protect
1336------------
1337
1338Enables/Disables the protection of the per-process proc entries "maps" and
1339"smaps". When enabled, the contents of these files are visible only to
1340readers that are allowed to ptrace() the given process.
1341
1342msgmni 1346msgmni
1343------ 1347------
1344 1348
@@ -1380,15 +1384,18 @@ causes the kernel to prefer to reclaim dentries and inodes.
1380dirty_background_ratio 1384dirty_background_ratio
1381---------------------- 1385----------------------
1382 1386
1383Contains, as a percentage of total system memory, the number of pages at which 1387Contains, as a percentage of the dirtyable system memory (free pages + mapped
1384the pdflush background writeback daemon will start writing out dirty data. 1388pages + file cache, not including locked pages and HugePages), the number of
1389pages at which the pdflush background writeback daemon will start writing out
1390dirty data.
1385 1391
1386dirty_ratio 1392dirty_ratio
1387----------------- 1393-----------------
1388 1394
1389Contains, as a percentage of total system memory, the number of pages at which 1395Contains, as a percentage of the dirtyable system memory (free pages + mapped
1390a process which is generating disk writes will itself start writing out dirty 1396pages + file cache, not including locked pages and HugePages), the number of
1391data. 1397pages at which a process which is generating disk writes will itself start
1398writing out dirty data.
1392 1399
1393dirty_writeback_centisecs 1400dirty_writeback_centisecs
1394------------------------- 1401-------------------------
@@ -2408,24 +2415,29 @@ will be dumped when the <pid> process is dumped. coredump_filter is a bitmask
2408of memory types. If a bit of the bitmask is set, memory segments of the 2415of memory types. If a bit of the bitmask is set, memory segments of the
2409corresponding memory type are dumped, otherwise they are not dumped. 2416corresponding memory type are dumped, otherwise they are not dumped.
2410 2417
2411The following 4 memory types are supported: 2418The following 7 memory types are supported:
2412 - (bit 0) anonymous private memory 2419 - (bit 0) anonymous private memory
2413 - (bit 1) anonymous shared memory 2420 - (bit 1) anonymous shared memory
2414 - (bit 2) file-backed private memory 2421 - (bit 2) file-backed private memory
2415 - (bit 3) file-backed shared memory 2422 - (bit 3) file-backed shared memory
2416 - (bit 4) ELF header pages in file-backed private memory areas (it is 2423 - (bit 4) ELF header pages in file-backed private memory areas (it is
2417 effective only if the bit 2 is cleared) 2424 effective only if the bit 2 is cleared)
2425 - (bit 5) hugetlb private memory
2426 - (bit 6) hugetlb shared memory
2418 2427
2419 Note that MMIO pages such as frame buffer are never dumped and vDSO pages 2428 Note that MMIO pages such as frame buffer are never dumped and vDSO pages
2420 are always dumped regardless of the bitmask status. 2429 are always dumped regardless of the bitmask status.
2421 2430
2422Default value of coredump_filter is 0x3; this means all anonymous memory 2431 Note bit 0-4 doesn't effect any hugetlb memory. hugetlb memory are only
2423segments are dumped. 2432 effected by bit 5-6.
2433
2434Default value of coredump_filter is 0x23; this means all anonymous memory
2435segments and hugetlb private memory are dumped.
2424 2436
2425If you don't want to dump all shared memory segments attached to pid 1234, 2437If you don't want to dump all shared memory segments attached to pid 1234,
2426write 1 to the process's proc file. 2438write 0x21 to the process's proc file.
2427 2439
2428 $ echo 0x1 > /proc/1234/coredump_filter 2440 $ echo 0x21 > /proc/1234/coredump_filter
2429 2441
2430When a new process is created, the process inherits the bitmask status from its 2442When a new process is created, the process inherits the bitmask status from its
2431parent. It is useful to set up coredump_filter before the program runs. 2443parent. It is useful to set up coredump_filter before the program runs.
diff --git a/Documentation/filesystems/ramfs-rootfs-initramfs.txt b/Documentation/filesystems/ramfs-rootfs-initramfs.txt
index 7be232b44ee4..62fe9b1e0890 100644
--- a/Documentation/filesystems/ramfs-rootfs-initramfs.txt
+++ b/Documentation/filesystems/ramfs-rootfs-initramfs.txt
@@ -263,7 +263,7 @@ User Mode Linux, like so:
263 sleep(999999999); 263 sleep(999999999);
264 } 264 }
265 EOF 265 EOF
266 gcc -static hello2.c -o init 266 gcc -static hello.c -o init
267 echo init | cpio -o -H newc | gzip > test.cpio.gz 267 echo init | cpio -o -H newc | gzip > test.cpio.gz
268 # Testing external initramfs using the initrd loading mechanism. 268 # Testing external initramfs using the initrd loading mechanism.
269 qemu -kernel /boot/vmlinuz -initrd test.cpio.gz /dev/zero 269 qemu -kernel /boot/vmlinuz -initrd test.cpio.gz /dev/zero