FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 05-04-2010, 03:37 AM
Mike Anderson
 
Default blk: Add request atomic flag for abort

Add atomic flag for a request to indicate that it has marked as aborted.
Provide functions to mark and test the aborted flag.

Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com>
Cc: Jens Axobe <jens.axboe@oracle.com>
---
block/blk-timeout.c | 6 ++++++
block/blk.h | 14 ++++++++++++++
include/linux/blkdev.h | 1 +
3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 89fbe0a..ad45b44 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -155,6 +155,12 @@ void blk_abort_request(struct request *req)
}
EXPORT_SYMBOL_GPL(blk_abort_request);

+int blk_request_aborted(struct request *req)
+{
+ return blk_test_rq_aborted(req);
+}
+EXPORT_SYMBOL_GPL(blk_request_aborted);
+
/**
* blk_add_timer - Start timeout timer for a single request
* @req: request that is about to start running.
diff --git a/block/blk.h b/block/blk.h
index 5ee3d7e..165262a 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -30,6 +30,7 @@ void __generic_unplug_device(struct request_queue *);
*/
enum rq_atomic_flags {
REQ_ATOM_COMPLETE = 0,
+ REQ_ATOM_ABORT = 1,
};

/*
@@ -47,6 +48,19 @@ static inline void blk_clear_rq_complete(struct request *rq)
}

/*
+ * Mark and test a request for aborted.
+ */
+static inline int blk_mark_rq_aborted(struct request *rq)
+{
+ return test_and_set_bit(REQ_ATOM_ABORT, &rq->atomic_flags);
+}
+
+static inline int blk_test_rq_aborted(struct request *rq)
+{
+ return test_bit(REQ_ATOM_ABORT, &rq->atomic_flags);
+}
+
+/*
* Internal elevator interface
*/
#define ELV_ON_HASH(rq) (!hlist_unhashed(&(rq)->hash))
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2818e80..7636e58 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -912,6 +912,7 @@ extern void blk_complete_request(struct request *);
extern void __blk_complete_request(struct request *);
extern void blk_abort_request(struct request *);
extern void blk_abort_queue(struct request_queue *);
+extern int blk_request_aborted(struct request *);

/*
* Access functions for manipulating queue properties
--
1.6.6.1

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 05-04-2010, 10:43 AM
Hannes Reinecke
 
Default blk: Add request atomic flag for abort

Mike Anderson wrote:
> Add atomic flag for a request to indicate that it has marked as aborted.
> Provide functions to mark and test the aborted flag.
>
> Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com>
> Cc: Jens Axobe <jens.axboe@oracle.com>
Acked-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 06:48 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org