rnbd-srv.c (fc0586062816559defb14c947319ef8c4c326fb3) rnbd-srv.c (1e31016b6926c996e9113619c2ce1f42ad74ddd1)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * RDMA Network Block Driver
4 *
5 * Copyright (c) 2014 - 2018 ProfitBricks GmbH. All rights reserved.
6 * Copyright (c) 2018 - 2019 1&1 IONOS Cloud GmbH. All rights reserved.
7 * Copyright (c) 2019 - 2020 1&1 IONOS SE. All rights reserved.
8 */

--- 90 unchanged lines hidden (view full) ---

99static struct rnbd_srv_sess_dev *
100rnbd_get_sess_dev(int dev_id, struct rnbd_srv_session *srv_sess)
101{
102 struct rnbd_srv_sess_dev *sess_dev;
103 int ret = 0;
104
105 rcu_read_lock();
106 sess_dev = xa_load(&srv_sess->index_idr, dev_id);
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * RDMA Network Block Driver
4 *
5 * Copyright (c) 2014 - 2018 ProfitBricks GmbH. All rights reserved.
6 * Copyright (c) 2018 - 2019 1&1 IONOS Cloud GmbH. All rights reserved.
7 * Copyright (c) 2019 - 2020 1&1 IONOS SE. All rights reserved.
8 */

--- 90 unchanged lines hidden (view full) ---

99static struct rnbd_srv_sess_dev *
100rnbd_get_sess_dev(int dev_id, struct rnbd_srv_session *srv_sess)
101{
102 struct rnbd_srv_sess_dev *sess_dev;
103 int ret = 0;
104
105 rcu_read_lock();
106 sess_dev = xa_load(&srv_sess->index_idr, dev_id);
107 if (likely(sess_dev))
107 if (sess_dev)
108 ret = kref_get_unless_zero(&sess_dev->kref);
109 rcu_read_unlock();
110
111 if (!sess_dev || !ret)
112 return ERR_PTR(-ENXIO);
113
114 return sess_dev;
115}

--- 756 unchanged lines hidden ---
108 ret = kref_get_unless_zero(&sess_dev->kref);
109 rcu_read_unlock();
110
111 if (!sess_dev || !ret)
112 return ERR_PTR(-ENXIO);
113
114 return sess_dev;
115}

--- 756 unchanged lines hidden ---