Displaying 20 results from an estimated 38 matches for "smp_mb__after_atomic_inc".
2013 Jan 31
4
[RFC][PATCH 2/2] Btrfs: implement unlocked dio write
...p;
struct inode *inode = file->f_mapping->host;
int flags = 0;
- bool wakeup = false;
+ bool wakeup = true;
int ret;
if (check_direct_IO(BTRFS_I(inode)->root, rw, iocb, iov,
offset, nr_segs))
return 0;
- if (rw == READ) {
- atomic_inc(&inode->i_dio_count);
- smp_mb__after_atomic_inc();
- if (unlikely(test_bit(BTRFS_INODE_READDIO_NEED_LOCK,
- &BTRFS_I(inode)->runtime_flags))) {
- inode_dio_done(inode);
- flags = DIO_LOCKING | DIO_SKIP_HOLES;
- } else {
- wakeup = true;
- }
+ atomic_inc(&inode->i_dio_count);
+ smp_mb__after_atomic_inc();
+ if (rw...
2019 Apr 16
2
[PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic()
...regular ints protected by a
mutex.
The commit that made these changes left an unused smp_mb__after_atomic()
in vhost_scsi_set_endpoint(). It was previously used after incrementing
vhost_scsi->vhost_ref_cnt but this field has been dropped:
- atomic_inc(&vs->vhost_ref_cnt);
smp_mb__after_atomic_inc();
Reported-by: Andrea Parri <andrea.parri at amarulasolutions.com>
Fixes: 101998f6fcd680 ("tcm_vhost: Post-merge review changes requested by MST")
Signed-off-by: Stefan Hajnoczi <stefanha at redhat.com>
---
drivers/vhost/scsi.c | 1 -
1 file changed, 1 deletion(-)
diff --g...
2019 Apr 16
2
[PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic()
...regular ints protected by a
mutex.
The commit that made these changes left an unused smp_mb__after_atomic()
in vhost_scsi_set_endpoint(). It was previously used after incrementing
vhost_scsi->vhost_ref_cnt but this field has been dropped:
- atomic_inc(&vs->vhost_ref_cnt);
smp_mb__after_atomic_inc();
Reported-by: Andrea Parri <andrea.parri at amarulasolutions.com>
Fixes: 101998f6fcd680 ("tcm_vhost: Post-merge review changes requested by MST")
Signed-off-by: Stefan Hajnoczi <stefanha at redhat.com>
---
drivers/vhost/scsi.c | 1 -
1 file changed, 1 deletion(-)
diff --g...
2012 Jul 30
0
[PATCH] tcm_vhost: Post-merge review changes requested by MST
...tex_unlock(&tv_tpg->tv_tpg_mutex);
continue;
}
@@ -847,14 +839,20 @@ static int vhost_scsi_set_endpoint(
if (!strcmp(tv_tport->tport_name, t->vhost_wwpn) &&
(tv_tpg->tport_tpgt == t->vhost_tpgt)) {
- atomic_inc(&tv_tpg->tv_tpg_vhost_count);
- smp_mb__after_atomic_inc();
+ tv_tpg->tv_tpg_vhost_count++;
mutex_unlock(&tv_tpg->tv_tpg_mutex);
mutex_unlock(&tcm_vhost_mutex);
mutex_lock(&vs->dev.mutex);
+ if (vs->vs_tpg) {
+ mutex_unlock(&vs->dev.mutex);
+ mutex_lock(&tv_tpg->tv_tpg_mutex);
+ tv_tpg->...
2012 Jul 30
0
[PATCH] tcm_vhost: Post-merge review changes requested by MST
...tex_unlock(&tv_tpg->tv_tpg_mutex);
continue;
}
@@ -847,14 +839,20 @@ static int vhost_scsi_set_endpoint(
if (!strcmp(tv_tport->tport_name, t->vhost_wwpn) &&
(tv_tpg->tport_tpgt == t->vhost_tpgt)) {
- atomic_inc(&tv_tpg->tv_tpg_vhost_count);
- smp_mb__after_atomic_inc();
+ tv_tpg->tv_tpg_vhost_count++;
mutex_unlock(&tv_tpg->tv_tpg_mutex);
mutex_unlock(&tcm_vhost_mutex);
mutex_lock(&vs->dev.mutex);
+ if (vs->vs_tpg) {
+ mutex_unlock(&vs->dev.mutex);
+ mutex_lock(&tv_tpg->tv_tpg_mutex);
+ tv_tpg->...
2019 Apr 17
0
[PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic()
...>
> The commit that made these changes left an unused smp_mb__after_atomic()
> in vhost_scsi_set_endpoint(). It was previously used after incrementing
> vhost_scsi->vhost_ref_cnt but this field has been dropped:
>
> - atomic_inc(&vs->vhost_ref_cnt);
> smp_mb__after_atomic_inc();
>
> Reported-by: Andrea Parri <andrea.parri at amarulasolutions.com>
> Fixes: 101998f6fcd680 ("tcm_vhost: Post-merge review changes requested by MST")
> Signed-off-by: Stefan Hajnoczi <stefanha at redhat.com>
> ---
> drivers/vhost/scsi.c | 1 -
> 1 f...
2013 Feb 01
1
[PATCH v2] tcm_vhost: Multi-target support
...{
mutex_unlock(&vs->dev.mutex);
mutex_lock(&tv_tpg->tv_tpg_mutex);
tv_tpg->tv_tpg_vhost_count--;
@@ -786,15 +810,24 @@ static int vhost_scsi_set_endpoint(
return -EEXIST;
}
- vs->vs_tpg = tv_tpg;
+ vs->vs_tpg[tv_tpg->tport_tpgt] = tv_tpg;
smp_mb__after_atomic_inc();
+ match = true;
mutex_unlock(&vs->dev.mutex);
- return 0;
}
mutex_unlock(&tv_tpg->tv_tpg_mutex);
}
mutex_unlock(&tcm_vhost_mutex);
- return -EINVAL;
+
+ mutex_lock(&vs->dev.mutex);
+ if (match) {
+ memcpy(vs->vs_vhost_wwpn, t->vhost_wwpn,
+...
2013 Feb 01
1
[PATCH v2] tcm_vhost: Multi-target support
...{
mutex_unlock(&vs->dev.mutex);
mutex_lock(&tv_tpg->tv_tpg_mutex);
tv_tpg->tv_tpg_vhost_count--;
@@ -786,15 +810,24 @@ static int vhost_scsi_set_endpoint(
return -EEXIST;
}
- vs->vs_tpg = tv_tpg;
+ vs->vs_tpg[tv_tpg->tport_tpgt] = tv_tpg;
smp_mb__after_atomic_inc();
+ match = true;
mutex_unlock(&vs->dev.mutex);
- return 0;
}
mutex_unlock(&tv_tpg->tv_tpg_mutex);
}
mutex_unlock(&tcm_vhost_mutex);
- return -EINVAL;
+
+ mutex_lock(&vs->dev.mutex);
+ if (match) {
+ memcpy(vs->vs_vhost_wwpn, t->vhost_wwpn,
+...
2013 Jan 31
1
[PATCH] tcm_vhost: Multi-target support
...mutex_unlock(&vs->dev.mutex);
mutex_lock(&tv_tpg->tv_tpg_mutex);
tv_tpg->tv_tpg_vhost_count--;
@@ -786,15 +811,17 @@ static int vhost_scsi_set_endpoint(
return -EEXIST;
}
- vs->vs_tpg = tv_tpg;
+ vs->vs_tpg[tv_tpg->tport_tpgt - 1] = tv_tpg;
smp_mb__after_atomic_inc();
+ if (!vs->vs_num_target++)
+ memcpy(vs->vs_vhost_wwpn, t->vhost_wwpn,
+ sizeof(vs->vs_vhost_wwpn));
mutex_unlock(&vs->dev.mutex);
- return 0;
}
mutex_unlock(&tv_tpg->tv_tpg_mutex);
}
mutex_unlock(&tcm_vhost_mutex);
- return -EINVAL;
+...
2013 Jan 31
1
[PATCH] tcm_vhost: Multi-target support
...mutex_unlock(&vs->dev.mutex);
mutex_lock(&tv_tpg->tv_tpg_mutex);
tv_tpg->tv_tpg_vhost_count--;
@@ -786,15 +811,17 @@ static int vhost_scsi_set_endpoint(
return -EEXIST;
}
- vs->vs_tpg = tv_tpg;
+ vs->vs_tpg[tv_tpg->tport_tpgt - 1] = tv_tpg;
smp_mb__after_atomic_inc();
+ if (!vs->vs_num_target++)
+ memcpy(vs->vs_vhost_wwpn, t->vhost_wwpn,
+ sizeof(vs->vs_vhost_wwpn));
mutex_unlock(&vs->dev.mutex);
- return 0;
}
mutex_unlock(&tv_tpg->tv_tpg_mutex);
}
mutex_unlock(&tcm_vhost_mutex);
- return -EINVAL;
+...
2013 Mar 05
3
[PATCH] tcm_vhost: Add hotplug/hotunplug support
...TIO_SCSI_T_NO_EVENT, 0);
+
}
static void vhost_scsi_handle_kick(struct vhost_work *work)
@@ -815,6 +936,7 @@ static int vhost_scsi_set_endpoint(
return -EEXIST;
}
tv_tpg->tv_tpg_vhost_count++;
+ tv_tpg->vhost_scsi = vs;
vs->vs_tpg[tv_tpg->tport_tpgt] = tv_tpg;
smp_mb__after_atomic_inc();
match = true;
@@ -875,6 +997,7 @@ static int vhost_scsi_clear_endpoint(
goto err;
}
tv_tpg->tv_tpg_vhost_count--;
+ tv_tpg->vhost_scsi = NULL;
vs->vs_tpg[target] = NULL;
vs->vs_endpoint = false;
}
@@ -896,6 +1019,7 @@ static int vhost_scsi_open(struct inode *in...
2013 Mar 05
3
[PATCH] tcm_vhost: Add hotplug/hotunplug support
...TIO_SCSI_T_NO_EVENT, 0);
+
}
static void vhost_scsi_handle_kick(struct vhost_work *work)
@@ -815,6 +936,7 @@ static int vhost_scsi_set_endpoint(
return -EEXIST;
}
tv_tpg->tv_tpg_vhost_count++;
+ tv_tpg->vhost_scsi = vs;
vs->vs_tpg[tv_tpg->tport_tpgt] = tv_tpg;
smp_mb__after_atomic_inc();
match = true;
@@ -875,6 +997,7 @@ static int vhost_scsi_clear_endpoint(
goto err;
}
tv_tpg->tv_tpg_vhost_count--;
+ tv_tpg->vhost_scsi = NULL;
vs->vs_tpg[target] = NULL;
vs->vs_endpoint = false;
}
@@ -896,6 +1019,7 @@ static int vhost_scsi_open(struct inode *in...
2013 Feb 05
0
[PATCH v3] tcm_vhost: Multi-target support
...>tport_tpgt]) {
mutex_unlock(&tv_tpg->tv_tpg_mutex);
+ mutex_unlock(&tcm_vhost_mutex);
+ mutex_unlock(&vs->dev.mutex);
return -EEXIST;
}
-
- vs->vs_tpg = tv_tpg;
+ tv_tpg->tv_tpg_vhost_count++;
+ vs->vs_tpg[tv_tpg->tport_tpgt] = tv_tpg;
smp_mb__after_atomic_inc();
- mutex_unlock(&vs->dev.mutex);
- return 0;
+ match = true;
}
mutex_unlock(&tv_tpg->tv_tpg_mutex);
}
mutex_unlock(&tcm_vhost_mutex);
- return -EINVAL;
+
+ if (match) {
+ memcpy(vs->vs_vhost_wwpn, t->vhost_wwpn,
+ sizeof(vs->vs_vhost_wwpn));
+...
2013 Feb 05
0
[PATCH v3] tcm_vhost: Multi-target support
...>tport_tpgt]) {
mutex_unlock(&tv_tpg->tv_tpg_mutex);
+ mutex_unlock(&tcm_vhost_mutex);
+ mutex_unlock(&vs->dev.mutex);
return -EEXIST;
}
-
- vs->vs_tpg = tv_tpg;
+ tv_tpg->tv_tpg_vhost_count++;
+ vs->vs_tpg[tv_tpg->tport_tpgt] = tv_tpg;
smp_mb__after_atomic_inc();
- mutex_unlock(&vs->dev.mutex);
- return 0;
+ match = true;
}
mutex_unlock(&tv_tpg->tv_tpg_mutex);
}
mutex_unlock(&tcm_vhost_mutex);
- return -EINVAL;
+
+ if (match) {
+ memcpy(vs->vs_vhost_wwpn, t->vhost_wwpn,
+ sizeof(vs->vs_vhost_wwpn));
+...
2013 Apr 25
6
[PATCH v10 0/4] tcm_vhost hotplug
Asias He (4):
tcm_vhost: Refactor the lock nesting rule
tcm_vhost: Add hotplug/hotunplug support
tcm_vhost: Add ioctl to get and set events missed flag
tcm_vhost: Enable VIRTIO_SCSI_F_HOTPLUG
drivers/vhost/tcm_vhost.c | 262 +++++++++++++++++++++++++++++++++++++++++++---
drivers/vhost/tcm_vhost.h | 13 +++
2 files changed, 259 insertions(+), 16 deletions(-)
--
1.8.1.4
2013 Apr 25
6
[PATCH v10 0/4] tcm_vhost hotplug
Asias He (4):
tcm_vhost: Refactor the lock nesting rule
tcm_vhost: Add hotplug/hotunplug support
tcm_vhost: Add ioctl to get and set events missed flag
tcm_vhost: Enable VIRTIO_SCSI_F_HOTPLUG
drivers/vhost/tcm_vhost.c | 262 +++++++++++++++++++++++++++++++++++++++++++---
drivers/vhost/tcm_vhost.h | 13 +++
2 files changed, 259 insertions(+), 16 deletions(-)
--
1.8.1.4
2012 Jul 26
2
[RFC-v5] tcm_vhost: Initial merge for vhost level target fabric driver
...tpg_vhost_count)) {
+ mutex_unlock(&tv_tpg->tv_tpg_mutex);
+ continue;
+ }
+ tv_tport = tv_tpg->tport;
+
+ if (!strcmp(tv_tport->tport_name, t->vhost_wwpn) &&
+ (tv_tpg->tport_tpgt == t->vhost_tpgt)) {
+ atomic_inc(&tv_tpg->tv_tpg_vhost_count);
+ smp_mb__after_atomic_inc();
+ mutex_unlock(&tv_tpg->tv_tpg_mutex);
+ mutex_unlock(&tcm_vhost_mutex);
+
+ mutex_lock(&vs->dev.mutex);
+ vs->vs_tpg = tv_tpg;
+ atomic_inc(&vs->vhost_ref_cnt);
+ smp_mb__after_atomic_inc();
+ mutex_unlock(&vs->dev.mutex);
+ return 0;
+ }
+ m...
2012 Jul 26
2
[RFC-v5] tcm_vhost: Initial merge for vhost level target fabric driver
...tpg_vhost_count)) {
+ mutex_unlock(&tv_tpg->tv_tpg_mutex);
+ continue;
+ }
+ tv_tport = tv_tpg->tport;
+
+ if (!strcmp(tv_tport->tport_name, t->vhost_wwpn) &&
+ (tv_tpg->tport_tpgt == t->vhost_tpgt)) {
+ atomic_inc(&tv_tpg->tv_tpg_vhost_count);
+ smp_mb__after_atomic_inc();
+ mutex_unlock(&tv_tpg->tv_tpg_mutex);
+ mutex_unlock(&tcm_vhost_mutex);
+
+ mutex_lock(&vs->dev.mutex);
+ vs->vs_tpg = tv_tpg;
+ atomic_inc(&vs->vhost_ref_cnt);
+ smp_mb__after_atomic_inc();
+ mutex_unlock(&vs->dev.mutex);
+ return 0;
+ }
+ m...
2013 Apr 25
9
[PATCH v11 0/4] tcm_vhost hotplug
Changes in v11
- Drop change log histroy in commit log
Changes in v10
- Drop comments about lun
- Add Enable VIRTIO_SCSI_F_HOTPLUG to this series
Changes in v9
- Drop tcm_vhost_check_feature
- Add Refactor the lock nesting rule to this sereis
Asias He (4):
tcm_vhost: Refactor the lock nesting rule
tcm_vhost: Add hotplug/hotunplug support
tcm_vhost: Add ioctl to get and set events missed
2013 Apr 25
9
[PATCH v11 0/4] tcm_vhost hotplug
Changes in v11
- Drop change log histroy in commit log
Changes in v10
- Drop comments about lun
- Add Enable VIRTIO_SCSI_F_HOTPLUG to this series
Changes in v9
- Drop tcm_vhost_check_feature
- Add Refactor the lock nesting rule to this sereis
Asias He (4):
tcm_vhost: Refactor the lock nesting rule
tcm_vhost: Add hotplug/hotunplug support
tcm_vhost: Add ioctl to get and set events missed