[PATCH 0/4][Diskdump]Update patches

Takao Indoh
2004-06-16T12:38:38Z

Hi!

I fixed diskdump patches except timer problem.

- Fix some codes which Arjan van de Ven pointed out
- Replace dev_t with block_device

Source code of tool(diskdumptuils) can be downloaded from
http://sourceforge.net/projects/lkdump

Regarding timer problem, please see previous mail I sent.
http://marc.theaimsgroup.com/?l=linux-kernel&m=108722344204595&w=2
In short, Timer problem is as follows.
> What is a problem? Scsi driver uses timer/tasklet to complete I/O.
> But, diskdump disables interrupt, so timer/taslket doesn't work!

There are three ways to solve this problem so far.

(1) Redefine timer/taslket routines. This method was adopted in the
first patch.

+#if defined(CONFIG_DISKDUMP) || defined(CONFIG_DISKDUMP_MODULE)
+#undef add_timer
+#define add_timer diskdump_add_timer
+#undef del_timer_sync
+#define del_timer_sync diskdump_del_timer
+#undef del_timer
+#define del_timer diskdump_del_timer
+#undef mod_timer
+#define mod_timer diskdump_mod_timer
+
+#define tasklet_schedule diskdump_tasklet_schedule
+#endif

(2) Add new code into the timer/taslket routines themselves.

static inline void add_timer(struct timer_list * timer)
{
- __mod_timer(timer, timer->expires);
+ if(crashdump_mode())
+ diskdump_add_timer(timer);
+ else
+ __mod_timer(timer, timer->expires);
}

int del_timer_sync(struct timer_list *timer)
{
tvec_base_t *base;
int i, ret = 0;

+ if(crashdump_mode()) {
+ diskdump_del_timer(timer);
+ return 0;
+ }
+
check_timer(timer);

int mod_timer(struct timer_list *timer, unsigned long expires)
{
BUG_ON(!timer->function);

+ if(crashdump_mode()) {
+ diskdump_mod_timer(timer, expires);
+ return 0;
+ }
+
check_timer(timer);

static inline void tasklet_schedule(struct tasklet_struct *t)
{
+ if(crashdump_mode()) {
+ diskdump_tasklet_schedule(t);
+ return;
+ }
+
if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
__tasklet_schedule(t);
}

(3) Change polling handler of driver not to use timer/tasklet.

The method (1) was already rejected because of its ugliness. The
method (3) needs many extra codes and makes handler of driver too big
and complex. I think the method (2) is the simplest though it make
common codes dirty.

Please feel free to comment.

Best Regards,
Takao Indoh