Commit a161de86 authored by frank zago's avatar frank zago Committed by Greg Kroah-Hartman

staging: lustre: add sparse locking annotations

Adds __acquires / __releases / __must_hold sparse locking annotations to
several functions.

Fixes sparse warnings such as:

libcfs/libcfs/hash.c:127:1: warning: context imbalance in 'cfs_hash_spin_lock'
        - wrong count at exit
libcfs/libcfs/hash.c:133:1: warning: context imbalance in 'cfs_hash_spin_unlock'
        - unexpected unlock
libcfs/libcfs/hash.c:141:9: warning: context imbalance in 'cfs_hash_rw_lock'
        - wrong count at exit
include/linux/rwlock_api_smp.h:221:9: warning: context imbalance in
        'cfs_hash_rw_unlock' - unexpected unlock
Signed-off-by: default avatarfrank zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/11295Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarPatrick Farrell <paf@cray.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d3ae87be
...@@ -750,8 +750,7 @@ kiblnd_setup_rd_kiov(lnet_ni_t *ni, kib_tx_t *tx, kib_rdma_desc_t *rd, ...@@ -750,8 +750,7 @@ kiblnd_setup_rd_kiov(lnet_ni_t *ni, kib_tx_t *tx, kib_rdma_desc_t *rd,
static int static int
kiblnd_post_tx_locked(kib_conn_t *conn, kib_tx_t *tx, int credit) kiblnd_post_tx_locked(kib_conn_t *conn, kib_tx_t *tx, int credit)
__releases(conn->ibc_lock) __must_hold(&conn->ibc_lock)
__acquires(conn->ibc_lock)
{ {
kib_msg_t *msg = tx->tx_msg; kib_msg_t *msg = tx->tx_msg;
kib_peer_t *peer = conn->ibc_peer; kib_peer_t *peer = conn->ibc_peer;
......
...@@ -2336,6 +2336,7 @@ ksocknal_flush_stale_txs(ksock_peer_t *peer) ...@@ -2336,6 +2336,7 @@ ksocknal_flush_stale_txs(ksock_peer_t *peer)
static int static int
ksocknal_send_keepalive_locked(ksock_peer_t *peer) ksocknal_send_keepalive_locked(ksock_peer_t *peer)
__must_hold(&ksocknal_data.ksnd_global_lock)
{ {
ksock_sched_t *sched; ksock_sched_t *sched;
ksock_conn_t *conn; ksock_conn_t *conn;
......
...@@ -90,6 +90,7 @@ EXPORT_SYMBOL(cfs_percpt_lock_alloc); ...@@ -90,6 +90,7 @@ EXPORT_SYMBOL(cfs_percpt_lock_alloc);
*/ */
void void
cfs_percpt_lock(struct cfs_percpt_lock *pcl, int index) cfs_percpt_lock(struct cfs_percpt_lock *pcl, int index)
__acquires(pcl->pcl_locks)
{ {
int ncpt = cfs_cpt_number(pcl->pcl_cptab); int ncpt = cfs_cpt_number(pcl->pcl_cptab);
int i; int i;
...@@ -124,6 +125,7 @@ EXPORT_SYMBOL(cfs_percpt_lock); ...@@ -124,6 +125,7 @@ EXPORT_SYMBOL(cfs_percpt_lock);
/** unlock a CPU partition */ /** unlock a CPU partition */
void void
cfs_percpt_unlock(struct cfs_percpt_lock *pcl, int index) cfs_percpt_unlock(struct cfs_percpt_lock *pcl, int index)
__releases(pcl->pcl_locks)
{ {
int ncpt = cfs_cpt_number(pcl->pcl_cptab); int ncpt = cfs_cpt_number(pcl->pcl_cptab);
int i; int i;
......
...@@ -1938,6 +1938,7 @@ static int get_write_extents(struct osc_object *obj, struct list_head *rpclist) ...@@ -1938,6 +1938,7 @@ static int get_write_extents(struct osc_object *obj, struct list_head *rpclist)
static int static int
osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli, osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli,
struct osc_object *osc) struct osc_object *osc)
__must_hold(osc)
{ {
LIST_HEAD(rpclist); LIST_HEAD(rpclist);
struct osc_extent *ext; struct osc_extent *ext;
...@@ -2010,6 +2011,7 @@ osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli, ...@@ -2010,6 +2011,7 @@ osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli,
static int static int
osc_send_read_rpc(const struct lu_env *env, struct client_obd *cli, osc_send_read_rpc(const struct lu_env *env, struct client_obd *cli,
struct osc_object *osc) struct osc_object *osc)
__must_hold(osc)
{ {
struct osc_extent *ext; struct osc_extent *ext;
struct osc_extent *next; struct osc_extent *next;
...@@ -2083,6 +2085,7 @@ static struct osc_object *osc_next_obj(struct client_obd *cli) ...@@ -2083,6 +2085,7 @@ static struct osc_object *osc_next_obj(struct client_obd *cli)
/* called with the loi list lock held */ /* called with the loi list lock held */
static void osc_check_rpcs(const struct lu_env *env, struct client_obd *cli) static void osc_check_rpcs(const struct lu_env *env, struct client_obd *cli)
__must_hold(&cli->cl_loi_list_lock)
{ {
struct osc_object *osc; struct osc_object *osc;
int rc = 0; int rc = 0;
......
...@@ -353,6 +353,7 @@ static int unpack_reply(struct ptlrpc_request *req) ...@@ -353,6 +353,7 @@ static int unpack_reply(struct ptlrpc_request *req)
* If anything goes wrong just ignore it - same as if it never happened * If anything goes wrong just ignore it - same as if it never happened
*/ */
static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req) static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req)
__must_hold(&req->rq_lock)
{ {
struct ptlrpc_request *early_req; struct ptlrpc_request *early_req;
time64_t olddl; time64_t olddl;
......
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