summaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/idset.c
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2012-10-15 12:24:56 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-10-18 17:50:08 +0200
commitcec8546638dc634824b629e33968d6c68f8b07d6 (patch)
treeeb97150bedd22afb3ee503e6b6bf159a65fc8ee8 /drivers/s390/cio/idset.c
parents390/cio: use generic bitmap functions (diff)
downloadlinux-cec8546638dc634824b629e33968d6c68f8b07d6.tar.xz
linux-cec8546638dc634824b629e33968d6c68f8b07d6.zip
s390/css: stop stsch loop after cc 3
Receiving cc=3 from store subchannel means 2 things: * the subchannel is not provided * there are no further subchannels in this subchannel set With this patch we abort the store subchannel loop after cc=3 (or an exception) and clear the subsequent bits in the subchannel id set. Reported-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/idset.c')
-rw-r--r--drivers/s390/cio/idset.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/s390/cio/idset.c b/drivers/s390/cio/idset.c
index f0973a04ec49..199bc6791177 100644
--- a/drivers/s390/cio/idset.c
+++ b/drivers/s390/cio/idset.c
@@ -90,6 +90,14 @@ void idset_sch_del(struct idset *set, struct subchannel_id schid)
idset_del(set, schid.ssid, schid.sch_no);
}
+/* Clear ids starting from @schid up to end of subchannel set. */
+void idset_sch_del_subseq(struct idset *set, struct subchannel_id schid)
+{
+ int pos = schid.ssid * set->num_id + schid.sch_no;
+
+ bitmap_clear(set->bitmap, pos, set->num_id - schid.sch_no);
+}
+
int idset_sch_contains(struct idset *set, struct subchannel_id schid)
{
return idset_contains(set, schid.ssid, schid.sch_no);