aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2005-09-10 03:27:28 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 13:06:38 -0400
commit86e8486245a01f05a3267b2e8b5c02c2303b670d (patch)
tree4d9f90d8d3f34461f6dddacae708eb31753c7bb6
parent310b587e011ce02328c8e4c29eccd9f14d9007c5 (diff)
[PATCH] drivers/block: fix-up schedule_timeout() usage
Use schedule_timeout_{un,}interruptible() instead of set_current_state()/schedule_timeout() to reduce kernel size. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Cc: Jens Axboe <axboe@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/block/cciss.c7
-rw-r--r--drivers/block/paride/pcd.c3
-rw-r--r--drivers/block/paride/pf.c3
-rw-r--r--drivers/block/paride/pg.c3
-rw-r--r--drivers/block/paride/pt.c3
-rw-r--r--drivers/block/swim3.c9
-rw-r--r--drivers/block/swim_iop.c3
-rw-r--r--drivers/block/xd.c6
8 files changed, 13 insertions, 24 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 418b1469d75d..28f2c177a541 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1713,10 +1713,9 @@ static unsigned long pollcomplete(int ctlr)
1713 1713
1714 for (i = 20 * HZ; i > 0; i--) { 1714 for (i = 20 * HZ; i > 0; i--) {
1715 done = hba[ctlr]->access.command_completed(hba[ctlr]); 1715 done = hba[ctlr]->access.command_completed(hba[ctlr]);
1716 if (done == FIFO_EMPTY) { 1716 if (done == FIFO_EMPTY)
1717 set_current_state(TASK_UNINTERRUPTIBLE); 1717 schedule_timeout_uninterruptible(1);
1718 schedule_timeout(1); 1718 else
1719 } else
1720 return (done); 1719 return (done);
1721 } 1720 }
1722 /* Invalid address to tell caller we ran out of time */ 1721 /* Invalid address to tell caller we ran out of time */
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index 7289f67e9568..ac5ba462710b 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -516,8 +516,7 @@ static int pcd_tray_move(struct cdrom_device_info *cdi, int position)
516 516
517static void pcd_sleep(int cs) 517static void pcd_sleep(int cs)
518{ 518{
519 current->state = TASK_INTERRUPTIBLE; 519 schedule_timeout_interruptible(cs);
520 schedule_timeout(cs);
521} 520}
522 521
523static int pcd_reset(struct pcd_unit *cd) 522static int pcd_reset(struct pcd_unit *cd)
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index 060b1f2a91dd..711d2f314ac3 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -507,8 +507,7 @@ static void pf_eject(struct pf_unit *pf)
507 507
508static void pf_sleep(int cs) 508static void pf_sleep(int cs)
509{ 509{
510 current->state = TASK_INTERRUPTIBLE; 510 schedule_timeout_interruptible(cs);
511 schedule_timeout(cs);
512} 511}
513 512
514/* the ATAPI standard actually specifies the contents of all 7 registers 513/* the ATAPI standard actually specifies the contents of all 7 registers
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c
index 84d8e291ed96..b3982395f22b 100644
--- a/drivers/block/paride/pg.c
+++ b/drivers/block/paride/pg.c
@@ -276,8 +276,7 @@ static inline u8 DRIVE(struct pg *dev)
276 276
277static void pg_sleep(int cs) 277static void pg_sleep(int cs)
278{ 278{
279 current->state = TASK_INTERRUPTIBLE; 279 schedule_timeout_interruptible(cs);
280 schedule_timeout(cs);
281} 280}
282 281
283static int pg_wait(struct pg *dev, int go, int stop, unsigned long tmo, char *msg) 282static int pg_wait(struct pg *dev, int go, int stop, unsigned long tmo, char *msg)
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index 5fe8ee86f095..d8d35233cf49 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -383,8 +383,7 @@ static int pt_atapi(struct pt_unit *tape, char *cmd, int dlen, char *buf, char *
383 383
384static void pt_sleep(int cs) 384static void pt_sleep(int cs)
385{ 385{
386 current->state = TASK_INTERRUPTIBLE; 386 schedule_timeout_interruptible(cs);
387 schedule_timeout(cs);
388} 387}
389 388
390static int pt_poll_dsc(struct pt_unit *tape, int pause, int tmo, char *msg) 389static int pt_poll_dsc(struct pt_unit *tape, int pause, int tmo, char *msg)
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index e5f7494c00ee..e425ad3eebba 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -834,8 +834,7 @@ static int fd_eject(struct floppy_state *fs)
834 break; 834 break;
835 } 835 }
836 swim3_select(fs, RELAX); 836 swim3_select(fs, RELAX);
837 current->state = TASK_INTERRUPTIBLE; 837 schedule_timeout_interruptible(1);
838 schedule_timeout(1);
839 if (swim3_readbit(fs, DISK_IN) == 0) 838 if (swim3_readbit(fs, DISK_IN) == 0)
840 break; 839 break;
841 } 840 }
@@ -906,8 +905,7 @@ static int floppy_open(struct inode *inode, struct file *filp)
906 break; 905 break;
907 } 906 }
908 swim3_select(fs, RELAX); 907 swim3_select(fs, RELAX);
909 current->state = TASK_INTERRUPTIBLE; 908 schedule_timeout_interruptible(1);
910 schedule_timeout(1);
911 } 909 }
912 if (err == 0 && (swim3_readbit(fs, SEEK_COMPLETE) == 0 910 if (err == 0 && (swim3_readbit(fs, SEEK_COMPLETE) == 0
913 || swim3_readbit(fs, DISK_IN) == 0)) 911 || swim3_readbit(fs, DISK_IN) == 0))
@@ -992,8 +990,7 @@ static int floppy_revalidate(struct gendisk *disk)
992 if (signal_pending(current)) 990 if (signal_pending(current))
993 break; 991 break;
994 swim3_select(fs, RELAX); 992 swim3_select(fs, RELAX);
995 current->state = TASK_INTERRUPTIBLE; 993 schedule_timeout_interruptible(1);
996 schedule_timeout(1);
997 } 994 }
998 ret = swim3_readbit(fs, SEEK_COMPLETE) == 0 995 ret = swim3_readbit(fs, SEEK_COMPLETE) == 0
999 || swim3_readbit(fs, DISK_IN) == 0; 996 || swim3_readbit(fs, DISK_IN) == 0;
diff --git a/drivers/block/swim_iop.c b/drivers/block/swim_iop.c
index a1283f6dc018..89e3c2f8b776 100644
--- a/drivers/block/swim_iop.c
+++ b/drivers/block/swim_iop.c
@@ -338,8 +338,7 @@ static int swimiop_eject(struct floppy_state *fs)
338 err = -EINTR; 338 err = -EINTR;
339 break; 339 break;
340 } 340 }
341 current->state = TASK_INTERRUPTIBLE; 341 schedule_timeout_interruptible(1);
342 schedule_timeout(1);
343 } 342 }
344 release_drive(fs); 343 release_drive(fs);
345 return cmd->error; 344 return cmd->error;
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index 2c6d3423496b..68b6d7b154cf 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -530,10 +530,8 @@ static inline u_char xd_waitport (u_short port,u_char flags,u_char mask,u_long t
530 int success; 530 int success;
531 531
532 xdc_busy = 1; 532 xdc_busy = 1;
533 while ((success = ((inb(port) & mask) != flags)) && time_before(jiffies, expiry)) { 533 while ((success = ((inb(port) & mask) != flags)) && time_before(jiffies, expiry))
534 set_current_state(TASK_UNINTERRUPTIBLE); 534 schedule_timeout_uninterruptible(1);
535 schedule_timeout(1);
536 }
537 xdc_busy = 0; 535 xdc_busy = 0;
538 return (success); 536 return (success);
539} 537}