aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r--Documentation/filesystems/Locking12
-rw-r--r--Documentation/filesystems/porting12
-rw-r--r--Documentation/filesystems/proc.txt15
-rw-r--r--Documentation/filesystems/vfs.txt8
4 files changed, 34 insertions, 13 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index f91926f2f482..0a926e2ba3ab 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -196,7 +196,7 @@ prototypes:
196 void (*invalidatepage) (struct page *, unsigned int, unsigned int); 196 void (*invalidatepage) (struct page *, unsigned int, unsigned int);
197 int (*releasepage) (struct page *, int); 197 int (*releasepage) (struct page *, int);
198 void (*freepage)(struct page *); 198 void (*freepage)(struct page *);
199 int (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset); 199 int (*direct_IO)(struct kiocb *, struct iov_iter *iter, loff_t offset);
200 int (*migratepage)(struct address_space *, struct page *, struct page *); 200 int (*migratepage)(struct address_space *, struct page *, struct page *);
201 int (*launder_page)(struct page *); 201 int (*launder_page)(struct page *);
202 int (*is_partially_uptodate)(struct page *, unsigned long, unsigned long); 202 int (*is_partially_uptodate)(struct page *, unsigned long, unsigned long);
@@ -429,8 +429,6 @@ prototypes:
429 loff_t (*llseek) (struct file *, loff_t, int); 429 loff_t (*llseek) (struct file *, loff_t, int);
430 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); 430 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
431 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); 431 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
432 ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
433 ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
434 ssize_t (*read_iter) (struct kiocb *, struct iov_iter *); 432 ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
435 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); 433 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
436 int (*iterate) (struct file *, struct dir_context *); 434 int (*iterate) (struct file *, struct dir_context *);
@@ -525,6 +523,7 @@ prototypes:
525 void (*close)(struct vm_area_struct*); 523 void (*close)(struct vm_area_struct*);
526 int (*fault)(struct vm_area_struct*, struct vm_fault *); 524 int (*fault)(struct vm_area_struct*, struct vm_fault *);
527 int (*page_mkwrite)(struct vm_area_struct *, struct vm_fault *); 525 int (*page_mkwrite)(struct vm_area_struct *, struct vm_fault *);
526 int (*pfn_mkwrite)(struct vm_area_struct *, struct vm_fault *);
528 int (*access)(struct vm_area_struct *, unsigned long, void*, int, int); 527 int (*access)(struct vm_area_struct *, unsigned long, void*, int, int);
529 528
530locking rules: 529locking rules:
@@ -534,6 +533,7 @@ close: yes
534fault: yes can return with page locked 533fault: yes can return with page locked
535map_pages: yes 534map_pages: yes
536page_mkwrite: yes can return with page locked 535page_mkwrite: yes can return with page locked
536pfn_mkwrite: yes
537access: yes 537access: yes
538 538
539 ->fault() is called when a previously not present pte is about 539 ->fault() is called when a previously not present pte is about
@@ -560,6 +560,12 @@ the page has been truncated, the filesystem should not look up a new page
560like the ->fault() handler, but simply return with VM_FAULT_NOPAGE, which 560like the ->fault() handler, but simply return with VM_FAULT_NOPAGE, which
561will cause the VM to retry the fault. 561will cause the VM to retry the fault.
562 562
563 ->pfn_mkwrite() is the same as page_mkwrite but when the pte is
564VM_PFNMAP or VM_MIXEDMAP with a page-less entry. Expected return is
565VM_FAULT_NOPAGE. Or one of the VM_FAULT_ERROR types. The default behavior
566after this call is to make the pte read-write, unless pfn_mkwrite returns
567an error.
568
563 ->access() is called when get_user_pages() fails in 569 ->access() is called when get_user_pages() fails in
564access_process_vm(), typically used to debug a process through 570access_process_vm(), typically used to debug a process through
565/proc/pid/mem or ptrace. This function is needed only for 571/proc/pid/mem or ptrace. This function is needed only for
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index fa2db081505e..e69274de8d0c 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -471,3 +471,15 @@ in your dentry operations instead.
471[mandatory] 471[mandatory]
472 f_dentry is gone; use f_path.dentry, or, better yet, see if you can avoid 472 f_dentry is gone; use f_path.dentry, or, better yet, see if you can avoid
473 it entirely. 473 it entirely.
474--
475[mandatory]
476 never call ->read() and ->write() directly; use __vfs_{read,write} or
477 wrappers; instead of checking for ->write or ->read being NULL, look for
478 FMODE_CAN_{WRITE,READ} in file->f_mode.
479--
480[mandatory]
481 do _not_ use new_sync_{read,write} for ->read/->write; leave it NULL
482 instead.
483--
484[mandatory]
485 ->aio_read/->aio_write are gone. Use ->read_iter/->write_iter.
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index a07ba61662ed..8e36c7e3c345 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -200,12 +200,12 @@ contains details information about the process itself. Its fields are
200explained in Table 1-4. 200explained in Table 1-4.
201 201
202(for SMP CONFIG users) 202(for SMP CONFIG users)
203For making accounting scalable, RSS related information are handled in 203For making accounting scalable, RSS related information are handled in an
204asynchronous manner and the vaule may not be very precise. To see a precise 204asynchronous manner and the value may not be very precise. To see a precise
205snapshot of a moment, you can see /proc/<pid>/smaps file and scan page table. 205snapshot of a moment, you can see /proc/<pid>/smaps file and scan page table.
206It's slow but very precise. 206It's slow but very precise.
207 207
208Table 1-2: Contents of the status files (as of 2.6.30-rc7) 208Table 1-2: Contents of the status files (as of 3.20.0)
209.............................................................................. 209..............................................................................
210 Field Content 210 Field Content
211 Name filename of the executable 211 Name filename of the executable
@@ -213,6 +213,7 @@ Table 1-2: Contents of the status files (as of 2.6.30-rc7)
213 in an uninterruptible wait, Z is zombie, 213 in an uninterruptible wait, Z is zombie,
214 T is traced or stopped) 214 T is traced or stopped)
215 Tgid thread group ID 215 Tgid thread group ID
216 Ngid NUMA group ID (0 if none)
216 Pid process id 217 Pid process id
217 PPid process id of the parent process 218 PPid process id of the parent process
218 TracerPid PID of process tracing this process (0 if not) 219 TracerPid PID of process tracing this process (0 if not)
@@ -220,6 +221,10 @@ Table 1-2: Contents of the status files (as of 2.6.30-rc7)
220 Gid Real, effective, saved set, and file system GIDs 221 Gid Real, effective, saved set, and file system GIDs
221 FDSize number of file descriptor slots currently allocated 222 FDSize number of file descriptor slots currently allocated
222 Groups supplementary group list 223 Groups supplementary group list
224 NStgid descendant namespace thread group ID hierarchy
225 NSpid descendant namespace process ID hierarchy
226 NSpgid descendant namespace process group ID hierarchy
227 NSsid descendant namespace session ID hierarchy
223 VmPeak peak virtual memory size 228 VmPeak peak virtual memory size
224 VmSize total program size 229 VmSize total program size
225 VmLck locked memory size 230 VmLck locked memory size
@@ -1704,6 +1709,10 @@ A typical output is
1704 flags: 0100002 1709 flags: 0100002
1705 mnt_id: 19 1710 mnt_id: 19
1706 1711
1712All locks associated with a file descriptor are shown in its fdinfo too.
1713
1714lock: 1: FLOCK ADVISORY WRITE 359 00:13:11691 0 EOF
1715
1707The files such as eventfd, fsnotify, signalfd, epoll among the regular pos/flags 1716The files such as eventfd, fsnotify, signalfd, epoll among the regular pos/flags
1708pair provide additional information particular to the objects they represent. 1717pair provide additional information particular to the objects they represent.
1709 1718
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index 966b22829f3b..5d833b32bbcd 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -590,7 +590,7 @@ struct address_space_operations {
590 void (*invalidatepage) (struct page *, unsigned int, unsigned int); 590 void (*invalidatepage) (struct page *, unsigned int, unsigned int);
591 int (*releasepage) (struct page *, int); 591 int (*releasepage) (struct page *, int);
592 void (*freepage)(struct page *); 592 void (*freepage)(struct page *);
593 ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset); 593 ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter, loff_t offset);
594 /* migrate the contents of a page to the specified target */ 594 /* migrate the contents of a page to the specified target */
595 int (*migratepage) (struct page *, struct page *); 595 int (*migratepage) (struct page *, struct page *);
596 int (*launder_page) (struct page *); 596 int (*launder_page) (struct page *);
@@ -804,8 +804,6 @@ struct file_operations {
804 loff_t (*llseek) (struct file *, loff_t, int); 804 loff_t (*llseek) (struct file *, loff_t, int);
805 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); 805 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
806 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); 806 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
807 ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
808 ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
809 ssize_t (*read_iter) (struct kiocb *, struct iov_iter *); 807 ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
810 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); 808 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
811 int (*iterate) (struct file *, struct dir_context *); 809 int (*iterate) (struct file *, struct dir_context *);
@@ -838,14 +836,10 @@ otherwise noted.
838 836
839 read: called by read(2) and related system calls 837 read: called by read(2) and related system calls
840 838
841 aio_read: vectored, possibly asynchronous read
842
843 read_iter: possibly asynchronous read with iov_iter as destination 839 read_iter: possibly asynchronous read with iov_iter as destination
844 840
845 write: called by write(2) and related system calls 841 write: called by write(2) and related system calls
846 842
847 aio_write: vectored, possibly asynchronous write
848
849 write_iter: possibly asynchronous write with iov_iter as source 843 write_iter: possibly asynchronous write with iov_iter as source
850 844
851 iterate: called when the VFS needs to read the directory contents 845 iterate: called when the VFS needs to read the directory contents