Commit 902f3bb1 authored by Andreas Ruprecht's avatar Andreas Ruprecht Committed by Greg Kroah-Hartman

staging: lustre: ldlm: Add missing newlines after declarations

checkpatch.pl complains about a number of missing newlines after
declarations. This patch gets rid of these warnings.
Signed-off-by: default avatarAndreas Ruprecht <rupran@einserver.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ce6bed69
...@@ -73,6 +73,7 @@ static inline int extent_compare(struct interval_node_extent *e1, ...@@ -73,6 +73,7 @@ static inline int extent_compare(struct interval_node_extent *e1,
struct interval_node_extent *e2) struct interval_node_extent *e2)
{ {
int rc; int rc;
if (e1->start == e2->start) { if (e1->start == e2->start) {
if (e1->end < e2->end) if (e1->end < e2->end)
rc = -1; rc = -1;
...@@ -321,6 +322,7 @@ static void interval_insert_color(struct interval_node *node, ...@@ -321,6 +322,7 @@ static void interval_insert_color(struct interval_node *node,
/* Parent is RED, so gparent must not be NULL */ /* Parent is RED, so gparent must not be NULL */
if (node_is_left_child(parent)) { if (node_is_left_child(parent)) {
struct interval_node *uncle; struct interval_node *uncle;
uncle = gparent->in_right; uncle = gparent->in_right;
if (uncle && node_is_red(uncle)) { if (uncle && node_is_red(uncle)) {
uncle->in_color = INTERVAL_BLACK; uncle->in_color = INTERVAL_BLACK;
...@@ -340,6 +342,7 @@ static void interval_insert_color(struct interval_node *node, ...@@ -340,6 +342,7 @@ static void interval_insert_color(struct interval_node *node,
__rotate_right(gparent, root); __rotate_right(gparent, root);
} else { } else {
struct interval_node *uncle; struct interval_node *uncle;
uncle = gparent->in_left; uncle = gparent->in_left;
if (uncle && node_is_red(uncle)) { if (uncle && node_is_red(uncle)) {
uncle->in_color = INTERVAL_BLACK; uncle->in_color = INTERVAL_BLACK;
...@@ -427,6 +430,7 @@ static void interval_erase_color(struct interval_node *node, ...@@ -427,6 +430,7 @@ static void interval_erase_color(struct interval_node *node,
} else { } else {
if (node_is_black_or_0(tmp->in_right)) { if (node_is_black_or_0(tmp->in_right)) {
struct interval_node *o_left; struct interval_node *o_left;
o_left = tmp->in_left; o_left = tmp->in_left;
if (o_left) if (o_left)
o_left->in_color = INTERVAL_BLACK; o_left->in_color = INTERVAL_BLACK;
...@@ -458,6 +462,7 @@ static void interval_erase_color(struct interval_node *node, ...@@ -458,6 +462,7 @@ static void interval_erase_color(struct interval_node *node,
} else { } else {
if (node_is_black_or_0(tmp->in_left)) { if (node_is_black_or_0(tmp->in_left)) {
struct interval_node *o_right; struct interval_node *o_right;
o_right = tmp->in_right; o_right = tmp->in_right;
if (o_right) if (o_right)
o_right->in_color = INTERVAL_BLACK; o_right->in_color = INTERVAL_BLACK;
......
...@@ -182,7 +182,9 @@ void ldlm_extent_add_lock(struct ldlm_resource *res, ...@@ -182,7 +182,9 @@ void ldlm_extent_add_lock(struct ldlm_resource *res,
root = &res->lr_itree[idx].lit_root; root = &res->lr_itree[idx].lit_root;
found = interval_insert(&node->li_node, root); found = interval_insert(&node->li_node, root);
if (found) { /* The policy group found. */ if (found) { /* The policy group found. */
struct ldlm_interval *tmp = ldlm_interval_detach(lock); struct ldlm_interval *tmp;
tmp = ldlm_interval_detach(lock);
LASSERT(tmp != NULL); LASSERT(tmp != NULL);
ldlm_interval_free(tmp); ldlm_interval_free(tmp);
ldlm_interval_attach(to_ldlm_interval(found), lock); ldlm_interval_attach(to_ldlm_interval(found), lock);
......
...@@ -291,6 +291,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, ...@@ -291,6 +291,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,
} }
} else { } else {
int reprocess_failed = 0; int reprocess_failed = 0;
lockmode_verify(mode); lockmode_verify(mode);
/* This loop determines if there are existing locks /* This loop determines if there are existing locks
......
...@@ -214,6 +214,7 @@ static inline struct ldlm_extent * ...@@ -214,6 +214,7 @@ static inline struct ldlm_extent *
ldlm_interval_extent(struct ldlm_interval *node) ldlm_interval_extent(struct ldlm_interval *node)
{ {
struct ldlm_lock *lock; struct ldlm_lock *lock;
LASSERT(!list_empty(&node->li_group)); LASSERT(!list_empty(&node->li_group));
lock = list_entry(node->li_group.next, struct ldlm_lock, lock = list_entry(node->li_group.next, struct ldlm_lock,
......
...@@ -226,6 +226,7 @@ EXPORT_SYMBOL(ldlm_lock_put); ...@@ -226,6 +226,7 @@ EXPORT_SYMBOL(ldlm_lock_put);
int ldlm_lock_remove_from_lru_nolock(struct ldlm_lock *lock) int ldlm_lock_remove_from_lru_nolock(struct ldlm_lock *lock)
{ {
int rc = 0; int rc = 0;
if (!list_empty(&lock->l_lru)) { if (!list_empty(&lock->l_lru)) {
struct ldlm_namespace *ns = ldlm_lock_to_ns(lock); struct ldlm_namespace *ns = ldlm_lock_to_ns(lock);
...@@ -858,6 +859,7 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode) ...@@ -858,6 +859,7 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode)
void ldlm_lock_decref(struct lustre_handle *lockh, __u32 mode) void ldlm_lock_decref(struct lustre_handle *lockh, __u32 mode)
{ {
struct ldlm_lock *lock = __ldlm_handle2lock(lockh, 0); struct ldlm_lock *lock = __ldlm_handle2lock(lockh, 0);
LASSERTF(lock != NULL, "Non-existing lock: %#llx\n", lockh->cookie); LASSERTF(lock != NULL, "Non-existing lock: %#llx\n", lockh->cookie);
ldlm_lock_decref_internal(lock, mode); ldlm_lock_decref_internal(lock, mode);
LDLM_LOCK_PUT(lock); LDLM_LOCK_PUT(lock);
...@@ -1286,6 +1288,7 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags, ...@@ -1286,6 +1288,7 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,
__u64 wait_flags = LDLM_FL_LVB_READY | __u64 wait_flags = LDLM_FL_LVB_READY |
LDLM_FL_DESTROYED | LDLM_FL_FAIL_NOTIFIED; LDLM_FL_DESTROYED | LDLM_FL_FAIL_NOTIFIED;
struct l_wait_info lwi; struct l_wait_info lwi;
if (lock->l_completion_ast) { if (lock->l_completion_ast) {
int err = lock->l_completion_ast(lock, int err = lock->l_completion_ast(lock,
LDLM_FL_WAIT_NOREPROC, LDLM_FL_WAIT_NOREPROC,
...@@ -2219,6 +2222,7 @@ void _ldlm_lock_debug(struct ldlm_lock *lock, ...@@ -2219,6 +2222,7 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
nid = libcfs_nid2str(exp->exp_connection->c_peer.nid); nid = libcfs_nid2str(exp->exp_connection->c_peer.nid);
} else if (exp && exp->exp_obd != NULL) { } else if (exp && exp->exp_obd != NULL) {
struct obd_import *imp = exp->exp_obd->u.cli.cl_import; struct obd_import *imp = exp->exp_obd->u.cli.cl_import;
nid = libcfs_nid2str(imp->imp_connection->c_peer.nid); nid = libcfs_nid2str(imp->imp_connection->c_peer.nid);
} }
......
...@@ -190,6 +190,7 @@ static void ldlm_handle_cp_callback(struct ptlrpc_request *req, ...@@ -190,6 +190,7 @@ static void ldlm_handle_cp_callback(struct ptlrpc_request *req,
if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CANCEL_BL_CB_RACE)) { if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CANCEL_BL_CB_RACE)) {
int to = cfs_time_seconds(1); int to = cfs_time_seconds(1);
while (to > 0) { while (to > 0) {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(to); schedule_timeout(to);
...@@ -884,6 +885,7 @@ void ldlm_put_ref(void) ...@@ -884,6 +885,7 @@ void ldlm_put_ref(void)
mutex_lock(&ldlm_ref_mutex); mutex_lock(&ldlm_ref_mutex);
if (ldlm_refcount == 1) { if (ldlm_refcount == 1) {
int rc = ldlm_cleanup(); int rc = ldlm_cleanup();
if (rc) if (rc)
CERROR("ldlm_cleanup failed: %d\n", rc); CERROR("ldlm_cleanup failed: %d\n", rc);
else else
...@@ -966,6 +968,7 @@ static cfs_hash_ops_t ldlm_export_lock_ops = { ...@@ -966,6 +968,7 @@ static cfs_hash_ops_t ldlm_export_lock_ops = {
int ldlm_init_export(struct obd_export *exp) int ldlm_init_export(struct obd_export *exp)
{ {
int rc; int rc;
exp->exp_lock_hash = exp->exp_lock_hash =
cfs_hash_create(obd_uuid2str(&exp->exp_client_uuid), cfs_hash_create(obd_uuid2str(&exp->exp_client_uuid),
HASH_EXP_LOCK_CUR_BITS, HASH_EXP_LOCK_CUR_BITS,
......
...@@ -943,6 +943,7 @@ EXPORT_SYMBOL(ldlm_pool_del); ...@@ -943,6 +943,7 @@ EXPORT_SYMBOL(ldlm_pool_del);
__u64 ldlm_pool_get_slv(struct ldlm_pool *pl) __u64 ldlm_pool_get_slv(struct ldlm_pool *pl)
{ {
__u64 slv; __u64 slv;
spin_lock(&pl->pl_lock); spin_lock(&pl->pl_lock);
slv = pl->pl_server_lock_volume; slv = pl->pl_server_lock_volume;
spin_unlock(&pl->pl_lock); spin_unlock(&pl->pl_lock);
...@@ -971,6 +972,7 @@ EXPORT_SYMBOL(ldlm_pool_set_slv); ...@@ -971,6 +972,7 @@ EXPORT_SYMBOL(ldlm_pool_set_slv);
__u64 ldlm_pool_get_clv(struct ldlm_pool *pl) __u64 ldlm_pool_get_clv(struct ldlm_pool *pl)
{ {
__u64 slv; __u64 slv;
spin_lock(&pl->pl_lock); spin_lock(&pl->pl_lock);
slv = pl->pl_client_lock_volume; slv = pl->pl_client_lock_volume;
spin_unlock(&pl->pl_lock); spin_unlock(&pl->pl_lock);
......
...@@ -135,6 +135,7 @@ EXPORT_SYMBOL(ldlm_expired_completion_wait); ...@@ -135,6 +135,7 @@ EXPORT_SYMBOL(ldlm_expired_completion_wait);
int ldlm_get_enq_timeout(struct ldlm_lock *lock) int ldlm_get_enq_timeout(struct ldlm_lock *lock)
{ {
int timeout = at_get(ldlm_lock_to_ns_at(lock)); int timeout = at_get(ldlm_lock_to_ns_at(lock));
if (AT_OFF) if (AT_OFF)
return obd_timeout / 2; return obd_timeout / 2;
/* Since these are non-updating timeouts, we should be conservative. /* Since these are non-updating timeouts, we should be conservative.
...@@ -601,6 +602,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req, ...@@ -601,6 +602,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req,
* again. */ * again. */
if ((*flags) & LDLM_FL_LOCK_CHANGED) { if ((*flags) & LDLM_FL_LOCK_CHANGED) {
int newmode = reply->lock_desc.l_req_mode; int newmode = reply->lock_desc.l_req_mode;
LASSERT(!is_replay); LASSERT(!is_replay);
if (newmode && newmode != lock->l_req_mode) { if (newmode && newmode != lock->l_req_mode) {
LDLM_DEBUG(lock, "server returned different mode %s", LDLM_DEBUG(lock, "server returned different mode %s",
...@@ -669,6 +671,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req, ...@@ -669,6 +671,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req,
rc = ldlm_lock_enqueue(ns, &lock, NULL, flags); rc = ldlm_lock_enqueue(ns, &lock, NULL, flags);
if (lock->l_completion_ast != NULL) { if (lock->l_completion_ast != NULL) {
int err = lock->l_completion_ast(lock, *flags, NULL); int err = lock->l_completion_ast(lock, *flags, NULL);
if (!rc) if (!rc)
rc = err; rc = err;
if (rc) if (rc)
...@@ -718,6 +721,7 @@ static inline int ldlm_capsule_handles_avail(struct req_capsule *pill, ...@@ -718,6 +721,7 @@ static inline int ldlm_capsule_handles_avail(struct req_capsule *pill,
int off) int off)
{ {
int size = req_capsule_msg_size(pill, loc); int size = req_capsule_msg_size(pill, loc);
return ldlm_req_handles_avail(size, off); return ldlm_req_handles_avail(size, off);
} }
...@@ -726,6 +730,7 @@ static inline int ldlm_format_handles_avail(struct obd_import *imp, ...@@ -726,6 +730,7 @@ static inline int ldlm_format_handles_avail(struct obd_import *imp,
enum req_location loc, int off) enum req_location loc, int off)
{ {
int size = req_capsule_fmt_size(imp->imp_msg_magic, fmt, loc); int size = req_capsule_fmt_size(imp->imp_msg_magic, fmt, loc);
return ldlm_req_handles_avail(size, off); return ldlm_req_handles_avail(size, off);
} }
...@@ -1407,6 +1412,7 @@ static ldlm_policy_res_t ldlm_cancel_no_wait_policy(struct ldlm_namespace *ns, ...@@ -1407,6 +1412,7 @@ static ldlm_policy_res_t ldlm_cancel_no_wait_policy(struct ldlm_namespace *ns,
{ {
ldlm_policy_res_t result = LDLM_POLICY_CANCEL_LOCK; ldlm_policy_res_t result = LDLM_POLICY_CANCEL_LOCK;
ldlm_cancel_for_recovery cb = ns->ns_cancel_for_recovery; ldlm_cancel_for_recovery cb = ns->ns_cancel_for_recovery;
lock_res_and_lock(lock); lock_res_and_lock(lock);
/* don't check added & count since we want to process all locks /* don't check added & count since we want to process all locks
...@@ -1721,6 +1727,7 @@ int ldlm_cancel_lru_local(struct ldlm_namespace *ns, struct list_head *cancels, ...@@ -1721,6 +1727,7 @@ int ldlm_cancel_lru_local(struct ldlm_namespace *ns, struct list_head *cancels,
int flags) int flags)
{ {
int added; int added;
added = ldlm_prepare_lru_list(ns, cancels, count, max, flags); added = ldlm_prepare_lru_list(ns, cancels, count, max, flags);
if (added <= 0) if (added <= 0)
return added; return added;
...@@ -2005,6 +2012,7 @@ struct iter_helper_data { ...@@ -2005,6 +2012,7 @@ struct iter_helper_data {
static int ldlm_iter_helper(struct ldlm_lock *lock, void *closure) static int ldlm_iter_helper(struct ldlm_lock *lock, void *closure)
{ {
struct iter_helper_data *helper = closure; struct iter_helper_data *helper = closure;
return helper->iter(lock, helper->closure); return helper->iter(lock, helper->closure);
} }
......
...@@ -804,6 +804,7 @@ static int __ldlm_namespace_free(struct ldlm_namespace *ns, int force) ...@@ -804,6 +804,7 @@ static int __ldlm_namespace_free(struct ldlm_namespace *ns, int force)
if (atomic_read(&ns->ns_bref) > 0) { if (atomic_read(&ns->ns_bref) > 0) {
struct l_wait_info lwi = LWI_INTR(LWI_ON_SIGNAL_NOOP, NULL); struct l_wait_info lwi = LWI_INTR(LWI_ON_SIGNAL_NOOP, NULL);
int rc; int rc;
CDEBUG(D_DLMTRACE, CDEBUG(D_DLMTRACE,
"dlm namespace %s free waiting on refcount %d\n", "dlm namespace %s free waiting on refcount %d\n",
ldlm_ns_name(ns), atomic_read(&ns->ns_bref)); ldlm_ns_name(ns), atomic_read(&ns->ns_bref));
...@@ -1332,6 +1333,7 @@ void ldlm_dump_all_namespaces(ldlm_side_t client, int level) ...@@ -1332,6 +1333,7 @@ void ldlm_dump_all_namespaces(ldlm_side_t client, int level)
list_for_each(tmp, ldlm_namespace_list(client)) { list_for_each(tmp, ldlm_namespace_list(client)) {
struct ldlm_namespace *ns; struct ldlm_namespace *ns;
ns = list_entry(tmp, struct ldlm_namespace, ns_list_chain); ns = list_entry(tmp, struct ldlm_namespace, ns_list_chain);
ldlm_namespace_dump(level, ns); ldlm_namespace_dump(level, ns);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment