From 38e7f637e66b98d18539ef2f84ceca734f4c4c9f Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:25:04 -0500 Subject: [PATCH] Import 2.3.1pre4 --- drivers/block/ide.c | 19 ++++ drivers/block/paride/paride.c | 4 +- drivers/block/paride/paride.h | 2 +- drivers/cdrom/aztcd.c | 2 +- drivers/cdrom/cdu31a.c | 8 +- drivers/cdrom/cm206.c | 14 +-- drivers/cdrom/mcd.c | 2 +- drivers/cdrom/mcdx.c | 10 +- drivers/cdrom/optcd.c | 2 +- drivers/cdrom/sbpcd.c | 2 +- drivers/cdrom/sjcd.c | 2 +- drivers/cdrom/sonycd535.c | 4 +- drivers/char/atixlmouse.c | 4 +- drivers/char/busmouse.c | 2 +- drivers/char/cyclades.c | 16 +-- drivers/char/dtlk.c | 4 +- drivers/char/epca.c | 6 +- drivers/char/esp.c | 8 +- drivers/char/ftape/lowlevel/fdc-io.c | 4 +- drivers/char/ftape/lowlevel/fdc-io.h | 2 +- drivers/char/hfmodem/main.c | 4 +- drivers/char/isicom.c | 7 +- drivers/char/joystick/joystick.c | 4 +- drivers/char/msbusmouse.c | 2 +- drivers/char/n_hdlc.c | 10 +- drivers/char/pc110pad.c | 3 +- drivers/char/radio-cadet.c | 11 +- drivers/char/riscom8.c | 6 +- drivers/char/riscom8.h | 4 +- drivers/char/rocket.c | 6 +- drivers/char/rocket_int.h | 4 +- drivers/char/specialix.c | 6 +- drivers/char/specialix_io8.h | 4 +- drivers/char/synclink.c | 18 ++-- drivers/char/tpqic02.c | 3 +- drivers/net/3c527.c | 3 +- drivers/net/ibmtr.c | 2 + drivers/net/ibmtr.h | 4 +- drivers/net/shaper.c | 1 + drivers/net/sktr.c | 3 +- drivers/net/sktr.h | 2 +- drivers/scsi/aha152x.c | 7 +- drivers/scsi/eata_dma_proc.c | 4 +- drivers/scsi/gdth_proc.c | 2 +- drivers/sound/es1370.c | 2 +- drivers/sound/es1371.c | 2 +- drivers/sound/sonicvibes.c | 2 +- fs/buffer.c | 4 +- fs/hfs/ChangeLog | 16 +++ fs/hfs/bnode.c | 4 +- fs/hfs/btree.c | 2 +- fs/hfs/catalog.c | 4 +- fs/hfs/file_hdr.c | 148 +++++++++++++++++++++++--- fs/hfs/hfs.h | 21 +++- fs/hfs/inode.c | 11 +- fs/hfs/super.c | 12 ++- fs/lockd/svc.c | 2 +- include/asm-arm/arch-ebsa285/irq.h | 1 + include/asm-arm/arch-ebsa285/memory.h | 2 + include/linux/busmouse.h | 2 +- include/linux/cyclades.h | 6 +- include/linux/epca.h | 4 +- include/linux/hayesesp.h | 8 +- include/linux/hfmodem.h | 2 +- include/linux/hfs_fs.h | 91 ++++++++-------- include/linux/hfs_fs_sb.h | 3 +- include/linux/if_shaper.h | 2 +- include/linux/isicom.h | 4 +- include/linux/joystick.h | 2 +- include/linux/sched.h | 6 -- include/linux/wait.h | 2 +- include/net/irda/ircomm_common.h | 4 +- include/net/irda/irda.h | 2 +- include/net/irda/irlpt_common.h | 8 +- include/net/irda/irmod.h | 2 +- include/net/irda/irvtd.h | 8 +- kernel/sched.c | 17 +-- net/ipv4/tcp.c | 26 ++--- net/irda/af_irda.c | 2 +- net/irda/ircomm/irvtd_driver.c | 6 +- net/netlink/af_netlink.c | 2 +- 81 files changed, 445 insertions(+), 234 deletions(-) diff --git a/drivers/block/ide.c b/drivers/block/ide.c index b8d81652d9a2..e93a7d454223 100644 --- a/drivers/block/ide.c +++ b/drivers/block/ide.c @@ -1696,6 +1696,7 @@ void ide_unregister (unsigned int index) ide_hwgroup_t *hwgroup; int irq_count = 0, unit, i; unsigned long flags; + unsigned int p, minor; if (index >= MAX_HWIFS) return; @@ -1714,6 +1715,24 @@ void ide_unregister (unsigned int index) goto abort; } hwif->present = 0; + + /* + * All clear? Then blow away the buffer cache + */ + sti(); + for (unit = 0; unit < MAX_DRIVES; ++unit) { + drive = &hwif->drives[unit]; + minor = drive->select.b.unit << PARTN_BITS; + for (p = 0; p < (1<part[p].nr_sects > 0) { + kdev_t devp = MKDEV(hwif->major, minor+p); + struct super_block * sb = get_super(devp); + if (sb) invalidate_inodes(sb); + invalidate_buffers (devp); + } + } + } + cli(); hwgroup = hwif->hwgroup; /* diff --git a/drivers/block/paride/paride.c b/drivers/block/paride/paride.c index 6e962d8c1c64..1b1fcfe23a9d 100644 --- a/drivers/block/paride/paride.c +++ b/drivers/block/paride/paride.c @@ -247,7 +247,7 @@ static void pi_register_parport( PIA *pi, int verbose) pi->pardev = (void *) parport_register_device( pp,pi->device,NULL,pi_wake_up,NULL,0,(void *)pi); - pi->parq = NULL; + init_wait_queue_head(&pi->parq); if (verbose) printk("%s: 0x%x is %s\n",pi->device,pi->port,pp->name); @@ -357,7 +357,7 @@ int pi_init(PIA *pi, int autoprobe, int port, int mode, pi->parname = NULL; pi->pardev = NULL; - pi->parq = NULL; + init_wait_queue_head(&pi->parq); pi->claimed = 0; pi->claim_cont = NULL; diff --git a/drivers/block/paride/paride.h b/drivers/block/paride/paride.h index 6d37736ec299..e08e07e65988 100644 --- a/drivers/block/paride/paride.h +++ b/drivers/block/paride/paride.h @@ -44,7 +44,7 @@ struct pi_adapter { int reserved; /* number of ports reserved */ int private; /* for protocol module */ - struct wait_queue *parq; /* semaphore for parport sharing */ + wait_queue_head_t parq; /* semaphore for parport sharing */ void *pardev; /* pointer to pardevice */ char *parname; /* parport name */ int claimed; /* parport has already been claimed */ diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c index 0342a5381506..eaa4e86196a8 100644 --- a/drivers/cdrom/aztcd.c +++ b/drivers/cdrom/aztcd.c @@ -303,7 +303,7 @@ static char azt_init_end = 0; static char azt_auto_eject = AZT_AUTO_EJECT; static int AztTimeout, AztTries; -static struct wait_queue *azt_waitq = NULL; +static DECLARE_WAIT_QUEUE_HEAD(azt_waitq); static struct timer_list delay_timer = { NULL, NULL, 0, 0, NULL }; static struct azt_DiskInfo DiskInfo; diff --git a/drivers/cdrom/cdu31a.c b/drivers/cdrom/cdu31a.c index d893cdecd815..c825b8344618 100644 --- a/drivers/cdrom/cdu31a.c +++ b/drivers/cdrom/cdu31a.c @@ -278,7 +278,7 @@ static struct s_sony_subcode last_sony_subcode; /* Points to the last static volatile int sony_inuse = 0; /* Is the drive in use? Only one operation at a time allowed */ -static struct wait_queue * sony_wait = NULL; /* Things waiting for the drive */ +static DECLARE_WAIT_QUEUE_HEAD(sony_wait); /* Things waiting for the drive */ static struct task_struct *has_cd_task = NULL; /* The task that is currently using the CDROM drive, or @@ -311,7 +311,7 @@ MODULE_PARM(cdu31a_irq, "i"); /* The interrupt handler will wake this queue up when it gets an interrupts. */ -static struct wait_queue *cdu31a_irq_wait = NULL; +DECLARE_WAIT_QUEUE_HEAD(cdu31a_irq_wait); static int curr_control_reg = 0; /* Current value of the control register */ @@ -577,13 +577,13 @@ cdu31a_interrupt(int irq, void *dev_id, struct pt_regs *regs) abort_read_started = 0; /* If something was waiting, wake it up now. */ - if (cdu31a_irq_wait != NULL) + if (waitqueue_active(&cdu31a_irq_wait)) { disable_interrupts(); wake_up(&cdu31a_irq_wait); } } - else if (cdu31a_irq_wait != NULL) + else if (waitqueue_active(&cdu31a_irq_wait)) { disable_interrupts(); wake_up(&cdu31a_irq_wait); diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c index be835a184320..72f7cb98163e 100644 --- a/drivers/cdrom/cm206.c +++ b/drivers/cdrom/cm206.c @@ -262,8 +262,8 @@ struct cm206_struct { int openfiles; ush sector[READ_AHEAD*RAW_SECTOR_SIZE/2]; /* buffered cd-sector */ int sector_first, sector_last; /* range of these sectors */ - struct wait_queue * uart; /* wait queues for interrupt */ - struct wait_queue * data; + wait_queue_head_t uart; /* wait queues for interrupt */ + wait_queue_head_t data; struct timer_list timer; /* time-out */ char timed_out; signed char max_sectors; /* number of sectors that fit in adapter mem */ @@ -360,7 +360,7 @@ static void cm206_interrupt(int sig, void *dev_id, struct pt_regs * regs) debug(("receiving #%d: 0x%x\n", cd->ur_w, cd->ur[cd->ur_w])); cd->ur_w++; cd->ur_w %= UR_SIZE; if (cd->ur_w == cd->ur_r) debug(("cd->ur overflow!\n")); - if (cd->uart && cd->background < 2) { + if (waitqueue_active(&cd->uart) && cd->background < 2) { del_timer(&cd->timer); wake_up_interruptible(&cd->uart); } @@ -368,7 +368,7 @@ static void cm206_interrupt(int sig, void *dev_id, struct pt_regs * regs) /* data ready in fifo? */ else if (cd->intr_ds & ds_data_ready) { if (cd->background) ++cd->adapter_last; - if (cd->data && (cd->wait_back || !cd->background)) { + if (waitqueue_active(&cd->data) && (cd->wait_back || !cd->background)) { del_timer(&cd->timer); wake_up_interruptible(&cd->data); } @@ -419,12 +419,12 @@ void cm206_timeout(unsigned long who) { cd->timed_out = 1; debug(("Timing out\n")); - wake_up_interruptible((struct wait_queue **) who); + wake_up_interruptible((wait_queue_head_t *)who); } /* This function returns 1 if a timeout occurred, 0 if an interrupt happened */ -int sleep_or_timeout(struct wait_queue ** wait, int timeout) +int sleep_or_timeout(wait_queue_head_t *wait, int timeout) { cd->timed_out=0; cd->timer.data=(unsigned long) wait; @@ -442,7 +442,7 @@ int sleep_or_timeout(struct wait_queue ** wait, int timeout) void cm206_delay(int nr_jiffies) { - struct wait_queue * wait = NULL; + DECLARE_WAIT_QUEUE_HEAD(wait); sleep_or_timeout(&wait, nr_jiffies); } diff --git a/drivers/cdrom/mcd.c b/drivers/cdrom/mcd.c index f4292af14123..4297ae48c6f0 100644 --- a/drivers/cdrom/mcd.c +++ b/drivers/cdrom/mcd.c @@ -162,7 +162,7 @@ static int mcd_irq = CONFIG_MCD_IRQ; /* must directly follow mcd_port */ MODULE_PARM(mcd, "1-2i"); static int McdTimeout, McdTries; -static struct wait_queue *mcd_waitq = NULL; +static DECLARE_WAIT_QUEUE_HEAD(mcd_waitq); static struct mcd_DiskInfo DiskInfo; static struct mcd_Toc Toc[MAX_TRACKS]; diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c index 708b728332b5..684d7a29e2b2 100644 --- a/drivers/cdrom/mcdx.c +++ b/drivers/cdrom/mcdx.c @@ -150,9 +150,9 @@ struct s_version { struct s_drive_stuff { /* waitqueues */ - struct wait_queue *busyq; - struct wait_queue *lockq; - struct wait_queue *sleepq; + wait_queue_head_t busyq; + wait_queue_head_t lockq; + wait_queue_head_t sleepq; /* flags */ volatile int introk; /* status of last irq operation */ @@ -1046,6 +1046,10 @@ __initfunc(int mcdx_init_drive(int drive)) stuffp->wreg_reset = stuffp->rreg_status = stuffp->wreg_data + 1; stuffp->wreg_hcon = stuffp->wreg_reset + 1; stuffp->wreg_chn = stuffp->wreg_hcon + 1; + + init_waitqueue_head(&stuffp->busyq); + init_waitqueue_head(&stuffp->lockq); + init_waitqueue_head(&stuffp->sleepq); /* check if i/o addresses are available */ if (check_region((unsigned int) stuffp->wreg_data, MCDX_IO_SIZE)) { diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c index 4406e1733276..df829dfb96c4 100644 --- a/drivers/cdrom/optcd.c +++ b/drivers/cdrom/optcd.c @@ -257,7 +257,7 @@ inline static int flag_low(int flag, unsigned long timeout) /* Timed waiting for status or data */ static int sleep_timeout; /* max # of ticks to sleep */ -static struct wait_queue *waitq = NULL; +static DECLARE_WAIT_QUEUE_HEAD(waitq); static struct timer_list delay_timer = {NULL, NULL, 0, 0, NULL}; #define SET_TIMER(func, jifs) \ diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c index 73750c56c491..23033890058e 100644 --- a/drivers/cdrom/sbpcd.c +++ b/drivers/cdrom/sbpcd.c @@ -612,7 +612,7 @@ static u_char xa_tail_buf[CD_XA_TAIL]; static volatile u_char busy_data=0; static volatile u_char busy_audio=0; /* true semaphores would be safer */ #endif OLD_BUSY -static struct semaphore ioctl_read_sem = MUTEX; +static DECLARE_MUTEX(ioctl_read_sem); static u_long timeout; static volatile u_char timed_out_delay=0; static volatile u_char timed_out_data=0; diff --git a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c index 7e69e8e50e21..8d16b8363470 100644 --- a/drivers/cdrom/sjcd.c +++ b/drivers/cdrom/sjcd.c @@ -115,7 +115,7 @@ static int sjcd_base = SJCD_BASE_ADDR; MODULE_PARM(sjcd_base, "i"); #endif -static struct wait_queue *sjcd_waitq = NULL; +static DECLARE_WAIT_QUEUE_HEAD(sjcd_waitq); /* * Data transfer. diff --git a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c index f16b5b1d0c5e..eafe6a672aa2 100644 --- a/drivers/cdrom/sonycd535.c +++ b/drivers/cdrom/sonycd535.c @@ -261,7 +261,7 @@ static Byte final_pos_msf[3] = {0, 0, 0}; static int sony535_irq_used = CDU535_INTERRUPT; /* The interrupt handler will wake this queue up when it gets an interrupt. */ -static struct wait_queue *cdu535_irq_wait = NULL; +static DECLARE_WAIT_QUEUE_HEAD(cdu535_irq_wait); /* @@ -318,7 +318,7 @@ static void cdu535_interrupt(int irq, void *dev_id, struct pt_regs *regs) { disable_interrupts(); - if (cdu535_irq_wait != NULL) + if (wait_queue_active(&cdu535_irq_wait)) wake_up(&cdu535_irq_wait); else printk(CDU535_MESSAGE_NAME diff --git a/drivers/char/atixlmouse.c b/drivers/char/atixlmouse.c index 52ce4bf679a0..69fcbf004dfe 100644 --- a/drivers/char/atixlmouse.c +++ b/drivers/char/atixlmouse.c @@ -67,7 +67,7 @@ static struct mouse_status { int present; int ready; int active; - struct wait_queue *wait; + wait_queue_head_t wait; struct fasync_struct *fasync; } mouse; @@ -223,7 +223,7 @@ __initfunc(int atixl_busmouse_init(void)) mouse.ready = 0; mouse.buttons = mouse.latch_buttons = 0; mouse.dx = mouse.dy = 0; - mouse.wait = NULL; + init_waitqueue_head(&mouse.wait); printk("Bus mouse detected and installed.\n"); misc_register(&atixl_mouse); return 0; diff --git a/drivers/char/busmouse.c b/drivers/char/busmouse.c index d4fc2d7f9f45..1ec37e864b57 100644 --- a/drivers/char/busmouse.c +++ b/drivers/char/busmouse.c @@ -277,7 +277,7 @@ __initfunc(int bus_mouse_init(void)) mouse.buttons = 0x87; mouse.dx = 0; mouse.dy = 0; - mouse.wait = NULL; + init_waitqueue_head(&mouse.wait); printk(KERN_INFO "Logitech bus mouse detected, using IRQ %d.\n", mouse_irq); misc_register(&bus_mouse); diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 93ab0faa3f48..af91e158ed6f 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -697,7 +697,7 @@ static struct cyclades_card *IRQ_cards[NR_IRQS]; * allocated when the first cy_open occurs. */ static unsigned char *tmp_buf; -static struct semaphore tmp_buf_sem = MUTEX; +DECLARE_MUTEX(tmp_buf_sem); /* * This is used to look up the divisor speeds and the timeouts @@ -2246,7 +2246,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, struct cyclades_port *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); struct cyclades_card *cinfo; unsigned long flags; int chip, channel,index; @@ -5210,9 +5210,9 @@ cy_init(void)) cy_callout_driver.init_termios; info->normal_termios = cy_serial_driver.init_termios; - info->open_wait = 0; - info->close_wait = 0; - info->shutdown_wait = 0; + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); + init_waitqueue_head(&info->shutdown_wait); /* info->session */ /* info->pgrp */ info->read_status_mask = 0; @@ -5279,9 +5279,9 @@ cy_init(void)) cy_callout_driver.init_termios; info->normal_termios = cy_serial_driver.init_termios; - info->open_wait = 0; - info->close_wait = 0; - info->shutdown_wait = 0; + init_waitqueue(&info->open_wait); + init_waitqueue(&info->close_wait); + init_waitqueue(&info->shutdown_wait); /* info->session */ /* info->pgrp */ info->read_status_mask = diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c index 888f0a3adc3a..6886042277db 100644 --- a/drivers/char/dtlk.c +++ b/drivers/char/dtlk.c @@ -87,7 +87,7 @@ static int dtlk_timer_active; static int dtlk_has_indexing; static unsigned int dtlk_portlist[] = {0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0}; -static struct wait_queue *dtlk_process_list = NULL; +static wait_queue_head_t dtlk_process_list; static struct timer_list dtlk_timer; /* prototypes for file_operations struct */ @@ -382,7 +382,7 @@ int __init dtlk_init(void) init_timer(&dtlk_timer); dtlk_timer.function = dtlk_timer_tick; - dtlk_process_list = NULL; + init_waitqueue_head(&dtlk_process_list); return 0; } diff --git a/drivers/char/epca.c b/drivers/char/epca.c index e1d2cd2f700f..abb8c5f35290 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c @@ -1268,7 +1268,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, struct channel *ch) { /* Begin block_til_ready */ - struct wait_queue wait = {current, NULL}; + DECLARE_WAITQUEUE(wait,current); int retval, do_clocal = 0; unsigned long flags; @@ -2236,8 +2236,8 @@ static void post_fep_init(unsigned int crd) ch->blocked_open = 0; ch->callout_termios = pc_callout.init_termios; ch->normal_termios = pc_driver.init_termios; - ch->open_wait = 0; - ch->close_wait = 0; + init_waitqueue_head(&ch->open_wait); + init_waitqueue_head(&ch->close_wait); ch->tmp_buf = kmalloc(ch->txbufsize,GFP_KERNEL); if (!(ch->tmp_buf)) { diff --git a/drivers/char/esp.c b/drivers/char/esp.c index bf852fb20308..53d67f19ea42 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c @@ -169,7 +169,7 @@ static struct termios *serial_termios_locked[NR_PORTS]; * memory if large numbers of serial ports are open. */ static unsigned char *tmp_buf = 0; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); static inline int serial_paranoia_check(struct esp_struct *info, kdev_t device, const char *routine) @@ -2224,7 +2224,7 @@ static void esp_hangup(struct tty_struct *tty) static int block_til_ready(struct tty_struct *tty, struct file * filp, struct esp_struct *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int retval; int do_clocal = 0; @@ -2676,6 +2676,10 @@ __initfunc(int espserial_init(void)) info->config.flow_off = flow_off; info->config.pio_threshold = pio_threshold; info->next_port = ports; + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); + init_waitqueue_head(&info->delta_msr_wait); + init_waitqueue_head(&info->break_wait); ports = info; printk(KERN_INFO "ttyP%d at 0x%04x (irq = %d) is an ESP ", info->line, info->port, info->irq); diff --git a/drivers/char/ftape/lowlevel/fdc-io.c b/drivers/char/ftape/lowlevel/fdc-io.c index 6890df0fa292..c476c644131b 100644 --- a/drivers/char/ftape/lowlevel/fdc-io.c +++ b/drivers/char/ftape/lowlevel/fdc-io.c @@ -54,7 +54,7 @@ int ftape_motor = 0; volatile int ftape_current_cylinder = -1; volatile fdc_mode_enum fdc_mode = fdc_idle; fdc_config_info fdc = {0}; -struct wait_queue *ftape_wait_intr = NULL; +DECLARE_WAIT_QUEUE_HEAD(ftape_wait_intr); unsigned int ft_fdc_base = CONFIG_FT_FDC_BASE; unsigned int ft_fdc_irq = CONFIG_FT_FDC_IRQ; @@ -385,7 +385,7 @@ int fdc_issue_command(const __u8 * out_data, int out_count, */ int fdc_interrupt_wait(unsigned int time) { - struct wait_queue wait = {current, NULL}; + DECLARE_WAITQUEUE(wait,current); sigset_t old_sigmask; static int resetting = 0; long timeout; diff --git a/drivers/char/ftape/lowlevel/fdc-io.h b/drivers/char/ftape/lowlevel/fdc-io.h index 77b2f5bb9df2..d7093b316d03 100644 --- a/drivers/char/ftape/lowlevel/fdc-io.h +++ b/drivers/char/ftape/lowlevel/fdc-io.h @@ -209,7 +209,7 @@ typedef struct { */ extern volatile fdc_mode_enum fdc_mode; extern int fdc_setup_error; /* outdated ??? */ -extern struct wait_queue *ftape_wait_intr; +extern wait_queue_head_t ftape_wait_intr; extern int ftape_motor; /* fdc motor line state */ extern volatile int ftape_current_cylinder; /* track nr FDC thinks we're on */ extern volatile __u8 fdc_head; /* FDC head */ diff --git a/drivers/char/hfmodem/main.c b/drivers/char/hfmodem/main.c index 20347f32c591..6af834fce503 100644 --- a/drivers/char/hfmodem/main.c +++ b/drivers/char/hfmodem/main.c @@ -638,6 +638,7 @@ __initfunc(int init_module(void)) hfmodem_state[0].ptt_out.seriobase = serio; hfmodem_state[0].ptt_out.pariobase = pario; hfmodem_state[0].ptt_out.midiiobase = midiio; + init_waitqueue_head(&hfmodem_state[0].wait); hfmodem_refclock_probe(); output_check(&hfmodem_state[0]); #if defined(CONFIG_HFMODEM_WSS) && defined(CONFIG_HFMODEM_SBC) @@ -703,7 +704,8 @@ __initfunc(void hfmodem_init(void)) int i; printk(hfmodem_drvinfo); - hfmodem_refclock_probe(); + init_waitqueue_head(&hfmode_state[0].wait); + hfmodem_refclock_probe(); output_check(&hfmodem_state[0]); #if defined(CONFIG_HFMODEM_WSS) && defined(CONFIG_HFMODEM_SBC) if (hw) diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index ba72b616a792..e99decb6235a 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c @@ -80,7 +80,7 @@ static void isicom_tx(unsigned long _data); static void isicom_start(struct tty_struct * tty); static unsigned char * tmp_buf = 0; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); /* baud index mappings from linux defns to isi */ @@ -870,7 +870,7 @@ static int isicom_setup_port(struct isi_port * port) static int block_til_ready(struct tty_struct * tty, struct file * filp, struct isi_port * port) { int do_clocal = 0, retval; - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); /* block if port is in the process of being closed */ @@ -1858,7 +1858,8 @@ static int isicom_init(void) port->bh_tqueue.routine = isicom_bottomhalf; port->bh_tqueue.data = port; port->status = 0; - + init_waitqueue_head(&port->open_wait); + init_waitqueue_head(&port->close_wait); /* . . . */ } } diff --git a/drivers/char/joystick/joystick.c b/drivers/char/joystick/joystick.c index aff1acd173c3..4d9d94aa1126 100644 --- a/drivers/char/joystick/joystick.c +++ b/drivers/char/joystick/joystick.c @@ -491,7 +491,7 @@ static ssize_t js_read(struct file *file, char *buf, size_t count, loff_t *ppos) static int js_read(struct inode *inode, struct file *file, char *buf, int count) #endif { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); struct js_event *buff = (void *) buf; struct js_list *curl; struct js_dev *jd; @@ -1081,7 +1081,7 @@ int js_register_device(struct js_port *port, int number, int axes, int buttons, curd->next = NULL; curd->list = NULL; curd->port = port; - curd->wait = NULL; + init_waitqueue_head(&curd->wait); curd->open = open; curd->close = close; diff --git a/drivers/char/msbusmouse.c b/drivers/char/msbusmouse.c index 07c733b5b448..f580be0bba2e 100644 --- a/drivers/char/msbusmouse.c +++ b/drivers/char/msbusmouse.c @@ -195,7 +195,7 @@ __initfunc(int ms_bus_mouse_init(void)) mouse.present = mouse.active = mouse.ready = 0; mouse.buttons = 0x80; mouse.dx = mouse.dy = 0; - mouse.wait = NULL; + init_waitqueue_head(&mouse.wait); if (check_region(MS_MSE_CONTROL_PORT, 0x04)) return -ENODEV; diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c index cff73b4a35e0..9319b777a4f5 100644 --- a/drivers/char/n_hdlc.c +++ b/drivers/char/n_hdlc.c @@ -221,8 +221,8 @@ struct n_hdlc { struct tty_struct *backup_tty; /* TTY to use if tty gets closed */ /* Queues for select() functionality */ - struct wait_queue *read_wait; - struct wait_queue *write_wait; + wait_queue_head_t read_wait; + wait_queue_head_t write_wait; int tbusy; /* reentrancy flag for tx wakeup code */ int woke_up; @@ -724,7 +724,7 @@ static rw_ret_t n_hdlc_tty_write (struct tty_struct *tty, struct file *file, { struct n_hdlc *n_hdlc = tty2n_hdlc (tty); int error = 0; - struct wait_queue wait = {current, NULL}; + DECLARE_WAITQUEUE(wait, current); N_HDLC_BUF *tbuf; if (debuglevel >= DEBUG_LEVEL_INFO) @@ -1006,8 +1006,8 @@ static struct n_hdlc *n_hdlc_alloc (void) n_hdlc->magic = HDLC_MAGIC; n_hdlc->flags = 0; - n_hdlc->read_wait = NULL; - n_hdlc->write_wait = NULL; + init_waitqueue_head(&n_hdlc->read_wait); + init_waitqueue_head(&n_hdlc->write_wait); return n_hdlc; diff --git a/drivers/char/pc110pad.c b/drivers/char/pc110pad.c index 247cfa1811da..d5bc4cc0bbad 100644 --- a/drivers/char/pc110pad.c +++ b/drivers/char/pc110pad.c @@ -48,7 +48,7 @@ static struct pc110pad_params current_params; /* driver/filesystem interface management */ -static struct wait_queue *queue; +static wait_queue_head_t queue; static struct fasync_struct *asyncptr; static int active=0; /* number of concurrent open()s */ @@ -656,6 +656,7 @@ int pc110pad_init(void) return -EBUSY; } request_region(current_params.io, 4, "pc110pad"); + init_waitqueue_head(&queue); printk("PC110 digitizer pad at 0x%X, irq %d.\n", current_params.io,current_params.irq); misc_register(&pc110_pad); diff --git a/drivers/char/radio-cadet.c b/drivers/char/radio-cadet.c index 08d502d8505f..9e6741e2b083 100644 --- a/drivers/char/radio-cadet.c +++ b/drivers/char/radio-cadet.c @@ -34,7 +34,7 @@ static int users=0; static int curtuner=0; static int tunestat=0; static int sigstrength=0; -struct wait_queue *tunerq,*rdsq,*readq; +static wait_queue_head_t tunerq,rdsq,readq; struct timer_list tunertimer,rdstimer,readtimer; static __u8 rdsin=0,rdsout=0,rdsstat=0; static unsigned char rdsbuf[RDS_BUFFER]; @@ -75,7 +75,7 @@ static int cadet_getrds(void) rdstimer.function=cadet_wake; rdstimer.data=(unsigned long)1; rdstimer.expires=jiffies+(HZ/10); - rdsq=NULL; + init_waitqueue_head(&rdsq); add_timer(&rdstimer); sleep_on(&rdsq); @@ -260,7 +260,7 @@ static void cadet_setfreq(unsigned freq) tunertimer.function=cadet_wake; tunertimer.data=(unsigned long)0; tunertimer.expires=jiffies+(HZ/10); - tunerq=NULL; + init_waitqueue_head(&tunerq); add_timer(&tunertimer); sleep_on(&tunerq); cadet_gettune(); @@ -327,7 +327,7 @@ void cadet_handler(unsigned long data) /* * Service pending read */ - if((rdsin!=rdsout)&&(readq!=NULL)) { + if( rdsin!=rdsout) { wake_up_interruptible(&readq); } @@ -369,7 +369,6 @@ static long cadet_read(struct video_device *v,char *buf,unsigned long count, return -EWOULDBLOCK; } interruptible_sleep_on(&readq); - readq=NULL; } while((iclose_delay = 50; info->callout_termios =callout_driver.init_termios; info->normal_termios = rocket_driver.init_termios; + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); info->intmask = RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR; @@ -807,7 +809,7 @@ static void configure_r_port(struct r_port *info) static int block_til_ready(struct tty_struct *tty, struct file * filp, struct r_port *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int retval; int do_clocal = 0, extra_count = 0; unsigned long flags; diff --git a/drivers/char/rocket_int.h b/drivers/char/rocket_int.h index 604e8733b871..74dda61edfa6 100644 --- a/drivers/char/rocket_int.h +++ b/drivers/char/rocket_int.h @@ -1144,8 +1144,8 @@ struct r_port { struct termios normal_termios; struct termios callout_termios; struct tq_struct tqueue; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; }; #define RPORT_MAGIC 0x525001 diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 220c93f802ec..c6fecb819e03 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c @@ -182,7 +182,7 @@ static struct tty_struct * specialix_table[SX_NBOARD * SX_NPORT] = { NULL, }; static struct termios * specialix_termios[SX_NBOARD * SX_NPORT] = { NULL, }; static struct termios * specialix_termios_locked[SX_NBOARD * SX_NPORT] = { NULL, }; static unsigned char * tmp_buf = NULL; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); static unsigned long baud_table[] = { 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, @@ -1311,7 +1311,7 @@ static void sx_shutdown_port(struct specialix_board *bp, struct specialix_port * static int block_til_ready(struct tty_struct *tty, struct file * filp, struct specialix_port *port) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); struct specialix_board *bp = port_Board(port); int retval; int do_clocal = 0; @@ -2248,6 +2248,8 @@ static int sx_init_drivers(void) sx_port[i].tqueue_hangup.data = &sx_port[i]; sx_port[i].close_delay = 50 * HZ/100; sx_port[i].closing_wait = 3000 * HZ/100; + init_waitqueue_head(&sx_port[i].open_wait); + init_waitqueue_head(&sx_port[i].close_wait); } return 0; diff --git a/drivers/char/specialix_io8.h b/drivers/char/specialix_io8.h index f4ca99ea6ca7..e2a4a224cee8 100644 --- a/drivers/char/specialix_io8.h +++ b/drivers/char/specialix_io8.h @@ -122,8 +122,8 @@ struct specialix_port { int xmit_cnt; struct termios normal_termios; struct termios callout_termios; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; struct tq_struct tqueue; struct tq_struct tqueue_hangup; short wakeup_chars; diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 0881c88218c2..75c8a68b9328 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c @@ -241,11 +241,11 @@ struct mgsl_struct { int xmit_tail; int xmit_cnt; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; - struct wait_queue *status_event_wait_q; - struct wait_queue *event_wait_q; + wait_queue_head_t status_event_wait_q; + wait_queue_head_t event_wait_q; struct timer_list tx_timer; /* HDLC transmit timeout timer */ struct mgsl_struct *next_device; /* device list link */ @@ -904,7 +904,7 @@ void* mgsl_get_text_ptr() {return mgsl_get_text_ptr;} * memory if large numbers of serial ports are open. */ static unsigned char *tmp_buf; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); static inline int mgsl_paranoia_check(struct mgsl_struct *info, kdev_t device, const char *routine) @@ -2724,7 +2724,7 @@ static int mgsl_wait_event(struct mgsl_struct * info, int mask) if (mask & (MgslEvent_ExitHuntMode + MgslEvent_IdleReceived)) { spin_lock_irqsave(&info->irq_spinlock,flags); - if (!info->event_wait_q) { + if (!waitqueue_active(&info->event_wait_q)) { /* disable enable exit hunt mode/idle rcvd IRQs */ regval = usc_InReg(info,RICR); usc_OutReg(info, RICR, regval & @@ -3295,7 +3295,7 @@ static void mgsl_hangup(struct tty_struct *tty) static int block_til_ready(struct tty_struct *tty, struct file * filp, struct mgsl_struct *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int retval; int do_clocal = 0, extra_count = 0; unsigned long flags; @@ -4152,6 +4152,10 @@ struct mgsl_struct* mgsl_allocate_device() info->max_frame_size = 4096; info->close_delay = 5*HZ/10; info->closing_wait = 30*HZ; + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); + init_waitqueue_head(&info->status_event_wait_q); + init_waitqueue_head(&info->event_wait_q); memcpy(&info->params,&default_params,sizeof(MGSL_PARAMS)); info->idle_mode = HDLC_TXIDLE_FLAGS; diff --git a/drivers/char/tpqic02.c b/drivers/char/tpqic02.c index 7dcecae4c98b..67b8f3a71ca9 100644 --- a/drivers/char/tpqic02.c +++ b/drivers/char/tpqic02.c @@ -127,7 +127,7 @@ unsigned long qic02_tape_debug = TPQD_DEFAULT_FLAGS; static volatile int ctlbits = 0; /* control reg bits for tape interface */ -static struct wait_queue *qic02_tape_transfer = NULL; /* sync rw with interrupts */ +static wait_queue_t qic02_tape_transfer; /* sync rw with interrupts */ static volatile struct mtget ioctl_status; /* current generic status */ @@ -2936,6 +2936,7 @@ __initfunc(int qic02_tape_init(void)) return -ENODEV; } + init_waitqueue_head(&qic02_tape_transfer); /* prepare timer */ TIMEROFF; timer_table[QIC02_TAPE_TIMER].expires = 0; diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c index ca199597e213..947cf6d2df3a 100644 --- a/drivers/net/3c527.c +++ b/drivers/net/3c527.c @@ -102,7 +102,7 @@ struct mc32_local u16 exec_pending; u16 mc_reload_wait; /* a multicast load request is pending */ atomic_t tx_count; /* buffers left */ - struct wait_queue *event; + wait_queue_head_t event; struct sk_buff *tx_skb[TX_RING_MAX]; /* Transmit ring */ u16 tx_skb_top; u16 tx_skb_end; @@ -411,6 +411,7 @@ __initfunc(static int mc32_probe1(struct device *dev, int slot)) lp->rx_chain = lp->exec_box->data[10]; lp->tx_len = lp->exec_box->data[9]; lp->rx_len = lp->exec_box->data[11]; + init_waitqueue_head(&lp->event); printk("%s: %d RX buffers, %d TX buffers. Base of 0x%08X.\n", dev->name, lp->rx_len, lp->tx_len, lp->base); diff --git a/drivers/net/ibmtr.c b/drivers/net/ibmtr.c index 780b8a938f98..f8d53cea4cca 100644 --- a/drivers/net/ibmtr.c +++ b/drivers/net/ibmtr.c @@ -404,6 +404,8 @@ __initfunc(static int ibmtr_probe1(struct device *dev, int PIOaddr)) #endif ti->mmio= t_mmio; ti->readlog_pending = 0; + init_waitqueue_head(&ti->wait_for_tok_int); + init_waitqueue_head(&ti->wait_for_reset); dev->priv = ti; /* this seems like the logical use of the field ... let's try some empirical tests diff --git a/drivers/net/ibmtr.h b/drivers/net/ibmtr.h index 4708366c7022..f51174c4fc68 100644 --- a/drivers/net/ibmtr.h +++ b/drivers/net/ibmtr.h @@ -193,8 +193,8 @@ struct tok_info { unsigned short maxmtu16; /* Additions by David Morris */ unsigned char do_tok_int; - struct wait_queue *wait_for_tok_int; - struct wait_queue *wait_for_reset; + wait_queue_head_t wait_for_tok_int; + wait_queue_head_t wait_for_reset; unsigned char sram_base; /* Additions by Peter De Schrijver */ unsigned char page_mask; /* mask to select RAM page to Map*/ diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c index 2519ff89c1ce..82d73baaa5b4 100644 --- a/drivers/net/shaper.c +++ b/drivers/net/shaper.c @@ -582,6 +582,7 @@ static struct shaper *shaper_alloc(struct device *dev) init_timer(&sh->timer); sh->timer.function=shaper_timer; sh->timer.data=(unsigned long)sh; + init_waitqueue_head(&sh->wait_queue); return sh; } diff --git a/drivers/net/sktr.c b/drivers/net/sktr.c index 7bc4f256f095..a5e64eae9aad 100644 --- a/drivers/net/sktr.c +++ b/drivers/net/sktr.c @@ -414,7 +414,8 @@ __initfunc(static int sktr_probe1(struct device *dev, int ioaddr)) if(tp == NULL) return (-ENOMEM); memset(tp, 0, sizeof(struct net_local)); - + init_waitqueue_head(&tp->wait_for_tok_int); + dev->priv = tp; dev->init = sktr_init_card; dev->open = sktr_open; diff --git a/drivers/net/sktr.h b/drivers/net/sktr.h index e0fe718e7a49..4c2a3bf368a1 100644 --- a/drivers/net/sktr.h +++ b/drivers/net/sktr.h @@ -1087,7 +1087,7 @@ typedef struct net_local { struct timer_list timer; - struct wait_queue *wait_for_tok_int; + wait_queue_head_t wait_for_tok_int; INTPTRS intptrs; /* Internal adapter pointer. Must be read * before OPEN command. diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 82d55ada87d8..f43b1ead8a0d 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -414,8 +414,13 @@ extern long loops_per_sec; #define P_PARITY 2 /* possible irq range */ +#ifdef PCMCIA +#define IRQ_MIN 0 +#define IRQ_MAX 16 +#else #define IRQ_MIN 9 #define IRQ_MAX 12 +#endif #define IRQS IRQ_MAX-IRQ_MIN+1 enum { @@ -746,7 +751,7 @@ int aha152x_checksetup(struct aha152x_setup *setup) if(!aha152x_porttest(setup->io_port)) return 0; - if(setup->irqirq>IRQ_MAX) + if((setup->irqirq>IRQ_MAX)) return 0; if((setup->scsiid < 0) || (setup->scsiid > 7)) diff --git a/drivers/scsi/eata_dma_proc.c b/drivers/scsi/eata_dma_proc.c index 15aa4d9fa996..c32b9480aafb 100644 --- a/drivers/scsi/eata_dma_proc.c +++ b/drivers/scsi/eata_dma_proc.c @@ -184,7 +184,7 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length, * Do the command and wait for it to finish. */ { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); scmd.request.rq_status = RQ_SCSI_BUSY; scmd.request.sem = &sem; scsi_do_cmd (&scmd, cmnd, buff + 0x144, 0x66, @@ -314,7 +314,7 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length, * Do the command and wait for it to finish. */ { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); scmd.request.rq_status = RQ_SCSI_BUSY; scmd.request.sem = &sem; scsi_do_cmd (&scmd, cmnd, buff2, 0x144, diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c index 8f5a07625bba..137eb4c4caca 100644 --- a/drivers/scsi/gdth_proc.c +++ b/drivers/scsi/gdth_proc.c @@ -931,7 +931,7 @@ stop_output: static void gdth_do_cmd(Scsi_Cmnd *scp,gdth_cmd_str *gdtcmd,int timeout) { char cmnd[12]; - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); TRACE2(("gdth_do_cmd()\n")); memset(cmnd, 0, 12); diff --git a/drivers/sound/es1370.c b/drivers/sound/es1370.c index caacf3f58f71..2842966c388e 100644 --- a/drivers/sound/es1370.c +++ b/drivers/sound/es1370.c @@ -2314,7 +2314,7 @@ __initfunc(int init_es1370(void)) init_waitqueue_head(&s->open_wait); init_waitqueue_head(&s->midi.iwait); init_waitqueue_head(&s->midi.owait); - s->open_sem = MUTEX; + init_MUTEX(&s->open_sem); s->magic = ES1370_MAGIC; s->io = pcidev->base_address[0] & PCI_BASE_ADDRESS_IO_MASK; s->irq = pcidev->irq; diff --git a/drivers/sound/es1371.c b/drivers/sound/es1371.c index e0882d7ce4fc..d416d0e28086 100644 --- a/drivers/sound/es1371.c +++ b/drivers/sound/es1371.c @@ -2751,7 +2751,7 @@ __initfunc(int init_es1371(void)) init_waitqueue_head(&s->open_wait); init_waitqueue_head(&s->midi.iwait); init_waitqueue_head(&s->midi.owait); - s->open_sem = MUTEX; + init_MUTEX(&s->open_sem); s->magic = ES1371_MAGIC; s->io = pcidev->base_address[0] & PCI_BASE_ADDRESS_IO_MASK; s->irq = pcidev->irq; diff --git a/drivers/sound/sonicvibes.c b/drivers/sound/sonicvibes.c index 76f6c1497cb5..af5ddcea0827 100644 --- a/drivers/sound/sonicvibes.c +++ b/drivers/sound/sonicvibes.c @@ -2349,7 +2349,7 @@ __initfunc(int init_sonicvibes(void)) init_waitqueue_head(&s->open_wait); init_waitqueue_head(&s->midi.iwait); init_waitqueue_head(&s->midi.owait); - s->open_sem = MUTEX; + init_MUTEX(&s->open_sem); s->magic = SV_MAGIC; s->iosb = pcidev->base_address[0] & PCI_BASE_ADDRESS_IO_MASK; s->ioenh = pcidev->base_address[1] & PCI_BASE_ADDRESS_IO_MASK; diff --git a/fs/buffer.c b/fs/buffer.c index a8fcbea521a4..2fe2f199b55d 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -110,7 +110,7 @@ union bdflush_param{ int dummy3; /* unused */ } b_un; unsigned int data[N_PARAM]; -} bdf_prm = {{40, 500, 64, 256, 5, 30*HZ, 5*HZ, 1884, 2}}; +} bdf_prm = {{40, 2000, 64, 256, 5, 30*HZ, 5*HZ, 1884, 2}}; /* These are the min and max parameter values that we will allow to be assigned */ int bdflush_min[N_PARAM] = { 0, 10, 5, 25, 1, 1*HZ, 1*HZ, 1, 1}; @@ -1561,7 +1561,7 @@ struct task_struct *bdflush_tsk = 0; void wakeup_bdflush(int wait) { - if (current == bdflush_tsk) + if (current == bdflush_tsk || !bdflush_tsk) return; wake_up_process(bdflush_tsk); if (wait) { diff --git a/fs/hfs/ChangeLog b/fs/hfs/ChangeLog index f97bd00868bb..11c7d8506302 100644 --- a/fs/hfs/ChangeLog +++ b/fs/hfs/ChangeLog @@ -1,3 +1,19 @@ +1999-04-12 a sun + + * file_hdr.c (hdr_read): added rootinfo behaviour for DID header. + +1999-04-11 a sun + + * super.c (parse_options): added s_version so that we can select + between different versions of the same layout. + +1999-04-05 a sun + + * linux/hfs_fs.h: unified netatalk and appledouble header format. + added in all of the AFP attribute bits. + + * file_hdr.c: added netatalk appledouble v2 compatible headers. + 1999-01-30 a sun * catalog.c (hfs_cat_move): fixed corruption problem with diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c index 0b4b669a42af..350516fcdbaa 100644 --- a/fs/hfs/bnode.c +++ b/fs/hfs/bnode.c @@ -228,7 +228,7 @@ void hfs_bnode_lock(struct hfs_bnode_ref *bnr, int lock_type) break; case HFS_LOCK_NONE: - while (bn->lock || bn->wqueue) { + while (bn->lock || witqueue_active(&bn->wqueue)) { hfs_sleep_on(&bn->rqueue); } ++bn->count; @@ -382,7 +382,7 @@ void hfs_bnode_relse(struct hfs_bnode_ref *bnr) /* We update the lock state of the node if it is still in use or if it is "sticky" (such as the B-tree head and root). Otherwise we just delete it. */ - if ((bn->count > 1) || (bn->rqueue) || (bn->sticky != HFS_NOT_STICKY)) { + if ((bn->count > 1) || (waitqueue_active(&bn->rqueue)) || (bn->sticky != HFS_NOT_STICKY)) { hfs_bnode_lock(bnr, HFS_LOCK_NONE); } else { /* dirty buffer if we (might) have modified it */ diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c index 900bddf3398a..71275ef3b2db 100644 --- a/fs/hfs/btree.c +++ b/fs/hfs/btree.c @@ -173,7 +173,7 @@ struct hfs_btree * hfs_btree_init(struct hfs_mdb *mdb, ino_t cnid, bt->sys_mdb = mdb->sys_mdb; bt->reserved = 0; bt->lock = 0; - bt->wait = NULL; + init_waitqueue_head(&bt->wait); bt->dirt = 0; memset(bt->cache, 0, sizeof(bt->cache)); diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c index 48577a9e6cd8..a2d974a8b5aa 100644 --- a/fs/hfs/catalog.c +++ b/fs/hfs/catalog.c @@ -647,7 +647,7 @@ static void update_dir(struct hfs_mdb *mdb, struct hfs_cat_entry *dir, */ static inline void start_write(struct hfs_cat_entry *dir) { - if (dir->u.dir.readers || dir->u.dir.read_wait) { + if (dir->u.dir.readers || wait_queue_active(&dir->u.dir.read_wait)) { hfs_sleep_on(&dir->u.dir.write_wait); } ++dir->u.dir.writers; @@ -658,7 +658,7 @@ static inline void start_write(struct hfs_cat_entry *dir) */ static inline void start_read(struct hfs_cat_entry *dir) { - if (dir->u.dir.writers || dir->u.dir.write_wait) { + if (dir->u.dir.writers || wait_queue_active(&dir->u.dir.write_wait)) { hfs_sleep_on(&dir->u.dir.read_wait); } ++dir->u.dir.readers; diff --git a/fs/hfs/file_hdr.c b/fs/hfs/file_hdr.c index 9479fab08c90..c1e1534b04db 100644 --- a/fs/hfs/file_hdr.c +++ b/fs/hfs/file_hdr.c @@ -30,6 +30,14 @@ #include #include +/* prodos types */ +#define PRODOSI_FTYPE_DIR 0x0F +#define PRODOSI_FTYPE_TEXT 0x04 +#define PRODOSI_FTYPE_8BIT 0xFF +#define PRODOSI_FTYPE_16BIT 0xB3 + +#define PRODOSI_AUXTYPE_DIR 0x0200 + /*================ Forward declarations ================*/ static hfs_rwret_t hdr_read(struct file *, char *, hfs_rwarg_t, loff_t *); @@ -84,13 +92,14 @@ struct inode_operations hfs_hdr_inode_operations = { const struct hfs_hdr_layout hfs_dbl_fil_hdr_layout = { __constant_htonl(HFS_DBL_MAGIC), /* magic */ __constant_htonl(HFS_HDR_VERSION_2), /* version */ - 5, /* entries */ + 6, /* entries */ { /* descr[] */ + {HFS_HDR_FNAME, offsetof(struct hfs_dbl_hdr, real_name), ~0}, {HFS_HDR_DATES, offsetof(struct hfs_dbl_hdr, create_time), 16}, {HFS_HDR_FINFO, offsetof(struct hfs_dbl_hdr, finderinfo), 32}, - {HFS_HDR_MACI, offsetof(struct hfs_dbl_hdr, fileinfo), 4}, - {HFS_HDR_FNAME, offsetof(struct hfs_dbl_hdr, real_name), ~0}, - {HFS_HDR_RSRC, HFS_DBL_HDR_LEN, ~0}, + {HFS_HDR_MACI, offsetof(struct hfs_dbl_hdr, fileinfo), 4}, + {HFS_HDR_DID, offsetof(struct hfs_dbl_hdr, cnid), 4}, + {HFS_HDR_RSRC, HFS_DBL_HDR_LEN, ~0} }, { /* order[] */ (struct hfs_hdr_descr *)&hfs_dbl_fil_hdr_layout.descr[0], @@ -98,24 +107,55 @@ const struct hfs_hdr_layout hfs_dbl_fil_hdr_layout = { (struct hfs_hdr_descr *)&hfs_dbl_fil_hdr_layout.descr[2], (struct hfs_hdr_descr *)&hfs_dbl_fil_hdr_layout.descr[3], (struct hfs_hdr_descr *)&hfs_dbl_fil_hdr_layout.descr[4], + (struct hfs_hdr_descr *)&hfs_dbl_fil_hdr_layout.descr[5] } }; const struct hfs_hdr_layout hfs_dbl_dir_hdr_layout = { __constant_htonl(HFS_DBL_MAGIC), /* magic */ __constant_htonl(HFS_HDR_VERSION_2), /* version */ - 4, /* entries */ + 5, /* entries */ { /* descr[] */ + {HFS_HDR_FNAME, offsetof(struct hfs_dbl_hdr, real_name), ~0}, {HFS_HDR_DATES, offsetof(struct hfs_dbl_hdr, create_time), 16}, {HFS_HDR_FINFO, offsetof(struct hfs_dbl_hdr, finderinfo), 32}, - {HFS_HDR_MACI, offsetof(struct hfs_dbl_hdr, fileinfo), 4}, - {HFS_HDR_FNAME, offsetof(struct hfs_dbl_hdr, real_name), ~0}, + {HFS_HDR_MACI, offsetof(struct hfs_dbl_hdr, fileinfo), 4}, + {HFS_HDR_DID, offsetof(struct hfs_dbl_hdr, cnid), 4} }, { /* order[] */ (struct hfs_hdr_descr *)&hfs_dbl_dir_hdr_layout.descr[0], (struct hfs_hdr_descr *)&hfs_dbl_dir_hdr_layout.descr[1], (struct hfs_hdr_descr *)&hfs_dbl_dir_hdr_layout.descr[2], (struct hfs_hdr_descr *)&hfs_dbl_dir_hdr_layout.descr[3], + (struct hfs_hdr_descr *)&hfs_dbl_dir_hdr_layout.descr[4] + } +}; + +const struct hfs_hdr_layout hfs_nat2_hdr_layout = { + __constant_htonl(HFS_DBL_MAGIC), /* magic */ + __constant_htonl(HFS_HDR_VERSION_2), /* version */ + 9, /* entries */ + { /* descr[] */ + {HFS_HDR_FNAME, offsetof(struct hfs_dbl_hdr, real_name), ~0}, + {HFS_HDR_COMNT, offsetof(struct hfs_dbl_hdr, comment), 0}, + {HFS_HDR_DATES, offsetof(struct hfs_dbl_hdr, create_time), 16}, + {HFS_HDR_FINFO, offsetof(struct hfs_dbl_hdr, finderinfo), 32}, + {HFS_HDR_AFPI, offsetof(struct hfs_dbl_hdr, fileinfo), 4}, + {HFS_HDR_DID, offsetof(struct hfs_dbl_hdr, cnid), 4}, + {HFS_HDR_SNAME, offsetof(struct hfs_dbl_hdr, short_name), ~0}, + {HFS_HDR_PRODOSI, offsetof(struct hfs_dbl_hdr, prodosi), 8}, + {HFS_HDR_RSRC, HFS_NAT_HDR_LEN, ~0} + }, + { /* order[] */ + (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[0], + (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[1], + (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[2], + (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[3], + (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[4], + (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[5], + (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[6], + (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[7], + (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[8] } }; @@ -124,18 +164,18 @@ const struct hfs_hdr_layout hfs_nat_hdr_layout = { __constant_htonl(HFS_HDR_VERSION_1), /* version */ 5, /* entries */ { /* descr[] */ + {HFS_HDR_FNAME, offsetof(struct hfs_dbl_hdr, real_name), ~0}, + {HFS_HDR_COMNT, offsetof(struct hfs_dbl_hdr, comment), 0}, + {HFS_HDR_OLDI, offsetof(struct hfs_dbl_hdr, create_time), 16}, + {HFS_HDR_FINFO, offsetof(struct hfs_dbl_hdr, finderinfo), 32}, {HFS_HDR_RSRC, HFS_NAT_HDR_LEN, ~0}, - {HFS_HDR_FNAME, offsetof(struct hfs_nat_hdr, real_name), ~0}, - {HFS_HDR_COMNT, offsetof(struct hfs_nat_hdr, comment), 0}, - {HFS_HDR_OLDI, offsetof(struct hfs_nat_hdr, create_time), 16}, - {HFS_HDR_FINFO, offsetof(struct hfs_nat_hdr, finderinfo), 32}, }, { /* order[] */ + (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[0], (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[1], (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[2], (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[3], - (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[4], - (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[0], + (struct hfs_hdr_descr *)&hfs_nat_hdr_layout.descr[4] } }; @@ -187,6 +227,7 @@ static int dlength(const struct hfs_hdr_descr *descr, length = entry->key.CName.Len; break; + case HFS_HDR_SNAME: default: length = 0; } @@ -456,6 +497,8 @@ static hfs_rwret_t hdr_read(struct file * filp, char * buf, case HFS_HDR_DATES: get_dates(entry, inode, (hfs_u32 *)tmp); if (descr->id == HFS_HDR_DATES) { + /* XXX: access date. hfsplus actually + has this. */ memcpy(tmp + 12, tmp + 4, 4); } else if ((entry->type == HFS_CDR_FIL) && (entry->u.file.flags & HFS_FIL_LOCK)) { @@ -472,6 +515,31 @@ static hfs_rwret_t hdr_read(struct file * filp, char * buf, limit = 32; break; + case HFS_HDR_AFPI: + /* XXX: this needs to do more mac->afp mappings */ + hfs_put_ns(0, tmp); + if ((entry->type == HFS_CDR_FIL) && + (entry->u.file.flags & HFS_FIL_LOCK)) { + hfs_put_hs(HFS_AFP_RDONLY, tmp + 2); + } else { + hfs_put_ns(0, tmp + 2); + } + p = tmp; + limit = 4; + break; + + case HFS_HDR_PRODOSI: + /* XXX: this needs to do mac->prodos translations */ + memset(tmp, 0, 8); +#if 0 + hfs_put_ns(0, tmp); /* access */ + hfs_put_ns(0, tmp); /* type */ + hfs_put_nl(0, tmp); /* aux type */ +#endif + p = tmp; + limit = 8; + break; + case HFS_HDR_MACI: hfs_put_ns(0, tmp); if (entry->type == HFS_CDR_FIL) { @@ -483,6 +551,32 @@ static hfs_rwret_t hdr_read(struct file * filp, char * buf, limit = 4; break; + case HFS_HDR_DID: + /* if it's rootinfo, stick the next available did in + * the did slot. */ + limit = 4; + if (entry->cnid == htonl(HFS_ROOT_CNID)) { + struct hfs_mdb *mdb = entry->mdb; + const struct hfs_name *reserved = + HFS_SB(mdb->sys_mdb)->s_reserved2; + + while (reserved->Len) { + if (hfs_streq(reserved->Name, + reserved->Len, + entry->key.CName.Name, + entry->key.CName.Len)) { + hfs_put_hl(mdb->next_id, tmp); + p = tmp; + goto hfs_did_done; + } + reserved++; + } + } + p = (char *) &entry->cnid; +hfs_did_done: + break; + + case HFS_HDR_SNAME: default: limit = 0; } @@ -724,6 +818,30 @@ static hfs_rwret_t hdr_write(struct file *filp, const char *buf, limit = 32; break; + case HFS_HDR_AFPI: + hfs_put_ns(0, tmp); + if ((entry->type == HFS_CDR_FIL) && + (entry->u.file.flags & HFS_FIL_LOCK)) { + hfs_put_hs(HFS_AFP_RDONLY, tmp + 2); + } else { + hfs_put_ns(0, tmp + 2); + } + p = tmp; + limit = 4; + break; + + case HFS_HDR_PRODOSI: + /* XXX: this needs to do mac->prodos translations */ + memset(tmp, 0, 8); +#if 0 + hfs_put_ns(0, tmp); /* access */ + hfs_put_ns(0, tmp); /* type */ + hfs_put_nl(0, tmp); /* aux type */ +#endif + p = tmp; + limit = 8; + break; + case HFS_HDR_MACI: hfs_put_ns(0, tmp); if (entry->type == HFS_CDR_FIL) { @@ -736,6 +854,7 @@ static hfs_rwret_t hdr_write(struct file *filp, const char *buf, break; case HFS_HDR_FNAME: /* Can't rename a file this way */ + case HFS_HDR_DID: /* can't specify a did this way */ default: limit = 0; } @@ -826,6 +945,9 @@ static hfs_rwret_t hdr_write(struct file *filp, const char *buf, break; case HFS_HDR_FNAME: /* Can't rename a file this way */ + case HFS_HDR_DID: /* Can't specify a did this way */ + case HFS_HDR_PRODOSI: /* not implemented yet */ + case HFS_HDR_AFPI: /* ditto */ default: break; } diff --git a/fs/hfs/hfs.h b/fs/hfs/hfs.h index 824e02be5e63..07e61f0de6f6 100644 --- a/fs/hfs/hfs.h +++ b/fs/hfs/hfs.h @@ -80,9 +80,24 @@ #define HFS_FK_RSRC 0xFF /* bits in hfs_fil_entry.Flags */ -#define HFS_FIL_LOCK 0x01 -#define HFS_FIL_THD 0x02 -#define HFS_FIL_USED 0x80 +#define HFS_FIL_LOCK 0x01 /* locked */ +#define HFS_FIL_THD 0x02 /* file thread */ +#define HFS_FIL_DOPEN 0x04 /* data fork open */ +#define HFS_FIL_ROPEN 0x08 /* resource fork open */ +#define HFS_FIL_DIR 0x10 /* directory (always clear) */ +#define HFS_FIL_RSRV1 0x20 /* reserved */ +#define HFS_FIL_NOCOPY 0x40 /* copy-protected file */ +#define HFS_FIL_USED 0x80 /* open */ + +/* bits in hfs_dir_entry.Flags. dirflags is 16 bits. */ +#define HFS_DIR_LOCK 0x01 /* locked */ +#define HFS_DIR_THD 0x02 /* directory thread */ +#define HFS_DIR_INEXPFOLDER 0x04 /* in a shared area */ +#define HFS_DIR_MOUNTED 0x08 /* mounted */ +#define HFS_DIR_DIR 0x10 /* directory (always set) */ +#define HFS_DIR_EXPFOLDER 0x20 /* share point */ +#define HFS_DIR_RSRV1 0x40 /* reserved */ +#define HFS_DIR_RSRV2 0x80 /* reserved */ /* Access types used when requesting access to a B-node */ #define HFS_LOCK_NONE 0x0000 /* Illegal */ diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index d960b3da017a..8fde9117d83d 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c @@ -262,7 +262,7 @@ struct inode *hfs_iget(struct hfs_cat_entry *entry, ino_t type, HFS_I(inode)->entry = entry; HFS_I(inode)->tz_secondswest = hfs_to_utc(0); - hsb->s_ifill(inode, type); + hsb->s_ifill(inode, type, hsb->s_version); if (!hsb->s_afpd && (entry->type == HFS_CDR_FIL) && (entry->u.file.flags & HFS_FIL_LOCK)) { inode->i_mode &= ~S_IWUGO; @@ -289,7 +289,7 @@ struct inode *hfs_iget(struct hfs_cat_entry *entry, ino_t type, * in other filesystems. It is called by __hfs_iget() to fill in * the missing fields of an uninitialized inode under the CAP scheme. */ -void hfs_cap_ifill(struct inode * inode, ino_t type) +void hfs_cap_ifill(struct inode * inode, ino_t type, const int version) { struct hfs_cat_entry *entry = HFS_I(inode)->entry; @@ -337,7 +337,7 @@ void hfs_cap_ifill(struct inode * inode, ino_t type) * the missing fields of an uninitialized inode under the AppleDouble * scheme. */ -void hfs_dbl_ifill(struct inode * inode, ino_t type) +void hfs_dbl_ifill(struct inode * inode, ino_t type, const int version) { struct hfs_cat_entry *entry = HFS_I(inode)->entry; @@ -378,7 +378,7 @@ void hfs_dbl_ifill(struct inode * inode, ino_t type) * the missing fields of an uninitialized inode under the Netatalk * scheme. */ -void hfs_nat_ifill(struct inode * inode, ino_t type) +void hfs_nat_ifill(struct inode * inode, ino_t type, const int version) { struct hfs_cat_entry *entry = HFS_I(inode)->entry; @@ -393,7 +393,8 @@ void hfs_nat_ifill(struct inode * inode, ino_t type) inode->i_nlink = 1; } inode->i_op = &hfs_hdr_inode_operations; - HFS_I(inode)->default_layout = &hfs_nat_hdr_layout; + HFS_I(inode)->default_layout = (version == 2) ? + &hfs_nat2_hdr_layout : &hfs_nat_hdr_layout; } else if (entry->type == HFS_CDR_FIL) { init_file_inode(inode, HFS_FK_DATA); inode->i_op = &hfs_file_inode_operations; diff --git a/fs/hfs/super.c b/fs/hfs/super.c index 6f177f136d93..1a5c1edb4dae 100644 --- a/fs/hfs/super.c +++ b/fs/hfs/super.c @@ -183,6 +183,8 @@ static int parse_options(char *options, struct hfs_sb_info *hsb, int *part) hsb->s_lowercase = 0; hsb->s_quiet = 0; hsb->s_afpd = 0; + /* default version. 0 just selects the defaults */ + hsb->s_version = 0; hsb->s_conv = 'b'; names = '?'; fork = '?'; @@ -197,7 +199,15 @@ static int parse_options(char *options, struct hfs_sb_info *hsb, int *part) *value++ = 0; } /* Numeric-valued options */ - if (!strcmp(this_char,"uid")) { + if (!strcmp(this_char, "version")) { + if (!value || !*value) { + return 0; + } + hsb->s_version = simple_strtoul(value,&value,0); + if (*value) { + return 0; + } + } else if (!strcmp(this_char,"uid")) { if (!value || !*value) { return 0; } diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 3a3261293436..6c1f1558cefc 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -322,7 +322,7 @@ init_module(void) init_MUTEX(&nlmsvc_sema); nlmsvc_users = 0; nlmsvc_pid = 0; - lockd_exit = NULL; + init_waitqueue_head(&lockd_exit); nlmxdr_init(); return 0; } diff --git a/include/asm-arm/arch-ebsa285/irq.h b/include/asm-arm/arch-ebsa285/irq.h index d8f0ab21d8a0..ca1a55cdb4ae 100644 --- a/include/asm-arm/arch-ebsa285/irq.h +++ b/include/asm-arm/arch-ebsa285/irq.h @@ -10,6 +10,7 @@ * 26-Jan-1999 PJB Don't use IACK on CATS * 16-Mar-1999 RMK Added autodetect of ISA PICs */ +#include #include #include #include diff --git a/include/asm-arm/arch-ebsa285/memory.h b/include/asm-arm/arch-ebsa285/memory.h index 745750e3be21..a03cea639672 100644 --- a/include/asm-arm/arch-ebsa285/memory.h +++ b/include/asm-arm/arch-ebsa285/memory.h @@ -15,6 +15,8 @@ #ifndef __ASM_ARCH_MMU_H #define __ASM_ARCH_MMU_H +#include + #if defined(CONFIG_HOST_FOOTBRIDGE) /* diff --git a/include/linux/busmouse.h b/include/linux/busmouse.h index eb71550d3015..ccbf0f8b6acc 100644 --- a/include/linux/busmouse.h +++ b/include/linux/busmouse.h @@ -94,7 +94,7 @@ struct mouse_status { int present; int ready; int active; - struct wait_queue *wait; + wait_queue_head_t wait; struct fasync_struct *fasyncptr; }; diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h index 0f373ff5be09..be558dc96164 100644 --- a/include/linux/cyclades.h +++ b/include/linux/cyclades.h @@ -570,9 +570,9 @@ struct cyclades_port { struct tq_struct tqueue; struct termios normal_termios; struct termios callout_termios; - struct wait_queue *open_wait; - struct wait_queue *close_wait; - struct wait_queue *shutdown_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; + wait_queue_head_t shutdown_wait; struct cyclades_monitor mon; unsigned long jiffies[3]; unsigned long rflush_count; diff --git a/include/linux/epca.h b/include/linux/epca.h index 504948149d0b..18cedf37c3c9 100644 --- a/include/linux/epca.h +++ b/include/linux/epca.h @@ -140,8 +140,8 @@ struct channel struct tty_struct *tty; struct termios normal_termios; struct termios callout_termios; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; struct tq_struct tqueue; volatile struct global_data *mailbox; }; diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h index 2ed3903af20f..7efc5e31dc11 100644 --- a/include/linux/hayesesp.h +++ b/include/linux/hayesesp.h @@ -106,10 +106,10 @@ struct esp_struct { struct tq_struct tqueue_hangup; struct termios normal_termios; struct termios callout_termios; - struct wait_queue *open_wait; - struct wait_queue *close_wait; - struct wait_queue *delta_msr_wait; - struct wait_queue *break_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; + wait_queue_head_t delta_msr_wait; + wait_queue_head_t break_wait; struct async_icount icount; /* kernel counters for the 4 input interrupts */ struct hayes_esp_config config; /* port configuration */ struct esp_struct *next_port; /* For the linked list */ diff --git a/include/linux/hfmodem.h b/include/linux/hfmodem.h index 7b35f1169468..d23108ee9943 100644 --- a/include/linux/hfmodem.h +++ b/include/linux/hfmodem.h @@ -155,7 +155,7 @@ struct hfmodem_state { } clk; int active; - struct wait_queue *wait; + wait_queue_head_t wait; struct { __s16 *kbuf; diff --git a/include/linux/hfs_fs.h b/include/linux/hfs_fs.h index 659c1c6d24da..ef2bc41052cd 100644 --- a/include/linux/hfs_fs.h +++ b/include/linux/hfs_fs.h @@ -82,17 +82,22 @@ #define HFS_SGL_DINF HFS_ITYPE_1 /* %DirInfo for directory */ /* IDs for elements of an AppleDouble or AppleSingle header */ -#define HFS_HDR_DATA 1 -#define HFS_HDR_RSRC 2 -#define HFS_HDR_FNAME 3 -#define HFS_HDR_COMNT 4 -#define HFS_HDR_BWICN 5 -#define HFS_HDR_CICON 6 -#define HFS_HDR_OLDI 7 -#define HFS_HDR_DATES 8 -#define HFS_HDR_FINFO 9 -#define HFS_HDR_MACI 10 -#define HFS_HDR_MAX 10 +#define HFS_HDR_DATA 1 /* data fork */ +#define HFS_HDR_RSRC 2 /* resource fork */ +#define HFS_HDR_FNAME 3 /* full (31-character) name */ +#define HFS_HDR_COMNT 4 /* comment */ +#define HFS_HDR_BWICN 5 /* b/w icon */ +#define HFS_HDR_CICON 6 /* color icon info */ +#define HFS_HDR_OLDI 7 /* old file info */ +#define HFS_HDR_DATES 8 /* file dates info */ +#define HFS_HDR_FINFO 9 /* Finder info */ +#define HFS_HDR_MACI 10 /* Macintosh info */ +#define HFS_HDR_PRODOSI 11 /* ProDOS info */ +#define HFS_HDR_MSDOSI 12 /* MSDOS info */ +#define HFS_HDR_SNAME 13 /* short name */ +#define HFS_HDR_AFPI 14 /* AFP file info */ +#define HFS_HDR_DID 15 /* directory id */ +#define HFS_HDR_MAX 16 /* * There are three time systems. All three are based on seconds since @@ -136,26 +141,7 @@ struct hfs_hdr_layout { }; /* - * Default header layout for Netatalk - */ -struct hfs_nat_hdr { - hfs_lword_t magic; - hfs_lword_t version; - hfs_byte_t homefs[16]; - hfs_word_t entries; - hfs_byte_t descrs[60]; - hfs_byte_t real_name[255]; /* id=3 */ - hfs_byte_t comment[200]; /* id=4 XXX: not yet implemented */ - hfs_lword_t create_time; /* \ */ - hfs_lword_t modify_time; /* | */ - hfs_lword_t backup_time; /* | id=7 */ - hfs_word_t filler; /* | */ - hfs_word_t attr; /* / */ - hfs_byte_t finderinfo[32]; /* id=9 */ -}; - -/* - * Default header layout for AppleDouble + * Default header layout for Netatalk and AppleDouble */ struct hfs_dbl_hdr { hfs_lword_t magic; @@ -163,23 +149,37 @@ struct hfs_dbl_hdr { hfs_byte_t filler[16]; hfs_word_t entries; hfs_byte_t descrs[12*HFS_HDR_MAX]; - hfs_u32 create_time; /* \ */ - hfs_u32 modify_time; /* | id=8 */ - hfs_u32 backup_time; /* | */ - hfs_u32 access_time; /* / */ + hfs_byte_t real_name[255]; /* id=3 */ + hfs_byte_t comment[200]; /* id=4 XXX: not yet implemented */ + hfs_u32 create_time; /* \ */ + hfs_u32 modify_time; /* | id=8 (or 7) */ + hfs_u32 backup_time; /* | */ + hfs_u32 access_time; /* / (attributes with id=7) */ hfs_u8 finderinfo[32]; /* id=9 */ hfs_u32 fileinfo; /* id=10 */ - hfs_u8 real_name[32]; /* id=3 */ - hfs_u8 comment[200]; /* id=4 XXX: not yet implemented */ + hfs_u32 cnid; /* id=15 */ + hfs_u8 short_name[12]; /* id=13 */ + hfs_u8 prodosi[8]; /* id=11 */ }; + /* finder metadata for CAP */ struct hfs_cap_info { hfs_byte_t fi_fndr[32]; /* Finder's info */ - hfs_word_t fi_attr; /* AFP attributes */ -#define HFS_AFP_WRI 0x020 /* Write inhibit bit */ -#define HFS_AFP_RNI 0x080 /* Rename inhibit bit (AFP >= 2.0) */ -#define HFS_AFP_DEI 0x100 /* Delete inhibit bit (AFP >= 2.0) */ + hfs_word_t fi_attr; /* AFP attributes (f=file/d=dir) */ +#define HFS_AFP_INV 0x001 /* Invisible bit (f/d) */ +#define HFS_AFP_EXPFOLDER 0x002 /* exported folder (d) */ +#define HFS_AFP_MULTI 0x002 /* Multiuser bit (f) */ +#define HFS_AFP_SYS 0x004 /* System bit (f/d) */ +#define HFS_AFP_DOPEN 0x008 /* data fork already open (f) */ +#define HFS_AFP_MOUNTED 0x008 /* mounted folder (d) */ +#define HFS_AFP_ROPEN 0x010 /* resource fork already open (f) */ +#define HFS_AFP_INEXPFOLDER 0x010 /* folder in shared area (d) */ +#define HFS_AFP_WRI 0x020 /* Write inhibit bit (readonly) (f) */ +#define HFS_AFP_BACKUP 0x040 /* backup needed bit (f/d) */ +#define HFS_AFP_RNI 0x080 /* Rename inhibit bit (f/d) */ +#define HFS_AFP_DEI 0x100 /* Delete inhibit bit (f/d) */ +#define HFS_AFP_NOCOPY 0x400 /* Copy protect bit (f) */ #define HFS_AFP_RDONLY ( HFS_AFP_WRI|HFS_AFP_RNI|HFS_AFP_DEI) hfs_byte_t fi_magic1; /* Magic number: */ #define HFS_CAP_MAGIC1 0xFF @@ -272,6 +272,7 @@ extern struct inode_operations hfs_hdr_inode_operations; extern const struct hfs_hdr_layout hfs_dbl_fil_hdr_layout; extern const struct hfs_hdr_layout hfs_dbl_dir_hdr_layout; extern const struct hfs_hdr_layout hfs_nat_hdr_layout; +extern const struct hfs_hdr_layout hfs_nat2_hdr_layout; extern const struct hfs_hdr_layout hfs_sngl_hdr_layout; /* inode.c */ @@ -279,10 +280,10 @@ extern void hfs_put_inode(struct inode *); extern int hfs_notify_change(struct dentry *, struct iattr *); extern struct inode *hfs_iget(struct hfs_cat_entry *, ino_t, struct dentry *); -extern void hfs_cap_ifill(struct inode *, ino_t); -extern void hfs_dbl_ifill(struct inode *, ino_t); -extern void hfs_nat_ifill(struct inode *, ino_t); -extern void hfs_sngl_ifill(struct inode *, ino_t); +extern void hfs_cap_ifill(struct inode *, ino_t, const int); +extern void hfs_dbl_ifill(struct inode *, ino_t, const int); +extern void hfs_nat_ifill(struct inode *, ino_t, const int); +extern void hfs_sngl_ifill(struct inode *, ino_t, const int); /* super.c */ extern struct super_block *hfs_read_super(struct super_block *,void *,int); diff --git a/include/linux/hfs_fs_sb.h b/include/linux/hfs_fs_sb.h index c5279b201ad2..826f388c50b7 100644 --- a/include/linux/hfs_fs_sb.h +++ b/include/linux/hfs_fs_sb.h @@ -16,7 +16,7 @@ struct hfs_name; typedef int (*hfs_namein_fn) (char *, const struct hfs_name *); typedef void (*hfs_nameout_fn) (struct hfs_name *, const char *, int); -typedef void (*hfs_ifill_fn) (struct inode *, ino_t); +typedef void (*hfs_ifill_fn) (struct inode *, ino_t, const int); /* * struct hfs_sb_info @@ -30,6 +30,7 @@ struct hfs_sb_info { changing owner or mode? */ int s_lowercase; /* Map names to lowercase? */ int s_afpd; /* AFPD compatible mode? */ + int s_version; /* version info */ hfs_namein_fn s_namein; /* The function used to map Mac filenames to Linux filenames */ diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h index 8a3cbce1b9e0..da449f7e4c6c 100644 --- a/include/linux/if_shaper.h +++ b/include/linux/if_shaper.h @@ -37,7 +37,7 @@ struct shaper int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh); void (*header_cache_update)(struct hh_cache *hh, struct device *dev, unsigned char * haddr); struct net_device_stats* (*get_stats)(struct device *dev); - struct wait_queue *wait_queue; + wait_queue_head_t wait_queue; struct timer_list timer; }; diff --git a/include/linux/isicom.h b/include/linux/isicom.h index 82325a9b8754..7f929b895048 100644 --- a/include/linux/isicom.h +++ b/include/linux/isicom.h @@ -144,8 +144,8 @@ struct isi_port { long pgrp; struct isi_board * card; struct tty_struct * tty; - struct wait_queue * close_wait; - struct wait_queue * open_wait; + wait_queue_head_t close_wait; + wait_queue_head_t open_wait; struct tq_struct hangup_tq; struct tq_struct bh_tqueue; unsigned char * xmit_buf; diff --git a/include/linux/joystick.h b/include/linux/joystick.h index c1794ca29f58..996babd515e2 100644 --- a/include/linux/joystick.h +++ b/include/linux/joystick.h @@ -217,7 +217,7 @@ struct js_dev { struct js_dev *next; struct js_list *list; struct js_port *port; - struct wait_queue *wait; + wait_queue_head_t wait; struct js_data cur; struct js_data new; struct js_corr *corr; diff --git a/include/linux/sched.h b/include/linux/sched.h index a074b91658ad..383fa36f048b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -79,12 +79,6 @@ extern int last_pid; #define TASK_ZOMBIE 4 #define TASK_STOPPED 8 #define TASK_SWAPPING 16 -/* - * 'exclusive' tasks are the ones that expect 'wake-one' behavior - * on __wake_up(). They are special because __wake_up() removes - * them from the waitqueue immediately, this way we have O(1) addition, - * scheduling and removal from waitqueues, no matter how long they are. - */ #define TASK_EXCLUSIVE 32 /* diff --git a/include/linux/wait.h b/include/linux/wait.h index 2831d5e78389..54e30712a79f 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -27,7 +27,7 @@ extern int printk(const char *fmt, ...); } while (0) #define CHECK_MAGIC(x) if (x != (long)&(x)) \ - { printk("bad magic %lx (should be %lx), ", x, (long)&(x)); WQ_BUG(); } + { printk("bad magic %lx (should be %lx), ", (long)x, (long)&(x)); WQ_BUG(); } #define CHECK_MAGIC_WQHEAD(x) do { \ if (x->__magic != (long)&(x->__magic)) { \ diff --git a/include/net/irda/ircomm_common.h b/include/net/irda/ircomm_common.h index cd1c41f86818..d92761c13571 100644 --- a/include/net/irda/ircomm_common.h +++ b/include/net/irda/ircomm_common.h @@ -201,8 +201,8 @@ struct ircomm_cb{ see Irlmp.c or somewhere :p)*/ int peer_cap; /* capability of peer device */ - struct wait_queue *discovery_wait; - struct wait_queue *ias_wait; + wait_queue_head_t discovery_wait; + wait_queue_head_t ias_wait; /* statistics */ int tx_packets; diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h index 35c15fadc272..cb47fce3a018 100644 --- a/include/net/irda/irda.h +++ b/include/net/irda/irda.h @@ -122,7 +122,7 @@ struct irda_sock { int errno; struct sock *sk; - struct wait_queue *ias_wait; /* Wait for LM-IAS answer */ + wait_queue_head_t ias_wait; /* Wait for LM-IAS answer */ LOCAL_FLOW tx_flow; LOCAL_FLOW rx_flow; diff --git a/include/net/irda/irlpt_common.h b/include/net/irda/irlpt_common.h index 83a9c307cc8f..999cdd35fb58 100644 --- a/include/net/irda/irlpt_common.h +++ b/include/net/irda/irlpt_common.h @@ -46,7 +46,7 @@ extern char *irlpt_client_fsm_state[]; extern char *irlpt_server_fsm_state[]; extern char *irlpt_fsm_event[]; -extern struct wait_queue *lpt_wait; +extern wait_queue_head_t lpt_wait; extern struct irlpt_cb *irlpt_find_handle(unsigned int minor); extern void irlpt_flow_control(struct sk_buff *skb); @@ -161,9 +161,9 @@ struct irlpt_cb { int irlap_data_size; /* max frame size we can send */ int pkt_count; /* how many packets are queued up */ - struct wait_queue *read_wait; /* wait queues */ - struct wait_queue *write_wait; - struct wait_queue *ex_wait; + wait_queue_head_t read_wait; /* wait queues */ + wait_queue_head_t write_wait; + wait_queue_head_t ex_wait; /* this is used to remove the printer when it's gone */ struct timer_list lpt_timer; diff --git a/include/net/irda/irmod.h b/include/net/irda/irmod.h index 651e87dbcca0..9612a55720b4 100644 --- a/include/net/irda/irmod.h +++ b/include/net/irda/irmod.h @@ -90,7 +90,7 @@ struct irda_todo { */ struct irda_cb { struct miscdevice dev; - struct wait_queue *wait_queue; + wait_queue_head_t *wait_queue; int in_use; diff --git a/include/net/irda/irvtd.h b/include/net/irda/irvtd.h index 1fc7d6b0f6ad..94ffa3c211e7 100644 --- a/include/net/irda/irvtd.h +++ b/include/net/irda/irvtd.h @@ -64,10 +64,10 @@ struct irvtd_cb { int line; int count; /* open count */ int blocked_open; - struct wait_queue *open_wait; - struct wait_queue *close_wait; - struct wait_queue *delta_msr_wait; - struct wait_queue *tx_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; + wait_queue_head_t delta_msr_wait; + wait_queue_head_t tx_wait; struct timer_list timer; diff --git a/kernel/sched.c b/kernel/sched.c index aa7bc9de2394..846971a8965a 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -888,6 +888,7 @@ void __wake_up(wait_queue_head_t *q, unsigned int mode) #endif tmp = head->next; while (tmp != head) { + unsigned int state; wait_queue_t *curr = list_entry(tmp, wait_queue_t, task_list); tmp = tmp->next; @@ -896,23 +897,15 @@ void __wake_up(wait_queue_head_t *q, unsigned int mode) CHECK_MAGIC(curr->__magic); #endif p = curr->task; - if (p->state & mode) { - if (p->state & TASK_EXCLUSIVE) { - __remove_wait_queue(q, curr); - wq_write_unlock_irqrestore(&q->lock, flags); - - curr->task_list.next = NULL; - curr->__waker = 0; - wake_up_process(p); - goto out; - } + state = p->state; + if (state & mode) { #if WAITQUEUE_DEBUG curr->__waker = (long)__builtin_return_address(0); #endif wake_up_process(p); + if (state & TASK_EXCLUSIVE) + break; } - if (p->state & TASK_EXCLUSIVE) - break; } wq_write_unlock_irqrestore(&q->lock, flags); out: diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 6b8f6250ddae..5c31b63a0275 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1578,9 +1578,20 @@ static struct open_request * wait_for_connect(struct sock * sk, * one process gets woken up, not the 'whole herd'. * Since we do not 'race & poll' for established sockets * anymore, the common case will execute the loop only once. + * + * Or rather, it _would_ execute only once if it wasn't for + * some extraneous wakeups that currently happen. + * + * Subtle issue: "add_wait_queue_exclusive()" will be added + * after any current non-exclusive waiters, and we know that + * it will always _stay_ after any new non-exclusive waiters + * because all non-exclusive waiters are added at the + * beginning of the wait-queue. As such, it's ok to "drop" + * our exclusiveness temporarily when we get woken up without + * having to remove and re-insert us on the wait queue. */ + add_wait_queue_exclusive(sk->sleep, &wait); for (;;) { - add_wait_queue_exclusive(sk->sleep, &wait); current->state = TASK_EXCLUSIVE | TASK_INTERRUPTIBLE; release_sock(sk); schedule(); @@ -1592,18 +1603,7 @@ static struct open_request * wait_for_connect(struct sock * sk, break; } current->state = TASK_RUNNING; -#if WAITQUEUE_DEBUG - /* - * hm, gotta do something about 'mixed mode' waitqueues. Eg. - * if we get a signal above then we are not removed from the - * waitqueue... Maybe wake_up_process() could leave the - * TASK_EXCLUSIVE flag intact if it was a true wake-one? - */ - if (wait.task_list.next) { - printk("<%08x>", wait.__waker); - remove_wait_queue(sk->sleep, &wait); - } -#endif + remove_wait_queue(sk->sleep, &wait); return req; } diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 6dd118024871..7f83c5a81bb5 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -48,7 +48,7 @@ extern int irlap_driver_rcv(struct sk_buff *, struct device *, static struct proto_ops irda_proto_ops; static hashbin_t *cachelog = NULL; -static struct wait_queue *discovery_wait; /* Wait for discovery */ +static DECLARE_WAIT_QUEUE_HEAD(discovery_wait); /* Wait for discovery */ #define IRDA_MAX_HEADER (TTP_HEADER+LMP_HEADER+LAP_HEADER) diff --git a/net/irda/ircomm/irvtd_driver.c b/net/irda/ircomm/irvtd_driver.c index 2df2fdd6015d..9cc8719f81cc 100644 --- a/net/irda/ircomm/irvtd_driver.c +++ b/net/irda/ircomm/irvtd_driver.c @@ -607,7 +607,7 @@ static int irvtd_block_til_ready(struct tty_struct *tty, struct file * filp, struct irvtd_cb *driver) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait,current); int retval = 0; int do_clocal = 0; @@ -1930,6 +1930,10 @@ __initfunc(int irvtd_init(void)) irvtd[i]->line = i; irvtd[i]->closing_wait = 10*HZ ; irvtd[i]->close_delay = 5*HZ/10 ; + init_waitqueue_head(&irvtd[i]->open_wait); + init_waitqueue_head(&irvtd[i]->close_wait); + init_waitqueue_head(&irvtd[i]->tx_wait); + init_waitqueue_head(&irvtd[i]->delta_msr_wait); } /* diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 042b4773a67f..5d3f991d1426 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -45,7 +45,7 @@ static struct sock *nl_table[MAX_LINKS]; static atomic_t nl_table_lock[MAX_LINKS]; -static struct wait_queue *nl_table_wait; +static DECLARE_WAIT_QUEUE_HEAD(nl_table_wait); #ifdef NL_EMULATE_DEV static struct socket *netlink_kernel[MAX_LINKS]; -- 2.39.5