aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 19:10:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 19:10:49 -0500
commitcbfe0de303a55ed96d8831c2d5f56f8131cd6612 (patch)
treeb327762303c6a015421e4077e7c713b8a47a5e0e /Documentation/filesystems
parent8322b6fddfd2cee41a7732284e5f04750511f4b2 (diff)
parentba00410b8131b23edfb0e09f8b6dd26c8eb621fb (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS changes from Al Viro: "First pile out of several (there _definitely_ will be more). Stuff in this one: - unification of d_splice_alias()/d_materialize_unique() - iov_iter rewrite - killing a bunch of ->f_path.dentry users (and f_dentry macro). Getting that completed will make life much simpler for unionmount/overlayfs, since then we'll be able to limit the places sensitive to file _dentry_ to reasonably few. Which allows to have file_inode(file) pointing to inode in a covered layer, with dentry pointing to (negative) dentry in union one. Still not complete, but much closer now. - crapectomy in lustre (dead code removal, mostly) - "let's make seq_printf return nothing" preparations - assorted cleanups and fixes There _definitely_ will be more piles" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits) copy_from_iter_nocache() new helper: iov_iter_kvec() csum_and_copy_..._iter() iov_iter.c: handle ITER_KVEC directly iov_iter.c: convert copy_to_iter() to iterate_and_advance iov_iter.c: convert copy_from_iter() to iterate_and_advance iov_iter.c: get rid of bvec_copy_page_{to,from}_iter() iov_iter.c: convert iov_iter_zero() to iterate_and_advance iov_iter.c: convert iov_iter_get_pages_alloc() to iterate_all_kinds iov_iter.c: convert iov_iter_get_pages() to iterate_all_kinds iov_iter.c: convert iov_iter_npages() to iterate_all_kinds iov_iter.c: iterate_and_advance iov_iter.c: macros for iterating over iov_iter kill f_dentry macro dcache: fix kmemcheck warning in switch_names new helper: audit_file() nfsd_vfs_write(): use file_inode() ncpfs: use file_inode() kill f_dentry uses lockd: get rid of ->f_path.dentry->d_sb ...
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r--Documentation/filesystems/debugfs.txt2
-rw-r--r--Documentation/filesystems/nfs/Exporting23
-rw-r--r--Documentation/filesystems/porting8
-rw-r--r--Documentation/filesystems/seq_file.txt22
-rw-r--r--Documentation/filesystems/vfs.txt2
5 files changed, 28 insertions, 29 deletions
diff --git a/Documentation/filesystems/debugfs.txt b/Documentation/filesystems/debugfs.txt
index 3a863f692728..88ab81c79109 100644
--- a/Documentation/filesystems/debugfs.txt
+++ b/Documentation/filesystems/debugfs.txt
@@ -140,7 +140,7 @@ file.
140 struct dentry *parent, 140 struct dentry *parent,
141 struct debugfs_regset32 *regset); 141 struct debugfs_regset32 *regset);
142 142
143 int debugfs_print_regs32(struct seq_file *s, struct debugfs_reg32 *regs, 143 void debugfs_print_regs32(struct seq_file *s, struct debugfs_reg32 *regs,
144 int nregs, void __iomem *base, char *prefix); 144 int nregs, void __iomem *base, char *prefix);
145 145
146The "base" argument may be 0, but you may want to build the reg32 array 146The "base" argument may be 0, but you may want to build the reg32 array
diff --git a/Documentation/filesystems/nfs/Exporting b/Documentation/filesystems/nfs/Exporting
index c8f036a9b13f..520a4becb75c 100644
--- a/Documentation/filesystems/nfs/Exporting
+++ b/Documentation/filesystems/nfs/Exporting
@@ -72,24 +72,11 @@ c/ Helper routines to allocate anonymous dentries, and to help attach
72 DCACHE_DISCONNECTED) dentry is allocated and attached. 72 DCACHE_DISCONNECTED) dentry is allocated and attached.
73 In the case of a directory, care is taken that only one dentry 73 In the case of a directory, care is taken that only one dentry
74 can ever be attached. 74 can ever be attached.
75 d_splice_alias(inode, dentry) or d_materialise_unique(dentry, inode) 75 d_splice_alias(inode, dentry) will introduce a new dentry into the tree;
76 will introduce a new dentry into the tree; either the passed-in 76 either the passed-in dentry or a preexisting alias for the given inode
77 dentry or a preexisting alias for the given inode (such as an 77 (such as an anonymous one created by d_obtain_alias), if appropriate.
78 anonymous one created by d_obtain_alias), if appropriate. The two 78 It returns NULL when the passed-in dentry is used, following the calling
79 functions differ in their handling of directories with preexisting 79 convention of ->lookup.
80 aliases:
81 d_splice_alias will use any existing IS_ROOT dentry, but it will
82 return -EIO rather than try to move a dentry with a different
83 parent. This is appropriate for local filesystems, which
84 should never see such an alias unless the filesystem is
85 corrupted somehow (for example, if two on-disk directory
86 entries refer to the same directory.)
87 d_materialise_unique will attempt to move any dentry. This is
88 appropriate for distributed filesystems, where finding a
89 directory other than where we last cached it may be a normal
90 consequence of concurrent operations on other hosts.
91 Both functions return NULL when the passed-in dentry is used,
92 following the calling convention of ->lookup.
93 80
94 81
95Filesystem Issues 82Filesystem Issues
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index 0f3a1390bf00..fa2db081505e 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -463,3 +463,11 @@ in your dentry operations instead.
463 of the in-tree instances did). inode_hash_lock is still held, 463 of the in-tree instances did). inode_hash_lock is still held,
464 of course, so they are still serialized wrt removal from inode hash, 464 of course, so they are still serialized wrt removal from inode hash,
465 as well as wrt set() callback of iget5_locked(). 465 as well as wrt set() callback of iget5_locked().
466--
467[mandatory]
468 d_materialise_unique() is gone; d_splice_alias() does everything you
469 need now. Remember that they have opposite orders of arguments ;-/
470--
471[mandatory]
472 f_dentry is gone; use f_path.dentry, or, better yet, see if you can avoid
473 it entirely.
diff --git a/Documentation/filesystems/seq_file.txt b/Documentation/filesystems/seq_file.txt
index 8ea3e90ace07..b797ed38de46 100644
--- a/Documentation/filesystems/seq_file.txt
+++ b/Documentation/filesystems/seq_file.txt
@@ -180,23 +180,19 @@ output must be passed to the seq_file code. Some utility functions have
180been defined which make this task easy. 180been defined which make this task easy.
181 181
182Most code will simply use seq_printf(), which works pretty much like 182Most code will simply use seq_printf(), which works pretty much like
183printk(), but which requires the seq_file pointer as an argument. It is 183printk(), but which requires the seq_file pointer as an argument.
184common to ignore the return value from seq_printf(), but a function
185producing complicated output may want to check that value and quit if
186something non-zero is returned; an error return means that the seq_file
187buffer has been filled and further output will be discarded.
188 184
189For straight character output, the following functions may be used: 185For straight character output, the following functions may be used:
190 186
191 int seq_putc(struct seq_file *m, char c); 187 seq_putc(struct seq_file *m, char c);
192 int seq_puts(struct seq_file *m, const char *s); 188 seq_puts(struct seq_file *m, const char *s);
193 int seq_escape(struct seq_file *m, const char *s, const char *esc); 189 seq_escape(struct seq_file *m, const char *s, const char *esc);
194 190
195The first two output a single character and a string, just like one would 191The first two output a single character and a string, just like one would
196expect. seq_escape() is like seq_puts(), except that any character in s 192expect. seq_escape() is like seq_puts(), except that any character in s
197which is in the string esc will be represented in octal form in the output. 193which is in the string esc will be represented in octal form in the output.
198 194
199There is also a pair of functions for printing filenames: 195There are also a pair of functions for printing filenames:
200 196
201 int seq_path(struct seq_file *m, struct path *path, char *esc); 197 int seq_path(struct seq_file *m, struct path *path, char *esc);
202 int seq_path_root(struct seq_file *m, struct path *path, 198 int seq_path_root(struct seq_file *m, struct path *path,
@@ -209,6 +205,14 @@ root is desired, it can be used with seq_path_root(). Note that, if it
209turns out that path cannot be reached from root, the value of root will be 205turns out that path cannot be reached from root, the value of root will be
210changed in seq_file_root() to a root which *does* work. 206changed in seq_file_root() to a root which *does* work.
211 207
208A function producing complicated output may want to check
209 bool seq_has_overflowed(struct seq_file *m);
210and avoid further seq_<output> calls if true is returned.
211
212A true return from seq_has_overflowed means that the seq_file buffer will
213be discarded and the seq_show function will attempt to allocate a larger
214buffer and retry printing.
215
212 216
213Making it all work 217Making it all work
214 218
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index 20bf204426ca..43ce0507ee25 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -835,7 +835,7 @@ struct file_operations {
835 ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int); 835 ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int);
836 int (*setlease)(struct file *, long arg, struct file_lock **, void **); 836 int (*setlease)(struct file *, long arg, struct file_lock **, void **);
837 long (*fallocate)(struct file *, int mode, loff_t offset, loff_t len); 837 long (*fallocate)(struct file *, int mode, loff_t offset, loff_t len);
838 int (*show_fdinfo)(struct seq_file *m, struct file *f); 838 void (*show_fdinfo)(struct seq_file *m, struct file *f);
839}; 839};
840 840
841Again, all methods are called without any locks being held, unless 841Again, all methods are called without any locks being held, unless