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

docs: filesystems: convert inotify.txt to ReST

- Add a SPDX header;
- Add a document title;
- Adjust document title;
- Fix list markups;
- Some whitespace fixes and new line breaks;
- Add it to filesystems/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Acked-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/8f846843ecf1914988feb4d001e3a53d27dc1a65.1581955849.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
de389cf0 a1ef4bcd

+23 -11
+1
Documentation/filesystems/index.rst
··· 70 70 hfs 71 71 hfsplus 72 72 hpfs 73 + inotify 73 74 fuse 74 75 overlayfs 75 76 virtiofs
+22 -11
Documentation/filesystems/inotify.txt Documentation/filesystems/inotify.rst
··· 1 - inotify 2 - a powerful yet simple file change notification system 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + =============================================================== 4 + Inotify - A Powerful yet Simple File Change Notification System 5 + =============================================================== 3 6 4 7 5 8 6 9 Document started 15 Mar 2005 by Robert Love <rml@novell.com> 10 + 7 11 Document updated 4 Jan 2015 by Zhang Zhen <zhenzhang.zhang@huawei.com> 8 - --Deleted obsoleted interface, just refer to manpages for user interface. 12 + 13 + - Deleted obsoleted interface, just refer to manpages for user interface. 9 14 10 15 (i) Rationale 11 16 12 - Q: What is the design decision behind not tying the watch to the open fd of 17 + Q: 18 + What is the design decision behind not tying the watch to the open fd of 13 19 the watched object? 14 20 15 - A: Watches are associated with an open inotify device, not an open file. 21 + A: 22 + Watches are associated with an open inotify device, not an open file. 16 23 This solves the primary problem with dnotify: keeping the file open pins 17 24 the file and thus, worse, pins the mount. Dnotify is therefore infeasible 18 25 for use on a desktop system with removable media as the media cannot be 19 26 unmounted. Watching a file should not require that it be open. 20 27 21 - Q: What is the design decision behind using an-fd-per-instance as opposed to 28 + Q: 29 + What is the design decision behind using an-fd-per-instance as opposed to 22 30 an fd-per-watch? 23 31 24 - A: An fd-per-watch quickly consumes more file descriptors than are allowed, 32 + A: 33 + An fd-per-watch quickly consumes more file descriptors than are allowed, 25 34 more fd's than are feasible to manage, and more fd's than are optimally 26 35 select()-able. Yes, root can bump the per-process fd limit and yes, users 27 36 can use epoll, but requiring both is a silly and extraneous requirement. ··· 38 29 spaces is thus sensible. The current design is what user-space developers 39 30 want: Users initialize inotify, once, and add n watches, requiring but one 40 31 fd and no twiddling with fd limits. Initializing an inotify instance two 41 - thousand times is silly. If we can implement user-space's preferences 42 - cleanly--and we can, the idr layer makes stuff like this trivial--then we 32 + thousand times is silly. If we can implement user-space's preferences 33 + cleanly--and we can, the idr layer makes stuff like this trivial--then we 43 34 should. 44 35 45 36 There are other good arguments. With a single fd, there is a single ··· 74 65 need not be a one-fd-per-process mapping; it is one-fd-per-queue and a 75 66 process can easily want more than one queue. 76 67 77 - Q: Why the system call approach? 68 + Q: 69 + Why the system call approach? 78 70 79 - A: The poor user-space interface is the second biggest problem with dnotify. 71 + A: 72 + The poor user-space interface is the second biggest problem with dnotify. 80 73 Signals are a terrible, terrible interface for file notification. Or for 81 74 anything, for that matter. The ideal solution, from all perspectives, is a 82 75 file descriptor-based one that allows basic file I/O and poll/select.