aboutsummaryrefslogtreecommitdiffstats
path: root/fs/isofs
Commit message (Expand)AuthorAge
* Merge branch 'for-2.6.33' of git://linux-nfs.org/~bfields/linuxLinus Torvalds2009-12-16
|\
| * nfs: new subdir Documentation/filesystems/nfsJ. Bruce Fields2009-10-27
* | zisofs: Implement reading of compressed files when PAGE_CACHE_SIZE > compress...Jan Kara2009-12-10
|/
* fs: Make unload_nls() NULL pointer safeThomas Gleixner2009-09-24
* isofs: fix Joliet regressionBartlomiej Zolnierkiewicz2009-07-10
* isofs: cleanup mount option processingJan Kara2009-06-18
* isofs: fix setting of uid and gid to 0Jan Kara2009-06-18
* isofs: let mode and dmode mount options override rock ridge mode settingJan Kara2009-06-18
* NLS: update handling of UnicodeAlan Stern2009-06-16
* push BKL down into ->put_superChristoph Hellwig2009-06-11
* fs/isofs: return f_fsid for statfs(2)Coly Li2009-04-02
* constify dentry_operations: misc filesystemsAl Viro2009-03-27
* fs/Kconfig: move iso9660, udf outAlexey Dobriyan2009-01-22
* isofs check for NULL ->i_op in root directory is dead codeAl Viro2009-01-05
* [PATCH] switch all filesystems over to d_obtain_aliasChristoph Hellwig2008-10-23
* vfs: Use const for kernel parser tableSteven Whitehouse2008-10-13
* SL*B: drop kmem cache argument from constructorAlexey Dobriyan2008-07-26
* isofs: fix minor filesystem corruptionAdam Greenblatt2008-07-25
* isofs: fix access to unallocated memory when reading corrupted filesystemJan Kara2008-04-30
* isofs: use get/put_unaligned_* helpersHarvey Harrison2008-04-29
* zisofs: fix readpage() outside i_sizeDave Young2008-03-19
* mount options: fix isofsMiklos Szeredi2008-02-08
* isofs: implement dmode optionJan Kara2008-02-08
* iget: stop ISOFS from using read_inode()David Howells2008-02-07
* exportfs: make struct export_operations constChristoph Hellwig2007-10-22
* isofs: new export opsChristoph Hellwig2007-10-22
* Convert files to UTF-8 and some cleanupsJan Engelhardt2007-10-19
* fs/isofs/namei.c: Remove uninitialized local vars warningBorislav Petkov2007-10-17
* zisofs use mutex instead of semaphoreDave Young2007-10-17
* Slab API: remove useless ctor parameter and reorder parametersChristoph Lameter2007-10-17
* isofs: mounting to regular file may succeedKirill Kuvaldin2007-07-31
* mm: Remove slab destructors from kmem_cache_create().Paul Mundt2007-07-19
* knfsd: exportfs: add exportfs.h headerChristoph Hellwig2007-07-17
* remove useless tolower in isofsyoung dave2007-07-16
* isofs: fix up CodingStyleDave Jones2007-07-16
* Remove SLAB_CTOR_CONSTRUCTORChristoph Lameter2007-05-17
* slab allocators: Remove SLAB_DEBUG_INITIAL flagChristoph Lameter2007-05-07
* [PATCH] Mark struct super_operations constJosef 'Jeff' Sipek2007-02-12
* [PATCH] mark struct inode_operations const 2Arjan van de Ven2007-02-12
* [PATCH] isofs: change uses of f_{dentry, vfsmnt} to use f_pathJosef "Jeff" Sipek2006-12-08
* [PATCH] slab: remove kmem_cache_tChristoph Lameter2006-12-07
* [PATCH] slab: remove SLAB_KERNELChristoph Lameter2006-12-07
* [PATCH] isofs endianness annotationsAl Viro2006-10-10
* Remove all inclusions of <linux/config.h>Dave Jones2006-10-04
* [PATCH] I/O Error attempting to read last partial block of a file in an ISO96...Joel & Rebecca VanderZee2006-09-29
* [PATCH] inode-diet: Eliminate i_blksize from the inode structureTheodore Ts'o2006-09-27
* [PATCH] Really ignore kmem_cache_destroy return valueAlexey Dobriyan2006-09-27
* [PATCH] fs: Conversions from kmalloc+memset to k(z|c)allocPanagiotis Issaris2006-09-27
* Remove obsolete #include <linux/config.h>Jörn Engel2006-06-30
* [PATCH] mark address_space_operations constChristoph Hellwig2006-06-28
>if (SPACE_AVAIL(midi_in_buf[dev])) { QUEUE_BYTE(midi_in_buf[dev], data); wake_up(&input_sleeper[dev]); } } static void midi_output_intr(int dev) { /* * Currently NOP */ } static void midi_poll(unsigned long dummy) { unsigned long flags; int dev; spin_lock_irqsave(&lock, flags); if (open_devs) { for (dev = 0; dev < num_midis; dev++) if (midi_devs[dev] != NULL && midi_out_buf[dev] != NULL) { while (DATA_AVAIL(midi_out_buf[dev])) { int ok; int c = midi_out_buf[dev]->queue[midi_out_buf[dev]->head]; spin_unlock_irqrestore(&lock,flags);/* Give some time to others */ ok = midi_devs[dev]->outputc(dev, c); spin_lock_irqsave(&lock, flags); if (!ok) break; midi_out_buf[dev]->head = (midi_out_buf[dev]->head + 1) % MAX_QUEUE_SIZE; midi_out_buf[dev]->len--; } if (DATA_AVAIL(midi_out_buf[dev]) < 100) wake_up(&midi_sleeper[dev]); } poll_timer.expires = (1) + jiffies; add_timer(&poll_timer); /* * Come back later */ } spin_unlock_irqrestore(&lock, flags); } int MIDIbuf_open(int dev, struct file *file) { int mode, err; dev = dev >> 4; mode = translate_mode(file); if (num_midis > MAX_MIDI_DEV) { printk(KERN_ERR "midi: Too many midi interfaces\n"); num_midis = MAX_MIDI_DEV; } if (dev < 0 || dev >= num_midis || midi_devs[dev] == NULL) return -ENXIO; /* * Interrupts disabled. Be careful */ module_put(midi_devs[dev]->owner); if ((err = midi_devs[dev]->open(dev, mode, midi_input_intr, midi_output_intr)) < 0) return err; parms[dev].prech_timeout = MAX_SCHEDULE_TIMEOUT; midi_in_buf[dev] = vmalloc(sizeof(struct midi_buf)); if (midi_in_buf[dev] == NULL) { printk(KERN_WARNING "midi: Can't allocate buffer\n"); midi_devs[dev]->close(dev); return -EIO; } midi_in_buf[dev]->len = midi_in_buf[dev]->head = midi_in_buf[dev]->tail = 0; midi_out_buf[dev] = vmalloc(sizeof(struct midi_buf)); if (midi_out_buf[dev] == NULL) { printk(KERN_WARNING "midi: Can't allocate buffer\n"); midi_devs[dev]->close(dev); vfree(midi_in_buf[dev]); midi_in_buf[dev] = NULL; return -EIO; } midi_out_buf[dev]->len = midi_out_buf[dev]->head = midi_out_buf[dev]->tail = 0; open_devs++; init_waitqueue_head(&midi_sleeper[dev]); init_waitqueue_head(&input_sleeper[dev]); if (open_devs < 2) /* This was first open */ { poll_timer.expires = 1 + jiffies; add_timer(&poll_timer); /* Start polling */ } return err; } void MIDIbuf_release(int dev, struct file *file) { int mode; dev = dev >> 4; mode = translate_mode(file); if (dev < 0 || dev >= num_midis || midi_devs[dev] == NULL) return; /* * Wait until the queue is empty */ if (mode != OPEN_READ) { midi_devs[dev]->outputc(dev, 0xfe); /* * Active sensing to shut the * devices */ while (!signal_pending(current) && DATA_AVAIL(midi_out_buf[dev])) interruptible_sleep_on(&midi_sleeper[dev]); /* * Sync */ drain_midi_queue(dev); /* * Ensure the output queues are empty */ } midi_devs[dev]->close(dev); open_devs--; if (open_devs == 0) del_timer_sync(&poll_timer); vfree(midi_in_buf[dev]); vfree(midi_out_buf[dev]); midi_in_buf[dev] = NULL; midi_out_buf[dev] = NULL; module_put(midi_devs[dev]->owner); } int MIDIbuf_write(int dev, struct file *file, const char __user *buf, int count) { int c, n, i; unsigned char tmp_data; dev = dev >> 4; if (!count) return 0; c = 0; while (c < count) { n = SPACE_AVAIL(midi_out_buf[dev]); if (n == 0) { /* * No space just now. */ if (file->f_flags & O_NONBLOCK) { c = -EAGAIN; goto out; } interruptible_sleep_on(&midi_sleeper[dev]); if (signal_pending(current)) { c = -EINTR; goto out; } n = SPACE_AVAIL(midi_out_buf[dev]); } if (n > (count - c)) n = count - c; for (i = 0; i < n; i++) { /* BROKE BROKE BROKE - CANT DO THIS WITH CLI !! */ /* yes, think the same, so I removed the cli() brackets QUEUE_BYTE is protected against interrupts */ if (copy_from_user((char *) &tmp_data, &(buf)[c], 1)) { c = -EFAULT; goto out; } QUEUE_BYTE(midi_out_buf[dev], tmp_data); c++; } } out: return c; } int MIDIbuf_read(int dev, struct file *file, char __user *buf, int count) { int n, c = 0; unsigned char tmp_data; dev = dev >> 4; if (!DATA_AVAIL(midi_in_buf[dev])) { /* * No data yet, wait */ if (file->f_flags & O_NONBLOCK) { c = -EAGAIN; goto out; } interruptible_sleep_on_timeout(&input_sleeper[dev], parms[dev].prech_timeout); if (signal_pending(current)) c = -EINTR; /* The user is getting restless */ } if (c == 0 && DATA_AVAIL(midi_in_buf[dev])) /* * Got some bytes */ { n = DATA_AVAIL(midi_in_buf[dev]); if (n > count) n = count; c = 0; while (c < n) { char *fixit; REMOVE_BYTE(midi_in_buf[dev], tmp_data); fixit = (char *) &tmp_data; /* BROKE BROKE BROKE */ /* yes removed the cli() brackets again should q->len,tail&head be atomic_t? */ if (copy_to_user(&(buf)[c], fixit, 1)) { c = -EFAULT; goto out; } c++; } } out: return c; } int MIDIbuf_ioctl(int dev, struct file *file, unsigned int cmd, void __user *arg) { int val; dev = dev >> 4; if (((cmd >> 8) & 0xff) == 'C') { if (midi_devs[dev]->coproc) /* Coprocessor ioctl */ return midi_devs[dev]->coproc->ioctl(midi_devs[dev]->coproc->devc, cmd, arg, 0); /* printk("/dev/midi%d: No coprocessor for this device\n", dev);*/ return -ENXIO; } else { switch (cmd) { case SNDCTL_MIDI_PRETIME: if (get_user(val, (int __user *)arg)) return -EFAULT; if (val < 0) val = 0; val = (HZ * val) / 10; parms[dev].prech_timeout = val; return put_user(val, (int __user *)arg); default: if (!midi_devs[dev]->ioctl) return -EINVAL; return midi_devs[dev]->ioctl(dev, cmd, arg); } } } /* No kernel lock - fine */ unsigned int MIDIbuf_poll(int dev, struct file *file, poll_table * wait) { unsigned int mask = 0; dev = dev >> 4; /* input */ poll_wait(file, &input_sleeper[dev], wait); if (DATA_AVAIL(midi_in_buf[dev])) mask |= POLLIN | POLLRDNORM; /* output */ poll_wait(file, &midi_sleeper[dev], wait); if (!SPACE_AVAIL(midi_out_buf[dev])) mask |= POLLOUT | POLLWRNORM; return mask; } int MIDIbuf_avail(int dev) { if (midi_in_buf[dev]) return DATA_AVAIL (midi_in_buf[dev]); return 0; } EXPORT_SYMBOL(MIDIbuf_avail);