mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 10:11:52 -04:00
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: frank zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/11295
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d3ae87be4c
commit
a161de8608
@@ -750,8 +750,7 @@ kiblnd_setup_rd_kiov(lnet_ni_t *ni, kib_tx_t *tx, kib_rdma_desc_t *rd,
|
||||
|
||||
static int
|
||||
kiblnd_post_tx_locked(kib_conn_t *conn, kib_tx_t *tx, int credit)
|
||||
__releases(conn->ibc_lock)
|
||||
__acquires(conn->ibc_lock)
|
||||
__must_hold(&conn->ibc_lock)
|
||||
{
|
||||
kib_msg_t *msg = tx->tx_msg;
|
||||
kib_peer_t *peer = conn->ibc_peer;
|
||||
|
||||
@@ -2336,6 +2336,7 @@ ksocknal_flush_stale_txs(ksock_peer_t *peer)
|
||||
|
||||
static int
|
||||
ksocknal_send_keepalive_locked(ksock_peer_t *peer)
|
||||
__must_hold(&ksocknal_data.ksnd_global_lock)
|
||||
{
|
||||
ksock_sched_t *sched;
|
||||
ksock_conn_t *conn;
|
||||
|
||||
@@ -90,6 +90,7 @@ EXPORT_SYMBOL(cfs_percpt_lock_alloc);
|
||||
*/
|
||||
void
|
||||
cfs_percpt_lock(struct cfs_percpt_lock *pcl, int index)
|
||||
__acquires(pcl->pcl_locks)
|
||||
{
|
||||
int ncpt = cfs_cpt_number(pcl->pcl_cptab);
|
||||
int i;
|
||||
@@ -124,6 +125,7 @@ EXPORT_SYMBOL(cfs_percpt_lock);
|
||||
/** unlock a CPU partition */
|
||||
void
|
||||
cfs_percpt_unlock(struct cfs_percpt_lock *pcl, int index)
|
||||
__releases(pcl->pcl_locks)
|
||||
{
|
||||
int ncpt = cfs_cpt_number(pcl->pcl_cptab);
|
||||
int i;
|
||||
|
||||
@@ -1938,6 +1938,7 @@ static int get_write_extents(struct osc_object *obj, struct list_head *rpclist)
|
||||
static int
|
||||
osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli,
|
||||
struct osc_object *osc)
|
||||
__must_hold(osc)
|
||||
{
|
||||
LIST_HEAD(rpclist);
|
||||
struct osc_extent *ext;
|
||||
@@ -2010,6 +2011,7 @@ osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli,
|
||||
static int
|
||||
osc_send_read_rpc(const struct lu_env *env, struct client_obd *cli,
|
||||
struct osc_object *osc)
|
||||
__must_hold(osc)
|
||||
{
|
||||
struct osc_extent *ext;
|
||||
struct osc_extent *next;
|
||||
@@ -2083,6 +2085,7 @@ static struct osc_object *osc_next_obj(struct client_obd *cli)
|
||||
|
||||
/* called with the loi list lock held */
|
||||
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;
|
||||
int rc = 0;
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req)
|
||||
__must_hold(&req->rq_lock)
|
||||
{
|
||||
struct ptlrpc_request *early_req;
|
||||
time64_t olddl;
|
||||
|
||||
Reference in New Issue
Block a user