aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ide.h
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-01-02 10:12:50 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-01-02 10:12:50 -0500
commit631de3708d595d153e8a510a3608689290f4c0ed (patch)
treedbecf12cccac76e89cf1908f80b4f515cada731e /include/linux/ide.h
parentb2cfb05a701809abee591265a198afa029d68bff (diff)
ide: add ide_[un]lock_hwgroup() helpers
Add ide_[un]lock_hwgroup() inline helpers for obtaining exclusive access to the given hwgroup and update the core code accordingly. [ This change besides making code saner results in more efficient use of ide_{get,release}_lock(). ] Cc: Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Elias Oltmanns <eo@nebensachen.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r--include/linux/ide.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 968ca8f60531..f408d6123f14 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1280,6 +1280,26 @@ extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout);
1280 1280
1281extern void ide_timer_expiry(unsigned long); 1281extern void ide_timer_expiry(unsigned long);
1282extern irqreturn_t ide_intr(int irq, void *dev_id); 1282extern irqreturn_t ide_intr(int irq, void *dev_id);
1283
1284static inline int ide_lock_hwgroup(ide_hwgroup_t *hwgroup)
1285{
1286 if (hwgroup->busy)
1287 return 1;
1288
1289 hwgroup->busy = 1;
1290 /* for atari only */
1291 ide_get_lock(ide_intr, hwgroup);
1292
1293 return 0;
1294}
1295
1296static inline void ide_unlock_hwgroup(ide_hwgroup_t *hwgroup)
1297{
1298 /* for atari only */
1299 ide_release_lock();
1300 hwgroup->busy = 0;
1301}
1302
1283extern void do_ide_request(struct request_queue *); 1303extern void do_ide_request(struct request_queue *);
1284 1304
1285void ide_init_disk(struct gendisk *, ide_drive_t *); 1305void ide_init_disk(struct gendisk *, ide_drive_t *);