summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'trace-seq-file-cleanup' of ↵Al Viro2014-11-1938-437/+410
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace into for-next Pull the beginning of seq_file cleanup from Steven: "I'm looking to clean up the seq_file code and to eventually merge the trace_seq code with seq_file as well, since they basically do the same thing. Part of this process is to remove the return code of seq_printf() and friends as they are rather inconsistent. It is better to use the new function seq_has_overflowed() if you want to stop processing when the buffer is full. Note, if the buffer is full, the seq_file code will throw away the contents, allocate a bigger buffer, and then call your code again to fill in the data. The only thing that breaking out of the function early does is to save a little time which is probably never noticed. I started with patches from Joe Perches and modified them as well. There's many more places that need to be updated before we can convert seq_printf() and friends to return void. But this patch set introduces the seq_has_overflowed() and does some initial updates."
| * debugfs: Have debugfs_print_regs32() return voidJoe Perches2014-11-053-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The seq_printf() will soon just return void, and seq_has_overflowed() should be used instead to see if the seq can no longer accept input. As the return value of debugfs_print_regs32() has no users and the seq_file descriptor should be checked with seq_has_overflowed() instead of return values of functions, it is better to just have debugfs_print_regs32() also return void. Link: http://lkml.kernel.org/p/2634b19eb1c04a9d31148c1fe6f1f3819be95349.1412031505.git.joe@perches.com Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Joe Perches <joe@perches.com> [ original change only updated seq_printf() return, added return of void to debugfs_print_regs32() as well ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * fs: Convert show_fdinfo functions to voidJoe Perches2014-11-0510-83/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | seq_printf functions shouldn't really check the return value. Checking seq_has_overflowed() occasionally is used instead. Update vfs documentation. Link: http://lkml.kernel.org/p/e37e6e7b76acbdcc3bb4ab2a57c8f8ca1ae11b9a.1412031505.git.joe@perches.com Cc: David S. Miller <davem@davemloft.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Joe Perches <joe@perches.com> [ did a few clean ups ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * dlm: Use seq_puts() instead of seq_printf() for constant stringsJoe Perches2014-11-051-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | Convert the seq_printf output with constant strings to seq_puts. Link: http://lkml.kernel.org/p/b416b016f4a6e49115ba736cad6ea2709a8bc1c4.1412031505.git.joe@perches.com Cc: Christine Caulfield <ccaulfie@redhat.com> Cc: David Teigland <teigland@redhat.com> Cc: cluster-devel@redhat.com Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * dlm: Remove seq_printf() return checks and use seq_has_overflowed()Joe Perches2014-11-051-134/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The seq_printf() return is going away soon and users of it should check seq_has_overflowed() to see if the buffer is full and will not accept any more data. Convert functions returning int to void where seq_printf() is used. Link: http://lkml.kernel.org/p/43590057bcb83846acbbcc1fe641f792b2fb7773.1412031505.git.joe@perches.com Link: http://lkml.kernel.org/r/20141029220107.939492048@goodmis.org Acked-by: David Teigland <teigland@redhat.com> Cc: Christine Caulfield <ccaulfie@redhat.com> Cc: cluster-devel@redhat.com Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * netfilter: Remove checks of seq_printf() return valuesSteven Rostedt (Red Hat)2014-11-056-97/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | The return value of seq_printf() is soon to be removed. Remove the checks from seq_printf() in favor of seq_has_overflowed(). Link: http://lkml.kernel.org/r/20141104142236.GA10239@salvia Acked-by: Pablo Neira Ayuso <pablo@netfilter.org> Cc: Patrick McHardy <kaber@trash.net> Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Cc: netfilter-devel@vger.kernel.org Cc: coreteam@netfilter.org Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * netfilter: Convert print_tuple functions to return voidJoe Perches2014-11-0517-69/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since adding a new function to seq_file (seq_has_overflowed()) there isn't any value for functions called from seq_show to return anything. Remove the int returns of the various print_tuple/<foo>_print_tuple functions. Link: http://lkml.kernel.org/p/f2e8cf8df433a197daa62cbaf124c900c708edc7.1412031505.git.joe@perches.com Cc: Pablo Neira Ayuso <pablo@netfilter.org> Cc: Patrick McHardy <kaber@trash.net> Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Cc: netfilter-devel@vger.kernel.org Cc: coreteam@netfilter.org Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * netfilter: Remove return values for print_conntrack callbacksSteven Rostedt (Red Hat)2014-11-057-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The seq_printf() and friends are having their return values removed. The print_conntrack() returns the result of seq_printf(), which is meaningless when seq_printf() returns void. Might as well remove the return values of print_conntrack() as well. Link: http://lkml.kernel.org/r/20141029220107.465008329@goodmis.org Acked-by: Pablo Neira Ayuso <pablo@netfilter.org> Cc: Patrick McHardy <kaber@trash.net> Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Cc: netfilter-devel@vger.kernel.org Cc: coreteam@netfilter.org Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * seq_file: Rename seq_overflow() to seq_has_overflowed() and make publicJoe Perches2014-10-303-22/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The return values of seq_printf/puts/putc are frequently misused. Start down a path to remove all the return value uses of these functions. Move the seq_overflow() to a global inlined function called seq_has_overflowed() that can be used by the users of seq_file() calls. Update the documentation to not show return types for seq_printf et al. Add a description of seq_has_overflowed(). Link: http://lkml.kernel.org/p/848ac7e3d1c31cddf638a8526fa3c59fa6fdeb8a.1412031505.git.joe@perches.com Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Joe Perches <joe@perches.com> [ Reworked the original patch from Joe ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* | kill f_dentry macroAl Viro2014-11-192-1/+4
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | Merge branch 'for-lustre' into for-nextAl Viro2014-11-1912-376/+265
|\ \
| * | lustre: use is_root_inode()Al Viro2014-11-033-11/+9
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | lustre: get rid of duplicate mountpoint checksAl Viro2014-11-031-35/+0
| | | | | | | | | | | | | | | | | | VFS has already done them Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | kill ll_link_generic()Al Viro2014-11-031-32/+27
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | ll_get_child_fid(): callers already have the childAl Viro2014-11-031-17/+7
| | | | | | | | | | | | | | | | | | no need to bother with d_lookup() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | kill ll_rename_generic()Al Viro2014-11-031-48/+35
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | kill ll_unlink_generic()Al Viro2014-11-031-42/+38
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | kill ll_rmdir_generic()Al Viro2014-11-031-32/+28
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | ll_new_inode(): don't bother with name - it's always &dentry->d_nameAl Viro2014-11-031-15/+15
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | kill ll_symlink_generic()Al Viro2014-11-031-19/+13
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | kill ll_mkdir_generic()Al Viro2014-11-031-21/+14
| | | | | | | | | | | | | | | | | | fold into ll_mkdir() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | kill ll_mknod_generic()Al Viro2014-11-031-14/+8
| | | | | | | | | | | | | | | | | | just fold into ll_mknod() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | lustre: switch ll_release_openhandle() to struct inode *Al Viro2014-11-033-9/+8
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | lustre: use file_inode()Al Viro2014-11-037-31/+29
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | lustre: use %p[dD]Al Viro2014-11-037-51/+47
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | lustre: opened file can't have negative dentryAl Viro2014-11-031-30/+21
| | | | | | | | | | | | | | | | | | | | | ... and ll_md_close() gets inode already equal to file_inode(file), along with ll_file_release() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | ll_setxattr(): get rid of struct file on stackAl Viro2014-11-033-11/+11
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | lustre: switch ll_intent_file_open() to struct dentry *Al Viro2014-11-031-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... because fake struct file is wrong. ll_prep_inode() in there is an atrocity - despite passing a pointer to inode by address, it actually only uses the value when that value is non-NULL, as it will be here. Oh, and ->d_parent of anything is never NULL. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | dcache: fix kmemcheck warning in switch_namesMikulas Patocka2014-11-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes kmemcheck warning in switch_names. The function switch_names swaps inline names of two dentries. It swaps full arrays d_iname, no matter how many bytes are really used by the strings. Reading data beyond string ends results in kmemcheck warning. We fix the bug by marking both arrays as fully initialized. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org # v3.15 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | new helper: audit_file()Al Viro2014-11-195-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | ... for situations when we don't have any candidate in pathnames - basically, in descriptor-based syscalls. [Folded the build fix for !CONFIG_AUDITSYSCALL configs from Chen Gang] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | nfsd_vfs_write(): use file_inode()Al Viro2014-11-191-3/+1
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | ncpfs: use file_inode()Al Viro2014-11-193-15/+9
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | kill f_dentry usesAl Viro2014-11-1919-37/+31
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | lockd: get rid of ->f_path.dentry->d_sbAl Viro2014-11-191-1/+1
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | procfs: get rid of ->f_dentryAl Viro2014-11-191-2/+2
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | nfsd: get rid of ->f_dentryAl Viro2014-11-191-1/+1
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | rpc_pipefs.c: get rid of f_dentryAl Viro2014-11-191-1/+1
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | afs_fsync: don't bother with ->f_path.dentryAl Viro2014-11-191-5/+4
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | cifs: get rid of ->f_path.dentry->d_sb uses, add a new helperAl Viro2014-11-194-11/+16
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | btrfs: get rid of f_dentry useAl Viro2014-11-191-1/+1
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | nfsd/nfsctl.c: new helperAl Viro2014-11-191-21/+16
| | | | | | | | | | | | | | | | | | ... to get from opened file on nfsctl to relevant struct net * Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | assorted conversions to %p[dD]Al Viro2014-11-1936-260/+194
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | switch d_materialise_unique() users to d_splice_alias()Al Viro2014-11-1911-29/+19
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | merge d_materialise_unique() into d_splice_alias()Al Viro2014-11-192-109/+36
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | Merge branch 'for-gfs2' into for-nextAl Viro2014-11-191-17/+9
|\ \ \
| * | | gfs2_atomic_open(): simplify the use of finish_no_open()Al Viro2014-11-191-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In ->atomic_open(inode, dentry, file, opened) calling finish_no_open(file, NULL) is equivalent to dget(dentry); return finish_no_open(file, dentry); No need to open-code that... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | gfs2_create_inode(): don't bother with d_splice_alias()Al Viro2014-11-191-14/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dentry is always hashed and negative, inode - non-error, non-NULL and non-directory. In such conditions d_splice_alias() is equivalent to "d_instantiate(dentry, inode) and return NULL", which simplifies the downstream code and is consistent with the "have to create a new object" case. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | gfs2: bugger off early if O_CREAT open finds a directoryAl Viro2014-11-191-0/+5
| | | | | | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | | d_add_ci() should just accept a hashed exact match if it finds oneAl Viro2014-11-191-39/+7
| | | | | | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | | | deal with deadlock in d_walk()Al Viro2014-11-031-15/+16
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | ... by not hitting rename_retry for reasons other than rename having happened. In other words, do _not_ restart when finding that between unlocking the child and locking the parent the former got into __dentry_kill(). Skip the killed siblings instead... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>