Prior to allocating a new pipeline stage, the code checked for the existence of
a cached pipeline stage to use. Do away with and stick to normal pipeline
stages only.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
drivers/ide/ide-tape.c | 28 ++++------------------------
1 files changed, 4 insertions(+), 24 deletions(-)
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 792c76e..32ba6c8 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -365,8 +365,6 @@ typedef struct ide_tape_obj {
idetape_stage_t *next_stage;
/* New requests will be added to the pipeline here */
idetape_stage_t *last_stage;
- /* Optional free stage which we can use */
- idetape_stage_t *cache_stage;
int pages_per_stage;
/* Wasted space in each stage */
int excess_bh_size;
@@ -1684,21 +1682,6 @@ abort:
return NULL;
}
-static idetape_stage_t *idetape_kmalloc_stage(idetape_tape_t *tape)
-{
- idetape_stage_t *cache_stage = tape->cache_stage;
-
- debug_log(DBG_PROCS, "Enter %s\n", __func__);
-
- if (tape->nr_stages >= tape->max_stages)
- return NULL;
- if (cache_stage != NULL) {
- tape->cache_stage = NULL;
- return cache_stage;
- }
- return __idetape_kmalloc_stage(tape, 0, 0);
-}
-
static int idetape_copy_stage_from_user(idetape_tape_t *tape,
idetape_stage_t *stage, const char __user *buf, int n)
{
@@ -2231,7 +2214,7 @@ static int idetape_add_chrdev_write_request(ide_drive_t *drive, int blocks)
debug_log(DBG_CHRDEV, "Enter %s\n", __func__);
/* Attempt to allocate a new stage. Beware possible race conditions. */
- while ((new_stage = idetape_kmalloc_stage(tape)) == NULL) {
+ while ((new_stage = __idetape_kmalloc_stage(tape, 0, 0)) == NULL) {
spin_lock_irqsave(&tape->lock, flags);
if (test_bit(IDETAPE_FLAG_PIPELINE_ACTIVE, &tape->flags)) {
idetape_wait_for_request(drive, tape->active_data_rq);
@@ -2448,13 +2431,13 @@ static int idetape_init_read(ide_drive_t *drive, int max_stages)
rq.current_nr_sectors = blocks;
if (!test_bit(IDETAPE_FLAG_PIPELINE_ERR, &tape->flags) &&
tape->nr_stages < max_stages) {
- new_stage = idetape_kmalloc_stage(tape);
+ new_stage = __idetape_kmalloc_stage(tape, 0, 0);
while (new_stage != NULL) {
new_stage->rq = rq;
idetape_add_stage_tail(drive, new_stage);
if (tape->nr_stages >= max_stages)
break;
- new_stage = idetape_kmalloc_stage(tape);
+ new_stage = __idetape_kmalloc_stage(tape, 0, 0);
}
}
if (!test_bit(IDETAPE_FLAG_PIPELINE_ACTIVE, &tape->flags)) {
@@ -3245,10 +3228,7 @@ static int idetape_chrdev_release(struct inode *inode, struct file *filp)
else
idetape_wait_for_pipeline(drive);
}
- if (tape->cache_stage != NULL) {
- __idetape_kfree_stage(tape->cache_stage);
- tape->cache_stage = NULL;
- }
+
if (minor < 128 && test_bit(IDETAPE_FLAG_MEDIUM_PRESENT, &tape->flags))
(void) idetape_rewind_tape(drive);
if (tape->chrdev_dir == IDETAPE_DIR_NONE) {
--
1.5.4.1
--
| Linus Torvalds | Linux 2.6.27-rc8 |
| Andi Kleen | [PATCH x86] [2/16] Add a counter for per cpu clocksource watchdog checks and repor... |
| David Miller | Slow DOWN, please!!! |
| Greg KH | Re: [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in |
git: | |
| Jeff King | Re: [PATCH] Color support added to git-add--interactive. |
| Yann Dirson | Re: irc usage.. |
| Peter Stahlir | Git as a filesystem |
| Junio C Hamano | Re: [PATCH 3/3] Teach "git branch" about --new-workdir |
| new_guy | Code signing in OpenBSD |
| Jason Dixon | Wasting our Freedom |
| Nick Guenther | Re: Real men don't attack straw men |
| Daniel Ouellet | identifying sparse files and get ride of them trick available? |
| Wolfgang Walter | Re: Kernel oops with 2.6.26, padlock and ipsec: probably problem with fpu state ch... |
| KOSAKI Motohiro | [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Tomasz Grobelny | [PATCH 0/5] [DCCP]: Queuing policies |
| Arjan van de Ven | Re: [GIT]: Networking |
| high memory | 8 hours ago | Linux kernel |
| semaphore access speed | 11 hours ago | Applications and Utilities |
| the kernel how to power off the machine | 12 hours ago | Linux kernel |
| Easter Eggs in windows XP | 14 hours ago | Windows |
| Shared swap partition | 15 hours ago | Linux general |
| Root password | 16 hours ago | Linux general |
| Where/when DNOTIFY is used? | 17 hours ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 20 hours ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 20 hours ago | Linux kernel |
| USB Driver -- Interrupt Polling -- A Little Help Please | 1 day ago | Linux general |
