This reverts commit 16f1eeb660.
The reason for this patch was that lustre used copy_from_user_page.
Commit 76133e66b1 ("staging/lustre: Replace jobid acquiring with per
node setting") removed that usage.
So the arch restrictions can go.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove restriction the lustre must be built
as modules. It now works as a monolithic build.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
When the ptlrpc module is loaded, it starts the pinger thread and
calls LNetNIInit which starts various threads.
We don't need these threads until the module is actually being
used, such as when a lustre filesystem is mounted.
So move the thread creation into new ptlrpc_inc_ref() (modeled on
ptlrpcd_inc_ref()), and call that when needed, such as at mount time.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rather than allocating a ptlrpc_thread for the
stat-ahead thread, just use the task_struct provided
by kthreads directly.
As nothing ever waits for the sai_task, it must call do_exit()
directly rather than simply return from the function.
Also it cannot use kthread_should_stop() to know when to stop.
There is one caller which can ask it to stop so we need a simple
signaling mechanism. I've chosen to set ->sai_task to NULL
when the thread should finish up. The thread notices this and
cleans up and exits.
lli_sa_lock is used to avoid races between waking up the process
and the process exiting.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lustre has a 'struct ptlrpc_thread' which provides
control functionality wrapped around kthreads.
None of the functionality used in statahead.c requires
ptlrcp_thread - it can all be done directly with kthreads.
So discard the ptlrpc_thread and just use a task_struct directly.
One particular change worth noting is that in the current
code, the thread performs some start-up actions and then
signals that it is ready to go. In the new code, the thread
is first created, then the startup actions are perform, then
the thread is woken up. This means there is no need to wait
any more than kthread_create() already waits.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lustre has a "Pinger" kthread which periodically pings peers
to ensure all hosts are functioning.
This can more easily be done using a work queue.
As maintaining contact with other peers is import for
keeping the filesystem running, and as the filesystem might
be involved in freeing memory, it is safest to have a
separate WQ_MEM_RECLAIM workqueue.
The SVC_EVENT functionality to wake up the thread can be
replaced with mod_delayed_work().
Also use round_jiffies_up_relative() rather than setting a
minimum of 1 second delay. The PING_INTERVAL is measured in
seconds so this meets the need is allow the workqueue to
keep wakeups synchronized.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The garbage collection for security contexts currently
has a dedicated kthread which wakes up every 30 minutes
to discard old garbage.
Replace this with a simple delayed_work item on the
system work queue.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ldlm currenty has a kthread which wakes up every so often
and calls ldlm_pools_recalc().
The thread is started and stopped, but no other external interactions
happen.
This can trivially be replaced by a delayed_work if we have
ldlm_pools_recalc() reschedule the work rather than just report
when to do that.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
obdclass currently maintains two lists of data structures
(imports and exports), and a kthread which will free
anything on either list. The thread is woken whenever
anything is added to either list.
This is exactly the sort of thing that workqueues exist for.
So discard the zombie kthread and the lists and locks, and
create a single workqueue. Each obd_import and obd_export
gets a work_struct to attach to this workqueue.
This requires a small change to import_sec_validate_get()
which was testing if an obd_import was on the zombie
list. This cannot have every safely found it to be
on the list (as it could be freed asynchronously)
so it must be dead code.
We could use system_wq instead of creating a dedicated
zombie_wq, but as we occasionally want to flush all pending
work, it is a little nicer to only have to wait for our own
work items.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
These allocations are performed during initialization,
so they don't need GFP_NOFS.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
When the 'lustre' module is loaded, it gets a list of
net devices and uses the node ids to add entropy
to the prng. This means that the network interfaces need
to be configured before the module is loaded, which prevents
the module from being compiled into a monolithic kernel.
So move this entropy addition to the moment when
the interface is imported to LNet and the node id is first known.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ln_nportals should be zero when no portals have
been allocated. This ensures that memory allocation failure
is handled correctly elsewhere.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Some places in lu_object.c allow lct_owner to be NULL, implying
that the code is built in to the kernel (not a module), but
two places don't. This prevents us from building lustre into
the kernel.
So remove the requirement and always allow lct_owner to be NULL.
This requires removing an "assert" that the module count is positive,
but this is redundant as module_put() already does the necessary test.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Including agl_list_empty() in the wait_event_idle() condition
is pointless as the body of the loop doesn't do anything
about the agl list.
So if the list wasn't empty, the while loop would spin
indefinitely.
The test was removed in the lustre-release commit
672ab0e00d61 ("LU-3270 statahead: small fixes and cleanup"),
but not in the Linux commit 5231f7651c ("staging: lustre:
statahead: small fixes and cleanup").
Fixes: 5231f7651c ("staging: lustre: statahead: small fixes and cleanup")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The lustre-release patch commit bdc5bb52c554 ("LU-4933 osc:
Automatically increase the max_dirty_mb") changed
- if (cli->cl_dirty + PAGE_CACHE_SIZE <= cli->cl_dirty_max &&
+ if (cli->cl_dirty_pages < cli->cl_dirty_max_pages &&
When this patch landed in Linux a couple of years later, it landed as
- if (cli->cl_dirty + PAGE_SIZE <= cli->cl_dirty_max &&
+ if (cli->cl_dirty_pages <= cli->cl_dirty_max_pages &&
which is clearly different ('<=' vs '<'), and allows cl_dirty_pages to
increase beyond cl_dirty_max_pages - which causes a latter assertion
to fails.
Fixes: 3147b26840 ("staging: lustre: osc: Automatically increase the max_dirty_mb")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Commit 4f016420d3 ("Staging: lustre: obdclass: Use kasprintf") moved
some sprintf() calls earlier in the code to combine them with
memory allocation and create kasprintf() calls.
In one case, this code movement moved the sprintf to a location where the
values being formatter were different.
In particular
sprintf(niduuid, "%s_%x", mgcname, i);
was move from *after* the line
i = 0;
to a location where the value of 'i' was at least 1.
This cause the wrong name to be formatted, and triggers
CERROR("del MDC UUID %s failed: rc = %d\n",
niduuid, rc);
at unmount time.
So use '0' instead of 'i'.
Fixes: 4f016420d3 ("Staging: lustre: obdclass: Use kasprintf")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove else after a return statement as it is not useful. Issue found
using checkpatch.
Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
gcc warns that function 'qbman_pull_desc_set_token' is not used.
drivers/staging/fsl-mc/bus/dpio/qbman-portal.c:525:13: warning: ‘qbman_pull_desc_set_token’ defined but not used [-Wunused-function]
In the current code we remove that function.
Fixes: 321eecb06b ("bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix 'line over 80 character' issues found by checkpatch.pl script by
use of temporary variable and avoided leading tab.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix 'line over 80 char' issues found by checkpatch.pl script in
handle_cfg_param(). Rename variables and used temporary variables
to fix the line over 80 characters issue.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor wilc_wlan_handle_rxq() to fix line over 80 character issue
found by checkpatch.pl script. Added a new function to split
'wilc_wlan_handle_rxq' function code.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix 'Alignment should match open parenthesis' issue found by
checkpatch.pl script. Reduce the leading tab, to make space for open
parenthesis match.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Indent the parameters for a function call that extends past 80 characters.
Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use a blank line after components_show() function declaration.
Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
These pointers can't be NULL so I have removed the checks.
The checking was sort of problematic as well because it didn't make
sense. In _nbu2ss_read_request_data() the && should have been ||. In
nbu2ss_gad_get_frame() we know that "pgadget" is non-NULL and "udc" is
an offset from "pgadget" so it can't be NULL.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
It's not used in-tree, or in the downstream tree.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Replace NULL comparison of the variable with the variable name or
!variable to conform to the Linux kernel coding style. Issue found using
checkpatch.
Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Place constants on the right side of the test during comparisons to
conform to the Linux kernel coding style. Issue found using checkpatch.
Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Coccinelle was used to do the replacement and add the
header file linux/etherdevice.h if not already present.
The Coccinelle semantic patch that makes this change is as follows:
@header@
@@
#include <linux/etherdevice.h>
@r1@
expression e;
@@
-memset(e,0x00,ETH_ALEN);
+eth_zero_addr(e);
@includeheader depends on r1 && !header@
@@
+ #include <linux/etherdevice.h>
#include <...>
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add spaces around arithmetic and bitwise operators to improve
readability of the code.
Issues found with checkpatch.pl
Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove unnecessary parentheses between 'address-of' operators
and a struct members.
Issues found with checkpatch.pl
Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix multiple blank lines and blank lines after braces.
Issues found with checkpatch.pl
Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove unnecessary parentheses around variables to conform to the Linux
kernel coding style. Issue found using checkpatch.
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add spaces around '|' to conform to the Linux
kernel coding style. Issue found using checkpatch.
CHECK: spaces preferred around that '|'.
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>