summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre
AgeCommit message (Collapse)Author
2018-06-05staging: lustre: delete the filesystem from the tree.Greg Kroah-Hartman
The Lustre filesystem has been in the kernel tree for over 5 years now. While it has been an endless source of enjoyment for new kernel developers learning how to do basic codingstyle cleanups, as well as an semi-entertaining source of bewilderment from the vfs developers any time they have looked into the codebase to try to figure out how to port their latest api changes to this filesystem, it has not really moved forward into the "this is in shape to get out of staging" despite many half-completed attempts. And getting code out of staging is the main goal of that portion of the kernel tree. Code should not stagnate and it feels like having this code in staging is only causing the development cycle of the filesystem to take longer than it should. There is a whole separate out-of-tree copy of this codebase where the developers work on it, and then random changes are thrown over the wall at staging at some later point in time. This dual-tree development model has never worked, and the state of this codebase is proof of that. So, let's just delete the whole mess. Now the lustre developers can go off and work in their out-of-tree codebase and not have to worry about providing valid changelog entries and breaking their patches up into logical pieces. They can take the time they have spend doing those types of housekeeping chores and get the codebase into a much better shape, and it can be submitted for inclusion into the real part of the kernel tree when ready. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-01staging: lustre: get rid of ldebugfs_remove()Greg Kroah-Hartman
It was just a dumb wrapper around debugfs_remove_recursive() so just call the function properly. Also, there is no need to set the dentry to NULL, it's gone, who cares about it anymore... Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: NeilBrown <neilb@suse.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Roman Storozhenko <romeusmeister@gmail.com> Cc: Aastha Gupta <aastha.gupta4104@gmail.com> Cc: Ben Evans <bevans@cray.com> Cc: Quentin Bouget <quentin.bouget@cea.fr> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Cc: Arushi Singhal <arushisinghal19971997@gmail.com> Cc: Patrick Farrell <paf@cray.com> Cc: Aliaksei Karaliou <akaraliou.dev@gmail.com> Cc: Mathias Rav <mathiasrav@gmail.com> Cc: Andriy Skulysh <andriy.skulysh@seagate.com> Cc: Dafna Hirschfeld <dafna3@gmail.com> Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com> Cc: Bob Glosman <bob.glossman@intel.com> Cc: lustre-devel@lists.lustre.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-01staging: lustre: make ldebugfs_add_vars a void functionGreg Kroah-Hartman
The call to ldebugfs_add_vars() can not really fail, so have it just return nothing, which allows us to clean up a lot of unused error handling code. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: NeilBrown <neilb@suse.com> Cc: Roman Storozhenko <romeusmeister@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Quentin Bouget <quentin.bouget@cea.fr> Cc: Aastha Gupta <aastha.gupta4104@gmail.com> Cc: Ben Evans <bevans@cray.com> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Cc: Arushi Singhal <arushisinghal19971997@gmail.com> Cc: Frank Zago <fzago@cray.com> Cc: Patrick Farrell <paf@cray.com> Cc: Simo Koskinen <koskisoft@gmail.com> Cc: Andriy Skulysh <andriy.skulysh@seagate.com> Cc: "John L. Hammond" <john.hammond@intel.com> Cc: Mathias Rav <mathiasrav@gmail.com> Cc: Dafna Hirschfeld <dafna3@gmail.com> Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com> Cc: lustre-devel@lists.lustre.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-01staging: lustre: remove last two users of ldebugfs_register()Greg Kroah-Hartman
ldebugfs_register() is just a call to debugfs_create_dir() and ldebugfs_add_vars() if the list option is set. Fix up the last two users of this function to just call these two functions instead, and delete the now unused ldebugfs_register() call. This ends up cleaning up more code and making things smaller, always a good thing. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: NeilBrown <neilb@suse.com> Cc: Ben Evans <bevans@cray.com> Cc: Quentin Bouget <quentin.bouget@cea.fr> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Cc: Arushi Singhal <arushisinghal19971997@gmail.com> Cc: Julia Lawall <julia.lawall@lip6.fr> Cc: Mathias Rav <mathiasrav@gmail.com> Cc: Dafna Hirschfeld <dafna3@gmail.com> Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com> Cc: Patrick Farrell <paf@cray.com> Cc: Nadav Amit <namit@vmware.com> Cc: lustre-devel@lists.lustre.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-01staging: lustre: unwrap some ldebugfs_register() callsGreg Kroah-Hartman
When the third option (list) to ldebugfs_register() is NULL, it's the same as just calling debugfs_create_dir(). So unwind this and call debugfs_create_dir() directly. This ends up saving lots of code as we do not need to do any error checking of the return value (because it does not matter). The ldebugfs_register() call will be removed in a later patch when it is fully removed, right now there are 2 outstanding users of it in the tree. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: NeilBrown <neilb@suse.com> Cc: Aastha Gupta <aastha.gupta4104@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Ingo Molnar <mingo@kernel.org> Cc: Quentin Bouget <quentin.bouget@cea.fr> Cc: Patrick Farrell <paf@cray.com> Cc: Aliaksei Karaliou <akaraliou.dev@gmail.com> Cc: "John L. Hammond" <john.hammond@intel.com> Cc: Mathias Rav <mathiasrav@gmail.com> Cc: Andriy Skulysh <andriy.skulysh@seagate.com> Cc: Ben Evans <bevans@cray.com> Cc: Bob Glosman <bob.glossman@intel.com> Cc: lustre-devel@lists.lustre.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-01staging: lustre: remove ldebugfs_obd_seq_create() wrapper functionGreg Kroah-Hartman
It was just calling debugfs_create_file() so unwind things and just call the real function instead. This ends up saving a number of lines as there was never any error handling happening anyway, so that all can be removed as well. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: Quentin Bouget <quentin.bouget@cea.fr> Cc: Ben Evans <bevans@cray.com> Cc: NeilBrown <neilb@suse.com> Cc: Arushi Singhal <arushisinghal19971997@gmail.com> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Cc: Julia Lawall <julia.lawall@lip6.fr> Cc: Dafna Hirschfeld <dafna3@gmail.com> Cc: Mathias Rav <mathiasrav@gmail.com> Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com> Cc: Roman Storozhenko <romeusmeister@gmail.com> Cc: lustre-devel@lists.lustre.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-01staging: lustre: remove ldebugfs_seq_create() wrapper functionGreg Kroah-Hartman
It was just calling debugfs_create_file() so unwind things and just call the real function instead. This ends up saving a number of lines as there was never any error handling happening anyway, so that all can be removed as well. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: Quentin Bouget <quentin.bouget@cea.fr> Cc: NeilBrown <neilb@suse.com> Cc: Ben Evans <bevans@cray.com> Cc: Arushi Singhal <arushisinghal19971997@gmail.com> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Cc: "John L. Hammond" <john.hammond@intel.com> Cc: Vitaly Fertman <vitaly.fertman@seagate.com> Cc: Julia Lawall <julia.lawall@lip6.fr> Cc: Dafna Hirschfeld <dafna3@gmail.com> Cc: Mathias Rav <mathiasrav@gmail.com> Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com> Cc: Bob Glosman <bob.glossman@intel.com> Cc: lustre-devel@lists.lustre.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-01staging: lustre: remove ldebugfs_register_stats() wrapper functionGreg Kroah-Hartman
It was just calling debugfs_create_file() so unwind things and just call the real function instead. This ends up saving a number of lines as there was never any error handling happening anyway, so that all can be removed as well. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: Ben Evans <bevans@cray.com> Cc: Quentin Bouget <quentin.bouget@cea.fr> Cc: NeilBrown <neilb@suse.com> Cc: Arushi Singhal <arushisinghal19971997@gmail.com> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Cc: Patrick Farrell <paf@cray.com> Cc: Aliaksei Karaliou <akaraliou.dev@gmail.com> Cc: Aastha Gupta <aastha.gupta4104@gmail.com> Cc: Dafna Hirschfeld <dafna3@gmail.com> Cc: Mathias Rav <mathiasrav@gmail.com> Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com> Cc: Bob Glosman <bob.glossman@intel.com> Cc: lustre-devel@lists.lustre.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-01staging: lustre: remove ldebugfs_add_simple() wrapperGreg Kroah-Hartman
It was only being called in one place, and is an unneeded wrapper function around debugfs_create_file() so just call the real debugfs function instead. This ends up cleaning up some unneeded error handling logic that was never needed as well. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: Quentin Bouget <quentin.bouget@cea.fr> Cc: Ben Evans <bevans@cray.com> Cc: NeilBrown <neilb@suse.com> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Cc: Arushi Singhal <arushisinghal19971997@gmail.com> Cc: Dafna Hirschfeld <dafna3@gmail.com> Cc: Mathias Rav <mathiasrav@gmail.com> Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com> Cc: lustre-devel@lists.lustre.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-01staging: lustre: no need to check debugfs return valuesGreg Kroah-Hartman
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Clean up the lustre core code by not caring about the value of debugfs calls. This ends up removing a number of lines of code that are not needed. Note, more work is needed to remove the unneeded debugfs wrapper functions in the future. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: NeilBrown <neilb@suse.com> Cc: Ben Evans <bevans@cray.com> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Cc: "John L. Hammond" <john.hammond@intel.com> Cc: Dafna Hirschfeld <dafna3@gmail.com> Cc: Mathias Rav <mathiasrav@gmail.com> Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com> Cc: lustre-devel@lists.lustre.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-31staging: lustre: include linux/highmem.h when neededArnd Bergmann
Something in recent linux-next kernels caused linux/highmem.h to no longer be included implicitly from o2iblnd_cb.c, causing a build failure: drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c: In function 'kiblnd_kvaddr_to_page': drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:549:15: error: 'PKMAP_BASE' undeclared (first use in this function); did you mean 'RTM_BASE'? if (vaddr >= PKMAP_BASE && ^~~~~~~~~~ RTM_BASE drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:549:15: note: each undeclared identifier is reported only once for each function it appears in drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:550:28: error: 'LAST_PKMAP' undeclared (first use in this function); did you mean 'AT_HWCAP'? vaddr < (PKMAP_BASE + LAST_PKMAP * PAGE_SIZE)) { ^~~~~~~~~~ AT_HWCAP This adds back an explicit include for the header. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-31staging: lustre: mdc: excessive memory consumption by the xattr cacheAndrew Perepechko
The refill operation of the xattr cache does not know the reply size in advance, so it makes a guess based on the maxeasize value returned by the MDS. In practice, it allocates 16 KiB for the common case and 4 MiB for the large xattr case. However, a typical reply is just a few hundred bytes. If we follow the conservative approach, we can prepare a single memory page for the reply. It is large enough for any reasonable xattr set and, at the same time, it does not require multiple page memory reclaim, which can be costly. If, for a specific file, the reply is larger than a single page, the client is prepared to handle that and will fall back to non-cached xattr code. Indeed, if this happens often and xattrs are often used to store large values, it makes sense to disable the xattr cache at all since it wasn't designed for such [mis]use. Signed-off-by: Andrew Perepechko <c17827@cray.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9417 Reviewed-on: https://review.whamcloud.com/26887 Reviewed-by: Fan Yong <fan.yong@intel.com> Reviewed-by: Ben Evans <bevans@cray.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-31staging: lustre: acl: increase ACL entries limitationFan Yong
Originally, the limitation of ACL entries is 32, that is not enough for some use cases. In fact, restricting ACL entries count is mainly for preparing the RPC reply buffer to receive the ACL data. So we cannot make the ACL entries count to be unlimited. But we can enlarge the RPC reply buffer to hold more ACL entries. On the other hand, MDT backend filesystem has its own EA size limitation. For example, for ldiskfs case, if large EA enable, then the max ACL size is 1048492 bytes; otherwise, it is 4012 bytes. For ZFS backend, such value is 32768 bytes. With such hard limitation, we can calculate how many ACL entries we can have at most. This patch increases the RPC reply buffer to match such hard limitation. For old client, to avoid buffer overflow because of large ACL data (more than 32 ACL entries), the MDT will forbid the old client to access the file with large ACL data. As for how to know whether it is old client or new, a new connection flag OBD_CONNECT_LARGE_ACL is used for that. Signed-off-by: Fan Yong <fan.yong@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7473 Reviewed-on: https://review.whamcloud.com/19790 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Li Xi <lixi@ddn.com> Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-31staging: lustre: llite: remove unused parameters from md_{get, set}xattr()John L. Hammond
md_getxattr() and md_setxattr() each have several unused parameters. Remove them and improve the naming or remaining parameters. Signed-off-by: John L. Hammond <john.hammond@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10792 Reviewed-on: https://review.whamcloud.com/ Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-31staging: lustre: llite: add support set_acl method in inode operationsDmitry Eremin
Linux kernel v3.14 adds set_acl method to inode operations. This patch adds support to Lustre for proper acl management. Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183 Reviewed-on: https://review.whamcloud.com/25965 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10541 Reviewed-on: https://review.whamcloud.com/31588 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10926 Reviewed-on: https://review.whamcloud.com/32045 Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-31staging: lustre: llite: create acl.c fileJames Simmons
Move ll_get_acl() to its own file acl.c just like all the other linux file systems do. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142 Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-26staging: lustre: fix more build errors in errno.cGreg Kroah-Hartman
And we need even more .h files to be included to build this file. So add kernel.h and module.h, and hopefully that's enough... Reported-by: kbuild test robot <lkp@intel.com> Fixes: 0922c0084b91 ("staging: lustre: remove libcfs_all from ptlrpc") Cc: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-26staging: lustre: fix build error in errno.cGreg Kroah-Hartman
Turns out we need some more .h files to build properly on all arches. Specifically errno.h for this file. Reported-by: kbuild test robot <lkp@intel.com> Fixes: 0922c0084b91 ("staging: lustre: remove libcfs_all from ptlrpc") Cc: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-26staging: lustre: fix build error in mdc_request.cGreg Kroah-Hartman
Turns out we need some more .h files to build properly on all arches. Specifically prefetch.h for this file. Reported-by: kbuild test robot <lkp@intel.com> Fixes: 73d65c8d1a85 ("staging: lustre: remove libcfs_all.h from lustre/include/*.h") Cc: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: libcfs: add parens around macros argsIvan Bornyakov
One may call 'CFS_FAIL_TIMEOUT(id, secs + 5);' and get unexpected result after macro substitution, viz., 'secs + 5' will turn into 'secs + 5 * 1000' Signed-off-by: Ivan Bornyakov <brnkv.i1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: Fix block comments styleSabin Mihai Rapan
This patch fixes the checkpatch.pl warning: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line Signed-off-by: Sabin Mihai Rapan <sabin.rapan@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: Fix "unsigned"->"unsigned int"Sabin Mihai Rapan
This patch fixes the checkpatch.pl warning: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Sabin Mihai Rapan <sabin.rapan@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: Fix "Possible intergrate"->"Possibly integrate"Sabin Mihai Rapan
Trivial fix to spelling mistake in TODO file. Signed-off-by: Sabin Mihai Rapan <sabin.rapan@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: Fix "from from"->"from"Sabin Mihai Rapan
Trivial fix to spelling mistake in README.txt Signed-off-by: Sabin Mihai Rapan <sabin.rapan@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove libcfs_all.hNeilBrown
In the remaining files that include libcfs_all.h, replace it with other include files as necessary, then remove libcfs_all.h Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: move all libcfs_all includes except in lustre/lnet/libcfs/NeilBrown
Again, most of these are not needed. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove remaining libcfs_all.h includes from lustre/lustreNeilBrown
Most of these aren't needed, a few can be simplified. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove libcfs_all.h from fid, fld, obdclassNeilBrown
None of these files seem to nee libcfs_all.h Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove libcfs_all from ptlrpcNeilBrown
Some files didn't need it at all, others just needed one or two includes. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove libcfs_all.h from remaining .h files.NeilBrown
Now no *.h files include libcfs_all.h - only *.c files. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove libcfs_all.h from lustre/include/*.hNeilBrown
Instead of the catch-all libcfs_all.h, just include the files actually needed in different places. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove libcfs_all.h from includes lustre/lnetNeilBrown
Some of these include files didn't need to include libcfs_all.h. A couple did so replace with just the base include files needed. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove libcfs_all.h includes from lnet/klndNeilBrown
Other smaller include files are sufficient. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: don't include libcfs.h in lnet/lib-lnet.hNeilBrown
We want to be more focused in what is included where. So we remove libcfs.h from where it isn't needed. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: start moving includes out of libcfs.hNeilBrown
Lots of places include libcfs.h, and it includes lots of other include files. Many of these aren't needed in many places. It is tidier and better documentation to just include what is needed. So remove all the includes from libcfs.h and create libcfs_all.h which contains them. Then change every reference to libcfs.h to instead include libcfs_all.h Next several patches will remove that from various files in small batches Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: discard libcfs_prim.hNeilBrown
This file no longer contains enough content to justify a separate file. So merge with libcfs.h. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: replace memory_presure funcitons by standard interfaces.NeilBrown
Use memalloc_noreclaim_save() and memalloc_noreclaim_restore(), and for testing, just directly test the flag in current->flags Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: move RESV_PORT definitions to lnet/lib-lnet.hNeilBrown
These are network related on only used in lnet, so move to lib-lnet.h Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: move lnet_debug_log_upcall declaration to tracefile.hNeilBrown
Both files that use this variable include tracefile.h, and it seems a more suitable home for the declaration. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: make lnet_debugfs_symlink_def local to libcfs/modules.cNeilBrown
This type is only used in libcfs/module.c, so make it local to there. If any other module ever wanted to add its own symlinks, it would probably be easiest to export lnet_debugfs_root and just call debugfs_create_symlink as required. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: clean up __LIBCFS_H macroNeilBrown
There is some confusion with names here - make it all uniform. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: replace libcfs_register_ioctl with a blocking notifier_chainNeilBrown
libcfs allows other modules to register handlers for ioctls. The implementation it uses for this is nearly identical to a blocking notifier chain, so change to use that. The biggest difference is that the return value from notifier has a defined format, where libcfs_register_ioctl uses -EINVAL to mean "continue". This requires a little bit of conversion. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: discard cfs_block_sigsinv()NeilBrown
cfs_block_sigsinv() and cfs_restore_sigs() are simple wrappers which save a couple of line of code and hurt readability for people not familiar with them. They aren't used often enough to be worthwhile, so discard them and open-code the functionality. The sigorsets() call isn't needed as or-ing with current->blocked is exactly what sigprocmask(SIG_BLOCK) does. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: move LERRCHKSUM() to libcfs_debug.hNeilBrown
This macro is only used for debug messages, so use it to the debug code. Also improve the documentation slightly. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: discard CFS_TICKNeilBrown
This undocumented macro seems to represent "a small amount of time". Sometimes it is used as-is, some times it is multiplied by 5 for no obvious reason. It does not appear that there is any connection between the different places it is used - they all just want a short period for different purposes and of different durarions. So discard CFS_TICK and lets each use-site just use whatever number of jiffies seems appropriate in that case. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: discard LOWEST_BIT_SET()NeilBrown
This macro is only used once to test if a value is a power of two. So use is_power_of_2() instead and discard the macro. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: discard cfs_cap_t, use kernel_cap_tNeilBrown
lustre only sends 32bits of capabilities in on-the-wire RPC calls. It current strips off higher bits and uses a 32bit cfs_cap_t throughout. Though there is a small memory cost, it is cleaner to use kernel_cap_t throughout and only truncate when marshalling data for RPC calls. So this patch replaces cfs_cap_t with kernel_cap_t throughout, and where a cfs_cap_t was previous stored in a __u32, we now store cap.cap[0] instead. With this, we can remove include/linux/libcfs/curproc.h Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: simplify capability dropping.NeilBrown
Lustre has a 'squash credentials' concept similar to the "anon_uid" for nfsd. When accessing a file with squashed credentials, we need to also drop capabilities. Linux has cap_drop_fs_set() and cap_drop_nfsd_set(). Rather than taking a completely different approach, this patch changes lustre to use this same cap_drop_*_set() approach. With this change we also drop CAP_MKNOD and CAP_MAC_OVERRIDE which are probably appropriate, and don't drop CAP_SYS_ADMIN or CAP_SYS_BOOT which should be irrelevant for file permission checking Calling both cap_drop_*_set() seems a bit clumsy, but gets the job done. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove current_pid() and current_comm()NeilBrown
Just use current->pid and current->comm directly, instead of having wrappers. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: lustre: remove conditional compilation from libcfs_cpu.cNeilBrown
libcfs_cpu.c manages CPU partitions. In the !CONFIG_SMP case, most of this disappears and 'static inline's from libcfs_cpu.h are used. However we still allocate a 'struct cfs_cpt_table' and keep some dummy data in it. This is a bit pointless. This patch removes all the !CONFIG_SMP code from libcfs_cpu.c and conditionally compiles the whole file only when CONFIG_SMP. We no longer allocate a 'struct cfs_cpt_table' on !CONFIG_SMP, and don't even declare a structure. The name "cfs_cpt_tab" becomes always "NULL", which allows some code to be optimized away. This means that cfs_cpt_tab can sometimes be NULL, so we need to discard the assertion that it isn't. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>