diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-01-02 15:12:50 (GMT) |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-01-02 15:12:50 (GMT) |
commit | 631de3708d595d153e8a510a3608689290f4c0ed (patch) | |
tree | dbecf12cccac76e89cf1908f80b4f515cada731e /include/linux/ide.h | |
parent | b2cfb05a701809abee591265a198afa029d68bff (diff) | |
download | linux-fsl-qoriq-631de3708d595d153e8a510a3608689290f4c0ed.tar.xz |
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.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 968ca8f..f408d61 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); extern void ide_timer_expiry(unsigned long); extern irqreturn_t ide_intr(int irq, void *dev_id); + +static inline int ide_lock_hwgroup(ide_hwgroup_t *hwgroup) +{ + if (hwgroup->busy) + return 1; + + hwgroup->busy = 1; + /* for atari only */ + ide_get_lock(ide_intr, hwgroup); + + return 0; +} + +static inline void ide_unlock_hwgroup(ide_hwgroup_t *hwgroup) +{ + /* for atari only */ + ide_release_lock(); + hwgroup->busy = 0; +} + extern void do_ide_request(struct request_queue *); void ide_init_disk(struct gendisk *, ide_drive_t *); |