]> git.neil.brown.name Git - history.git/commitdiff
Import 2.3.43pre6 2.3.43pre6
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:30:49 +0000 (15:30 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:30:49 +0000 (15:30 -0500)
184 files changed:
Documentation/usb/ov511.txt
Makefile
arch/i386/kernel/mtrr.c
arch/m68k/atari/joystick.c
arch/m68k/bvme6000/rtc.c
arch/m68k/mac/adb-bus.c
arch/m68k/mvme16x/rtc.c
arch/ppc/kernel/ppc_htab.c
arch/sparc64/solaris/socksys.c
drivers/atm/iphase.c
drivers/block/acsi_slm.c
drivers/block/ide-tape.c
drivers/block/paride/pg.c
drivers/block/paride/pt.c
drivers/block/rd.c
drivers/char/acquirewdt.c
drivers/char/agp/agpgart_fe.c
drivers/char/applicom.c
drivers/char/busmouse.c
drivers/char/dsp56k.c
drivers/char/dtlk.c
drivers/char/ftape/zftape/zftape-init.c
drivers/char/ip2main.c
drivers/char/isicom.c
drivers/char/istallion.c
drivers/char/lp.c
drivers/char/mem.c
drivers/char/misc.c
drivers/char/mixcomwd.c
drivers/char/msp3400.c
drivers/char/nvram.c
drivers/char/pc110pad.c
drivers/char/pc_keyb.c
drivers/char/pcwd.c
drivers/char/ppdev.c
drivers/char/qpmouse.c
drivers/char/random.c
drivers/char/raw.c
drivers/char/softdog.c
drivers/char/stallion.c
drivers/char/sx.c
drivers/char/tpqic02.c
drivers/char/tty_io.c
drivers/char/vc_screen.c
drivers/char/videodev.c
drivers/char/wdt.c
drivers/i2c/i2c-core.c
drivers/i2c/i2c-dev.c
drivers/i2o/i2o_config.c
drivers/ieee1394/pcilynx.c
drivers/isdn/avmb1/capi.c
drivers/isdn/divert/divert_procfs.c
drivers/isdn/isdn_common.c
drivers/macintosh/adb.c
drivers/macintosh/nvram.c
drivers/macintosh/via-pmu.c
drivers/net/eepro100.c
drivers/net/ppp_generic.c
drivers/net/wan/cosa.c
drivers/pcmcia/ds.c
drivers/pnp/isapnp_proc.c
drivers/sbus/audio/audio.c
drivers/sbus/char/bpp.c
drivers/sbus/char/envctrl.c
drivers/sbus/char/flash.c
drivers/sbus/char/jsflash.c
drivers/sbus/char/openprom.c
drivers/sbus/char/pcikbd.c
drivers/sbus/char/rtc.c
drivers/sbus/char/sunkbd.c
drivers/sbus/char/sunmouse.c
drivers/sbus/char/uctrl.c
drivers/sbus/char/vfc_dev.c
drivers/scsi/sg.c
drivers/scsi/st.c
drivers/sgi/char/ds1286.c
drivers/sgi/char/graphics.c
drivers/sgi/char/shmiq.c
drivers/sgi/char/streamable.c
drivers/sgi/char/usema.c
drivers/sound/cmpci.c
drivers/sound/dmasound.c
drivers/sound/es1370.c
drivers/sound/es1371.c
drivers/sound/esssolo1.c
drivers/sound/maestro.c
drivers/sound/msnd_pinnacle.c
drivers/sound/sonicvibes.c
drivers/sound/soundcard.c
drivers/sound/trident.c
drivers/sound/vwsnd.c
drivers/sound/wavfront.c
drivers/telephony/ixj.c
drivers/telephony/phonedev.c
drivers/usb/acm.c
drivers/usb/audio.c
drivers/usb/dabusb.c
drivers/usb/devices.c
drivers/usb/devio.c
drivers/usb/drivers.c
drivers/usb/inode.c
drivers/usb/ov511.c
drivers/usb/ov511.h
drivers/usb/printer.c
drivers/usb/scanner.c
drivers/usb/usb.c
drivers/video/fbmem.c
drivers/zorro/proc.c
fs/adfs/dir.c
fs/adfs/file.c
fs/affs/dir.c
fs/affs/file.c
fs/autofs/dir.c
fs/autofs/root.c
fs/bad_inode.c
fs/bfs/dir.c
fs/bfs/file.c
fs/buffer.c
fs/coda/dir.c
fs/coda/file.c
fs/coda/pioctl.c
fs/coda/psdev.c
fs/cramfs/inode.c
fs/devices.c
fs/devpts/root.c
fs/efs/dir.c
fs/efs/file.c
fs/ext2/dir.c
fs/ext2/file.c
fs/ext2/fsync.c
fs/fat/dir.c
fs/fat/file.c
fs/fifo.c
fs/hfs/dir_cap.c
fs/hfs/dir_dbl.c
fs/hfs/dir_nat.c
fs/hfs/file.c
fs/hfs/file_cap.c
fs/hfs/file_hdr.c
fs/hpfs/inode.c
fs/isofs/dir.c
fs/isofs/file.c
fs/minix/dir.c
fs/minix/file.c
fs/minix/fsync.c
fs/ncpfs/dir.c
fs/ncpfs/file.c
fs/nfs/dir.c
fs/nfs/file.c
fs/ntfs/fs.c
fs/openpromfs/inode.c
fs/pipe.c
fs/proc/base.c
fs/proc/generic.c
fs/proc/kcore.c
fs/proc/kmsg.c
fs/proc/proc_misc.c
fs/proc/root.c
fs/qnx4/fsync.c
fs/romfs/inode.c
fs/smbfs/dir.c
fs/smbfs/file.c
fs/sysv/dir.c
fs/sysv/file.c
fs/sysv/fsync.c
fs/udf/dir.c
fs/udf/file.c
fs/udf/fsync.c
fs/ufs/dir.c
fs/ufs/file.c
fs/umsdos/dir.c
fs/umsdos/rdir.c
include/asm-i386/page.h
include/asm-i386/pgtable.h
include/linux/atmdev.h
include/linux/raid/md.h
kernel/panic.c
kernel/sysctl.c
net/atm/mpoa_proc.c
net/atm/proc.c
net/irda/irmod.c
net/netlink/netlink_dev.c
net/socket.c
net/wanrouter/wanproc.c

index fe84f11df461af16fb454c9deba7a77e3b269ec7..c13fc4c5227e3390199edde196986bec882f87fc 100644 (file)
@@ -15,12 +15,13 @@ SUPPORTED CAMERAS:
 ________________________________________________________
 Manufacturer     | Model          | Custom ID | Status
 -----------------+----------------+-----------+---------
-MediaForte       | MV300          | 0         | Untested
+MediaForte       | MV300          | 0         | Working
 D-Link           | DSB-C300       | 3         | Working
+Puretek          | PT-6007        | 5         | Untested
 Creative Labs    | WebCam 3       | 21        | Working
 Lifeview         | RoboCam        | 100       | Untested
 AverMedia        | InterCam Elite | 102       | Working
-MediaForte       | MV300          | 112       | Untested
+MediaForte       | MV300          | 112       | Working
 --------------------------------------------------------
 
 Any camera using the OV511 and the OV7610 CCD should work with this driver. The
@@ -78,7 +79,9 @@ directory:
        make
        make install
 
-Now you should be able to run xawtv. Right click for the options dialog.
+Now you should be able to run xawtv. Right click for the options dialog. If
+you get a scrambled image it is likely that you made a mistake in Xawtv.ad.
+Try setting the size to 320x240 if all else fails.
 
 WORKING FEATURES:
  o Color streaming/capture at 640x480 and 320x240
index 7fbd8969e67a2fceec7a3ce0f4a4eb36eb423e17..02cd723517e778f4a753d57153adc143187bfb2d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 3
-SUBLEVEL = 42
+SUBLEVEL = 43
 EXTRAVERSION =
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
index 0061bc14d767dfbe7353878016c06db6f68d517e..5caa4e477072b53c550d380ceb3d6241fa737615 100644 (file)
@@ -1469,19 +1469,10 @@ static int mtrr_close (struct inode *ino, struct file *file)
 
 static struct file_operations mtrr_fops =
 {
-    NULL,        /*  Seek              */
-    mtrr_read,   /*  Read              */
-    mtrr_write,  /*  Write             */
-    NULL,        /*  Readdir           */
-    NULL,        /*  Poll              */
-    mtrr_ioctl,  /*  IOctl             */
-    NULL,        /*  MMAP              */
-    NULL,       /*  Open              */
-    NULL,        /*  Flush             */
-    mtrr_close,  /*  Release           */
-    NULL,        /*  Fsync             */
-    NULL,        /*  Fasync            */
-    NULL,        /*  Lock              */
+        read:          mtrr_read,
+        write:         mtrr_write,
+        ioctl:         mtrr_ioctl,
+        release:       mtrr_close,
 };
 
 static struct inode_operations proc_mtrr_inode_operations = {
index f8d965498c978320183f8c99cab0267d3e6960c2..bf82e67eadf48fcd16e754786130e2a685f38fda 100644 (file)
@@ -118,16 +118,11 @@ static unsigned int joystick_poll(struct file *file, poll_table *wait)
 }
 
 struct file_operations atari_joystick_fops = {
-       NULL,           /* joystick_seek */
-       read_joystick,
-       write_joystick,
-       NULL,           /* joystick_readdir */
-       joystick_poll,
-       NULL,           /* joystick_ioctl */
-       NULL,           /* joystick_mmap */
-       open_joystick,
-       NULL,           /* flush */
-       release_joystick
+       read:           read_joystick,
+       write:          write_joystick,
+       poll:           joystick_poll,
+       open:           open_joystick,
+       release:        release_joystick,
 };
 
 int __init atari_joystick_init(void)
index 282a2871d0dcb013ffc9434af4fb533bdaa33720..4a244f851e794a1de236e5b264da81464cbd98f0 100644 (file)
@@ -158,16 +158,9 @@ static int rtc_release(struct inode *inode, struct file *file)
  */
 
 static struct file_operations rtc_fops = {
-       NULL,
-       NULL,
-       NULL,           /* No write */
-       NULL,           /* No readdir */
-       NULL,
-       rtc_ioctl,
-       NULL,           /* No mmap */
-       rtc_open,
-       NULL,           /* flush */
-       rtc_release
+       ioctl:          rtc_ioctl,
+       open:           rtc_open,
+       release:        rtc_release,
 };
 
 static struct miscdevice rtc_dev=
index 850e9cb6f90c4deccc1bd90b81b2bc7bb6dd79e1..23e98c0485fbecf5fa970a6b5c9808b6741da4ab 100644 (file)
@@ -2498,16 +2498,11 @@ static int adb_write(struct inode *inode, struct file *file,
 }
 
 static struct file_operations adb_fops = {
-       adb_lseek,
-       adb_read,
-       adb_write,
-       NULL,           /* no readdir */
-       NULL,           /* no poll yet */
-       NULL,           /* no ioctl yet */
-       NULL,           /* no mmap */
-       adb_open,
-       NULL,           /* flush */
-       adb_release
+       llseek:         adb_lseek,
+       read:           adb_read,
+       write:          adb_write,
+       open:           adb_open,
+       release:        adb_release,
 };
 
 int adbdev_register(int subtype, struct file_operations *fops)
@@ -2683,16 +2678,11 @@ static int adb_write(struct inode *inode, struct file *file,
 }
 
 static struct file_operations adb_fops = {
-       adb_lseek,
-       adb_read,
-       adb_write,
-       NULL,           /* no readdir */
-       NULL,           /* no select */
-       NULL,           /* no ioctl */
-       NULL,           /* no mmap */
-       adb_open,
-       NULL,           /* flush */
-       adb_release
+       llseek:         adb_lseek,
+       read:           adb_read,
+       write:          adb_write,
+       open:           adb_open,
+       release:        adb_release,
 };
 
 static struct miscdevice adb_dev = {
index f5f4721323fd3f43890b697cd01136f183544b0c..a47e4c634b42cf2370d7552b6d1fb6da51463ca5 100644 (file)
@@ -147,16 +147,9 @@ static int rtc_release(struct inode *inode, struct file *file)
  */
 
 static struct file_operations rtc_fops = {
-       NULL,
-       NULL,
-       NULL,           /* No write */
-       NULL,           /* No readdir */
-       NULL,
-       rtc_ioctl,
-       NULL,           /* No mmap */
-       rtc_open,
-       NULL,           /* flush */
-       rtc_release
+       ioctl:          rtc_ioctl,
+       open:           rtc_open,
+       release:        rtc_release,
 };
 
 static struct miscdevice rtc_dev=
index b90fa7a2c63151af8ee1c7168df645174cb3dd63..41bef4c2681915dd1f1ecc054c93fb2a0480c158 100644 (file)
@@ -45,17 +45,9 @@ extern unsigned long pte_misses;
 extern unsigned long pte_errors;
 
 static struct file_operations ppc_htab_operations = {
-    ppc_htab_lseek,    /* lseek   */
-    ppc_htab_read,     /* read    */
-    ppc_htab_write,    /* write   */
-    NULL,              /* readdir */
-    NULL,              /* poll    */
-    NULL,              /* ioctl   */
-    NULL,              /* mmap    */
-    NULL,              /* no special open code    */
-    NULL,              /* flush */
-    NULL,              /* no special release code */
-    NULL               /* can't fsync */
+       llseek:         ppc_htab_lseek,
+       read:           ppc_htab_read,
+       write:          ppc_htab_write,
 };
 
 /*
index 5eef5c208015ae36f506437f258cc04a377c9b8a..99067a359d48f2987169716f048e5927c9256cd1 100644 (file)
@@ -48,16 +48,7 @@ extern void mykfree(void *);
 static unsigned int (*sock_poll)(struct file *, poll_table *);
 
 static struct file_operations socksys_file_ops = {
-       NULL,           /* lseek */
-       NULL,           /* read */
-       NULL,           /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       NULL,           /* open */
-       NULL,           /* flush */
-       NULL,           /* release */
+       /* Currently empty */
 };
 
 static int socksys_open(struct inode * inode, struct file * filp)
@@ -162,16 +153,8 @@ static unsigned int socksys_poll(struct file * filp, poll_table * wait)
 }
        
 static struct file_operations socksys_fops = {
-       NULL,           /* lseek */
-       NULL,           /* read */
-       NULL,           /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       socksys_open,   /* open */
-       NULL,           /* flush */
-       socksys_release,/* release */
+       open:           socksys_open,
+       release:        socksys_release,
 };
 
 int __init
index c6719e2e58bc5a4a73890334f1036c20d6956dd2..5208fd62d5ebc155938ea7a9801984c122da252d 100644 (file)
@@ -64,7 +64,6 @@
 #include <asm/byteorder.h>  
 #include <math.h>  
 #include <linux/vmalloc.h>  
-#include <linux/time.h>
 #include "iphase.h"              
 #include "suni.h"                
 #define swap(x) (((x & 0xff) << 8) | ((x & 0xff00) >> 8))  
index d718075e26216147bd2afed3812db36e937b3fcc..e4d343be31a66f930fafe4c767aad88bf8424673 100644 (file)
@@ -271,17 +271,11 @@ static int slm_get_pagesize( int device, int *w, int *h );
 static struct timer_list slm_timer = { NULL, NULL, 0, 0, slm_test_ready };
 
 static struct file_operations slm_fops = {
-       NULL,                   /* lseek - default */
-       slm_read,               /* read - status reading */
-       slm_write,              /* write - printing data write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* poll */
-       slm_ioctl,              /* ioctl */
-       NULL,                   /* mmap */
-       slm_open,               /* open */
-       NULL,                   /* flush */
-       slm_release,            /* release */
-       NULL                    /* fsync */
+       read:           slm_read,
+       write:          slm_write,
+       ioctl:          slm_ioctl,
+       open:           slm_open,
+       release:        slm_release,
 };
 
 
index cba18bced335b3634e2fda3ce986387e3e0ef589..4825ae22f6c4f142432b02201da38b2f552d7b8e 100644 (file)
@@ -5839,18 +5839,11 @@ static ide_module_t idetape_module = {
  *     Our character device supporting functions, passed to register_chrdev.
  */
 static struct file_operations idetape_fops = {
-       NULL,                   /* lseek - default */
-       idetape_chrdev_read,    /* read  */
-       idetape_chrdev_write,   /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* poll */
-       idetape_chrdev_ioctl,   /* ioctl */
-       NULL,                   /* mmap */
-       idetape_chrdev_open,    /* open */
-       NULL,                   /* flush */
-       idetape_chrdev_release, /* release */
-       NULL,                   /* fsync */
-       NULL,                   /* fasync */
+       read:           idetape_chrdev_read,
+       write:          idetape_chrdev_write,
+       ioctl:          idetape_chrdev_ioctl,
+       open:           idetape_chrdev_open,
+       release:        idetape_chrdev_release,
 };
 
 /*
index 4a09f71c4d7651a30885f741c1be95e87e2eb375..434fac0296f4a849dd0eb00736d1e0f50e8110b7 100644 (file)
@@ -260,18 +260,10 @@ static char pg_scratch[512];            /* scratch block buffer */
 /* kernel glue structures */
 
 static struct file_operations pg_fops = {
-       NULL,                   /* lseek - default */
-       pg_read,                /* read */
-       pg_write,               /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* select */
-       NULL,                   /* ioctl */
-       NULL,                   /* mmap */
-       pg_open,                /* open */
-       NULL,                   /* flush */
-       pg_release,             /* release */
-       NULL,                   /* fsync */
-       NULL,                   /* fasync */
+       read:           pg_read,
+       write:          pg_write,
+       open:           pg_open,
+       release:        pg_release,
 };
 
 void pg_init_units( void )
index b1851e999f3876aacb2776cdf80897b263b9b1a8..ba24c99561895daa7df7499713359c3b1a3d6cff 100644 (file)
@@ -262,18 +262,11 @@ static char pt_scratch[512];            /* scratch block buffer */
 /* kernel glue structures */
 
 static struct file_operations pt_fops = {
-        NULL,                   /* lseek - default */
-        pt_read,                /* read */
-        pt_write,               /* write */
-        NULL,                   /* readdir - bad */
-        NULL,                   /* select */
-        pt_ioctl,               /* ioctl */
-        NULL,                   /* mmap */
-        pt_open,                /* open */
-       NULL,                   /* flush */
-        pt_release,             /* release */
-        NULL,                   /* fsync */
-        NULL,                   /* fasync */
+       read:           pt_read,
+       write:          pt_write,
+       ioctl:          pt_ioctl,
+       open:           pt_open,
+       release:        pt_release,
 };
 
 void pt_init_units( void )
index f3803b4b3eb8b5afe49289f619276b6a339797a2..46bda510064bc178aae8d351fc4c000ed4be1396 100644 (file)
@@ -338,17 +338,8 @@ static int initrd_release(struct inode *inode,struct file *file)
 
 
 static struct file_operations initrd_fops = {
-       NULL,           /* lseek */
-       initrd_read,    /* read */
-       NULL,           /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       NULL,           /* open */
-       NULL,           /* flush */
-       initrd_release, /* release */
-       NULL            /* fsync */ 
+       read:           initrd_read,
+       release:        initrd_release,
 };
 
 #endif
index cfc1fdadd33ac748627c649f2e1d4ae458067bae..2a8da596071b3f89f30d6c9e079e375d79c43fcc 100644 (file)
@@ -166,16 +166,11 @@ static int acq_notify_sys(struct notifier_block *this, unsigned long code,
  
  
 static struct file_operations acq_fops = {
-       NULL,
-       acq_read,
-       acq_write,
-       NULL,           /* No Readdir */
-       NULL,           /* No Select */
-       acq_ioctl,
-       NULL,           /* No mmap */
-       acq_open,
-       NULL,           /* flush */
-       acq_close
+       read:           acq_read,
+       write:          acq_write,
+       ioctl:          acq_ioctl,
+       open:           acq_open,
+       release:        acq_close,
 };
 
 static struct miscdevice acq_miscdev=
index ef915259edcc6c1c235fa7d4aac9327795e7da43..8edcbf66904efe29f007d8a40e41759dfbe2553f 100644 (file)
@@ -1062,16 +1062,13 @@ static int agp_ioctl(struct inode *inode, struct file *file,
 
 static struct file_operations agp_fops =
 {
-       agp_lseek,
-       agp_read,
-       agp_write,
-       NULL,
-       NULL,
-       agp_ioctl,
-       agp_mmap,
-       agp_open,
-       NULL,
-       agp_release
+       llseek:         agp_lseek,
+       read:           agp_read,
+       write:          agp_write,
+       ioctl:          agp_ioctl,
+       mmap:           agp_mmap,
+       open:           agp_open,
+       release:        agp_release,
 };
 
 static struct miscdevice agp_miscdev =
index c311e58cda480aea425eeb009f164c296e8da66d..f6304943ac1dd9dc8a11f02b76698ed7252992f2 100644 (file)
@@ -98,17 +98,12 @@ static int ac_release(struct inode *inode, struct file *file);
 static void ac_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 
 struct file_operations ac_fops={
-       ac_llseek,      /* llseek */
-       ac_read,        /* read */
-       ac_write,       /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-               ac_ioctl,       /* ioctl */
-               NULL,           /* mmap */
-       ac_open,        /* open */
-       NULL,           /* flush */
-       ac_release,     /* release */
-       NULL            /* fsync */
+       llseek:         ac_llseek,
+       read:           ac_read,
+       write:          ac_write,
+       ioctl:          ac_ioctl,
+       open:           ac_open,
+       release:        ac_release,
 };
 
 struct miscdevice ac_miscdev={
index 3ce68c5444ea3aa515ec37af284a2d4ff9fed784..03ff3a033d752e0391f0b7fa87704b2f352da548 100644 (file)
@@ -343,18 +343,12 @@ busmouse_poll(struct file *file, poll_table *wait)
 
 struct file_operations busmouse_fops=
 {
-       NULL,                   /* busmouse_seek */
-       busmouse_read,
-       busmouse_write,
-       NULL,                   /* busmouse_readdir */
-       busmouse_poll,
-       NULL,                   /* busmouse_ioctl */
-       NULL,                   /* busmouse_mmap */
-       busmouse_open,
-       NULL,                   /* busmouse_flush */
-       busmouse_release,
-       NULL,
-       busmouse_fasync,
+       read:           busmouse_read,
+       write:          busmouse_write,
+       poll:           busmouse_poll,
+       open:           busmouse_open,
+       release:        busmouse_release,
+       fasync:         busmouse_fasync,
 };
 
 int
index ea44e568dbc8ab2fad5e7dcbf9c5c260d5541257..ff41c0fdd29a16fd9399f9dfe1602a7139d4e1e7 100644 (file)
@@ -501,18 +501,11 @@ static int dsp56k_release(struct inode *inode, struct file *file)
 }
 
 static struct file_operations dsp56k_fops = {
-       NULL,    /* no special dsp56k_lseek */
-       dsp56k_read,
-       dsp56k_write,
-       NULL,    /* no special dsp56k_readdir */
-       NULL,    /* dsp56k_poll? */
-       dsp56k_ioctl,
-       NULL,    /* no special dsp56k_mmap */
-       dsp56k_open,
-       NULL,   /* flush */
-       dsp56k_release,
-       NULL,    /* no special dsp56k_fsync */
-       NULL,    /* no special dsp56k_fasync */
+       read:           dsp56k_read,
+       write:          dsp56k_write,
+       ioctl:          dsp56k_ioctl,
+       open:           dsp56k_open,
+       release:        dsp56k_release,
 };
 
 
index 892f4df0f4e68209ad397d2be4dd868a035c3c53..ac913935ba6b3f00f3416cfdd240871c95277c52 100644 (file)
@@ -98,19 +98,12 @@ static int dtlk_ioctl(struct inode *inode, struct file *file,
 
 static struct file_operations dtlk_fops =
 {
-       NULL,                   /* lseek */
-       dtlk_read,
-       dtlk_write,
-       NULL,                   /* readdir */
-       dtlk_poll,
-       dtlk_ioctl,
-       NULL,                   /* mmap */
-       dtlk_open,
-       NULL,                   /* flush */
-       dtlk_release,
-       NULL,                   /* fsync */
-       NULL,                   /* fasync */
-       NULL                    /* lock */
+       read:           dtlk_read,
+       write:          dtlk_write,
+       poll:           dtlk_poll,
+       ioctl:          dtlk_ioctl,
+       open:           dtlk_open,
+       release:        dtlk_release,
 };
 
 /* local prototypes */
index 97fb1cce44b790156611dda4064447e222626770..4795eafdc53485db52f581d041665d4eb12fd829 100644 (file)
@@ -121,17 +121,12 @@ static int  zft_write(struct inode *ino, struct file *fp, const char *buff,
 
 static struct file_operations zft_cdev =
 {
-       NULL,                   /* llseek */
-       zft_read,               /* read */
-       zft_write,              /* write */
-       NULL,                   /* readdir */
-       NULL,                   /* select */
-       zft_ioctl,              /* ioctl */
-       zft_mmap,               /* mmap */
-       zft_open,               /* open */
-       NULL,                   /* flush */
-       zft_close,              /* release */
-       NULL,                   /* fsync */
+       read:           zft_read,
+       write:          zft_write,
+       ioctl:          zft_ioctl,
+       mmap:           zft_mmap,
+       open:           zft_open,
+       release:        zft_close,
 };
 
 /*      Open floppy tape device
index c5f31d1ebf83a6372102f11ce682500c652de577..95e2d2ed01218a3e3f6b62cfca6a0dcd550b8391 100644 (file)
@@ -185,16 +185,11 @@ static struct termios    * TermiosLocked[IP2_MAX_PORTS];
 /* This is the driver descriptor for the ip2ipl device, which is used to
  * download the loadware to the boards.
  */
-static struct file_operations
-ip2_ipl = {
-       NULL,
-       ip2_ipl_read,
-       ip2_ipl_write,
-       NULL,
-       NULL,
-       ip2_ipl_ioctl,
-       NULL,
-       ip2_ipl_open,
+static struct file_operations ip2_ipl = {
+       read:           ip2_ipl_read,
+       write:          ip2_ipl_write,
+       ioctl:          ip2_ipl_ioctl,
+       open:           ip2_ipl_open,
 }; 
 
 static long irq_counter = 0;
index e8b32f8f39a5bf63b00cf858f3a91a901885b35d..a9634ad919582e3282c0485460d6a47a1c302dfa 100644 (file)
@@ -109,18 +109,9 @@ static char linuxb_to_isib[] = {
  */
 
 static struct file_operations ISILoad_fops = {
-       NULL,   /*      lseek   */
-       NULL,   /*      read    */
-       NULL,   /*      write   */
-       NULL,   /*      readdir */
-       NULL,   /*      select  */
-       ISILoad_ioctl,
-       NULL,   /*      mmap    */
-       ISILoad_open,
-       NULL,   /*      flush   */
-       ISILoad_release,
-       NULL,   /*      fsync   */
-       NULL,   /*      fasync  */
+       ioctl:          ISILoad_ioctl,
+       open:           ISILoad_open,
+       release:        ISILoad_release,
 };
 
 struct miscdevice isiloader_device = {
index f4ab04a4d12ddcc42ee781e68d539d47ed2f9694..494fbc260bd03420b1dbe17e59863d6ee5db2ba3 100644 (file)
@@ -777,19 +777,11 @@ static inline int stli_initpcibrd(int brdtype, struct pci_dev *devp);
  *     board. This is also a very useful debugging tool.
  */
 static struct file_operations  stli_fsiomem = {
-       NULL,           /* llseek */
-       stli_memread,   /* read */
-       stli_memwrite,  /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       stli_memioctl,  /* ioctl */
-       NULL,           /* mmap */
-       stli_memopen,   /* open */
-       NULL,           /* flush */
-       stli_memclose,  /* release */
-       NULL,           /* fsync */
-       NULL,           /* fasync */
-       NULL            /* lock */
+       read:           stli_memread,
+       write:          stli_memwrite,
+       ioctl:          stli_memioctl,
+       open:           stli_memopen,
+       release:        stli_memclose,
 };
 
 /*****************************************************************************/
index 53b5aecb6e940fbcb76b2369f54c6b8c33b55d18..4f6004f1cb2e9b28fca730debcd7bb7677b2e85c 100644 (file)
@@ -645,24 +645,14 @@ static unsigned int lp_poll (struct file *filp, struct poll_table_struct *wait)
 #endif /* IEEE 1284 support */
 
 static struct file_operations lp_fops = {
-       lp_lseek,
+       write:          lp_write,
+       ioctl:          lp_ioctl,
+       open:           lp_open,
+       release:        lp_release,
 #ifdef CONFIG_PARPORT_1284
-       lp_read,
-#else
-       NULL,
-#endif
-       lp_write,
-       NULL,           /* lp_readdir */
-#ifdef CONFIG_PARPORT_1284
-       lp_poll,
-#else
-       NULL,
+       read:           lp_read,
+       poll:           lp_poll,
 #endif
-       lp_ioctl,
-       NULL,           /* lp_mmap */
-       lp_open,
-       NULL,           /* flush */
-       lp_release
 };
 
 /* --- support for console on the line printer ----------------- */
index 332bd8733b50e20baf94fce38321b224bc6a8bc2..0c0c3c2bdc35d47c03ca108f68d82bf4a16db1ae 100644 (file)
@@ -491,87 +491,47 @@ static int open_port(struct inode * inode, struct file * filp)
 #define open_kmem      open_mem
 
 static struct file_operations mem_fops = {
-       memory_lseek,
-       read_mem,
-       write_mem,
-       NULL,           /* mem_readdir */
-       NULL,           /* mem_poll */
-       NULL,           /* mem_ioctl */
-       mmap_mem,
-       open_mem,
-       NULL,           /* flush */
-       NULL,           /* no special release code */
-       NULL            /* fsync */
+       llseek:         memory_lseek,
+       read:           read_mem,
+       write:          write_mem,
+       mmap:           mmap_mem,
+       open:           open_mem,
 };
 
 static struct file_operations kmem_fops = {
-       memory_lseek,
-       read_kmem,
-       write_kmem,
-       NULL,           /* kmem_readdir */
-       NULL,           /* kmem_poll */
-       NULL,           /* kmem_ioctl */
-       mmap_kmem,
-       open_kmem,
-       NULL,           /* flush */
-       NULL,           /* no special release code */
-       NULL            /* fsync */
+       llseek:         memory_lseek,
+       read:           read_kmem,
+       write:          write_kmem,
+       mmap:           mmap_kmem,
+       open:           open_kmem,
 };
 
 static struct file_operations null_fops = {
-       null_lseek,
-       read_null,
-       write_null,
-       NULL,           /* null_readdir */
-       NULL,           /* null_poll */
-       NULL,           /* null_ioctl */
-       NULL,           /* null_mmap */
-       NULL,           /* no special open code */
-       NULL,           /* flush */
-       NULL,           /* no special release code */
-       NULL            /* fsync */
+       llseek:         null_lseek,
+       read:           read_null,
+       write:          write_null,
 };
 
 #if !defined(CONFIG_PPC) && !defined(__mc68000__)
 static struct file_operations port_fops = {
-       memory_lseek,
-       read_port,
-       write_port,
-       NULL,           /* port_readdir */
-       NULL,           /* port_poll */
-       NULL,           /* port_ioctl */
-       NULL,           /* port_mmap */
-       open_port,
-       NULL,           /* flush */
-       NULL,           /* no special release code */
-       NULL            /* fsync */
+       llseek:         memory_lseek,
+       read:           read_port,
+       write:          write_port,
+       open:           open_port,
 };
 #endif
 
 static struct file_operations zero_fops = {
-       zero_lseek,
-       read_zero,
-       write_zero,
-       NULL,           /* zero_readdir */
-       NULL,           /* zero_poll */
-       NULL,           /* zero_ioctl */
-       mmap_zero,
-       NULL,           /* no special open code */
-       NULL,           /* flush */
-       NULL            /* no special release code */
+       llseek:         zero_lseek,
+       read:           read_zero,
+       write:          write_zero,
+       mmap:           mmap_zero,
 };
 
 static struct file_operations full_fops = {
-       full_lseek,
-       read_full,
-       write_full,
-       NULL,           /* full_readdir */
-       NULL,           /* full_poll */
-       NULL,           /* full_ioctl */        
-       NULL,           /* full_mmap */
-       NULL,           /* no special open code */
-       NULL,           /* flush */
-       NULL            /* no special release code */
+       llseek:         full_lseek,
+       read:           read_full,
+       write:          write_full,
 };
 
 static int memory_open(struct inode * inode, struct file * filp)
@@ -612,17 +572,7 @@ static int memory_open(struct inode * inode, struct file * filp)
 }
 
 static struct file_operations memory_fops = {
-       NULL,           /* lseek */
-       NULL,           /* read */
-       NULL,           /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       memory_open,    /* just a selector for the real open */
-       NULL,           /* flush */
-       NULL,           /* release */
-       NULL            /* fsync */
+       open:           memory_open,    /* just a selector for the real open */
 };
 
 int __init chr_dev_init(void)
index 57afbcf250330eccd3e5f16c94ccc7986ebb2f90..48b2eac66729a35c2a88d430605686eea5e36d7f 100644 (file)
@@ -116,16 +116,7 @@ static int misc_open(struct inode * inode, struct file * file)
 }
 
 static struct file_operations misc_fops = {
-        NULL,          /* seek */
-       NULL,           /* read */
-       NULL,           /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-        misc_open,
-       NULL,           /* flush */
-        NULL           /* release */
+       open:           misc_open,
 };
 
 int misc_register(struct miscdevice * misc)
index 1bb5a5b7f3e2532ef0030f81282eea493866567b..199818ebf0174263f74e0f27f2653bce9d9f52e8 100644 (file)
@@ -166,18 +166,10 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file,
 
 static struct file_operations mixcomwd_fops=
 {
-       NULL,           /* Seek */
-       NULL,           /* Read */
-       mixcomwd_write, /* Write */
-       NULL,           /* Readdir */
-       NULL,           /* Select */
-       mixcomwd_ioctl, /* Ioctl */
-       NULL,           /* MMap */
-       mixcomwd_open,
-       NULL,           /* flush */
-       mixcomwd_release,
-       NULL,           
-       NULL            /* Fasync */
+       write:          mixcomwd_write,
+       ioctl:          mixcomwd_ioctl,
+       open:           mixcomwd_open,
+       release:        mixcomwd_release,
 };
 
 static struct miscdevice mixcomwd_miscdev=
index 7541cc054f567a58e92bb6ed37391e08614348f3..2be8b27984d4cae0ad3ccd3403039a91cdde9a68 100644 (file)
@@ -1274,19 +1274,10 @@ msp3400c_mixer_llseek(struct file *file, loff_t offset, int origin)
 }
 
 static struct file_operations msp3400c_mixer_fops = {
-        msp3400c_mixer_llseek,
-        NULL,  /* read */
-        NULL,  /* write */
-        NULL,  /* readdir */
-        NULL,  /* poll */
-        msp3400c_mixer_ioctl,
-        NULL,  /* mmap */
-        msp3400c_mixer_open,
-       NULL,
-        msp3400c_mixer_release,
-        NULL,  /* fsync */
-        NULL,  /* fasync */
-        NULL,  /* lock */
+       llseek:         msp3400c_mixer_llseek,
+       ioctl:          msp3400c_mixer_ioctl,
+       open:           msp3400c_mixer_open,
+       release:        msp3400c_mixer_release,
 };
 
 #endif
index 60ee17688363bf7e4235d19c57423d61d8b13d1e..e49144c1a2190af4d2c03aa4d978fd425b98c2f5 100644 (file)
@@ -393,16 +393,12 @@ static int nvram_read_proc( char *buffer, char **start, off_t offset,
 #endif /* CONFIG_PROC_FS */
 
 static struct file_operations nvram_fops = {
-       nvram_llseek,
-       nvram_read,
-       nvram_write,
-       NULL,                   /* No readdir */
-       NULL,                   /* No poll */
-       nvram_ioctl,
-       NULL,                   /* No mmap */
-       nvram_open,
-       NULL,                   /* flush */
-       nvram_release
+       llseek:         nvram_llseek,
+       read:           nvram_read,
+       write:          nvram_write,
+       ioctl:          nvram_ioctl,
+       open:           nvram_open,
+       release:        nvram_release,
 };
 
 static struct miscdevice nvram_dev = {
index 6b5c3a803254334ead92768e379e3b55c9e10026..b5443e27ba5a926f57e08b40b8a8a6471c191863 100644 (file)
@@ -627,19 +627,13 @@ static int pad_ioctl(struct inode *inode, struct file * file,
 
 
 static struct file_operations pad_fops = {
-       NULL,           /* pad_seek */
-       read_pad,
-       write_pad,
-       NULL,           /* pad_readdir */
-       pad_poll,
-       pad_ioctl,
-       NULL,           /* pad_mmap */
-       open_pad,
-       NULL,           /* flush */
-       close_pad,
-       NULL,           /* fsync */
-       fasync_pad,
-       NULL            /* lock */
+       read:           read_pad,
+       write:          write_pad,
+       poll:           pad_poll,
+       ioctl:          pad_ioctl,
+       open:           open_pad,
+       release:        close_pad,
+       fasync:         fasync_pad,
 };
 
 
index 8e8ff3f2e55ac1969835790e60eea935040bd2a3..0a6a771bbc653b6121e736f0cb2fb8b625f52431 100644 (file)
@@ -964,18 +964,12 @@ static unsigned int aux_poll(struct file *file, poll_table * wait)
 }
 
 struct file_operations psaux_fops = {
-       NULL,           /* seek */
-       read_aux,
-       write_aux,
-       NULL,           /* readdir */
-       aux_poll,
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       open_aux,
-       NULL,           /* flush */
-       release_aux,
-       NULL,
-       fasync_aux,
+       read:           read_aux,
+       write:          write_aux,
+       poll:           aux_poll,
+       open:           open_aux,
+       release:        release_aux,
+       fasync:         fasync_aux,
 };
 
 /*
index 39cceb5f588993ba543944aaaad9a4e6e5e0afa0..c5b0e54ba4510dbee3f1e334d2557923eacbf77a 100644 (file)
@@ -574,19 +574,11 @@ static int pcwd_proc_get_info(char *buffer, char **start, off_t offset,
 }
 
 static struct file_operations pcwd_fops = {
-       NULL,           /* Seek */
-       pcwd_read,      /* Read */
-       pcwd_write,     /* Write */
-       NULL,           /* Readdir */
-       NULL,           /* Poll */
-       pcwd_ioctl,     /* IOctl */
-       NULL,           /* MMAP */
-       pcwd_open,      /* Open */
-       NULL,           /* flush */
-       pcwd_close,     /* Release */
-       NULL,           /* Fsync */
-       NULL,           /* Fasync */
-       NULL,           /* Lock */
+       read:           pcwd_read,
+       write:          pcwd_write,
+       ioctl:          pcwd_ioctl,
+       open:           pcwd_open,
+       release:        pcwd_close,
 };
 
 static struct miscdevice pcwd_miscdev = {
index 6d8c31266cbd22ea6e9e2721beb490bcb9156e0f..6a6ff80814789528220b074e24cc17fffbc4fc91 100644 (file)
@@ -570,16 +570,13 @@ static unsigned int pp_poll (struct file * file, poll_table * wait)
 }
 
 static struct file_operations pp_fops = {
-       pp_lseek,
-       pp_read,
-       pp_write,
-       NULL,   /* pp_readdir */
-       pp_poll,
-       pp_ioctl,
-       NULL,   /* pp_mmap */
-       pp_open,
-       NULL,   /* pp_flush */
-       pp_release
+       llseek:         pp_lseek,
+       read:           pp_read,
+       write:          pp_write,
+       poll:           pp_poll,
+       ioctl:          pp_ioctl,
+       open:           pp_open,
+       release:        pp_release,
 };
 
 static int __init ppdev_init (void)
index 3de17ad5c2077d21205ea4213ae16ddb13367344..096cf6afb47c6e8bdfd3a673c28a3872cb294c0d 100644 (file)
@@ -290,18 +290,12 @@ repeat:
 }
 
 struct file_operations qp_fops = {
-       NULL,           /* seek */
-       read_qp,
-       write_qp,
-       NULL,           /* readdir */
-       poll_qp,
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       open_qp,
-       NULL,           /* flush */
-       release_qp,
-       NULL,
-       fasync_qp,
+       read:           read_qp,
+       write:          write_qp,
+       poll:           poll_qp,
+       open:           open_qp,
+       release:        release_qp,
+       fasync:         fasync_qp,
 };
 
 /*
index 3bef6759a0189fd2dc85277b92da513c371a557a..97e771b26056502f3b7fdb58fd784f32ff30cc03 100644 (file)
@@ -1637,29 +1637,16 @@ random_ioctl(struct inode * inode, struct file * file,
 }
 
 struct file_operations random_fops = {
-       NULL,           /* random_lseek */
-       random_read,
-       random_write,
-       NULL,           /* random_readdir */
-       random_poll,    /* random_poll */
-       random_ioctl,
-       NULL,           /* random_mmap */
-       NULL,           /* no special open code */
-       NULL,           /* flush */
-       NULL            /* no special release code */
+       read:           random_read,
+       write:          random_write,
+       poll:           random_poll,
+       ioctl:          random_ioctl,
 };
 
 struct file_operations urandom_fops = {
-       NULL,           /* unrandom_lseek */
-       urandom_read,
-       random_write,
-       NULL,           /* urandom_readdir */
-       NULL,           /* urandom_poll */
-       random_ioctl,
-       NULL,           /* urandom_mmap */
-       NULL,           /* no special open code */
-       NULL,           /* flush */
-       NULL            /* no special release code */
+       read:           urandom_read,
+       write:          random_write,
+       ioctl:          random_ioctl,
 };
 
 /***************************************************************
index a0b2d89c6260b1eea96b64706daeea0ccdbe4ca3..6ffbb517cf9c075a862860a82b56c1d67b8841f0 100644 (file)
@@ -33,31 +33,15 @@ int raw_ctl_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
 
 
 static struct file_operations raw_fops = {
-       NULL,           /* llseek */
-       raw_read,       /* read */
-       raw_write,      /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       raw_open,       /* open */
-       NULL,           /* flush */
-       raw_release,    /* release */
-       NULL            /* fsync */
+       read:           raw_read,
+       write:          raw_write,
+       open:           raw_open,
+       release:        raw_release,
 };
 
 static struct file_operations raw_ctl_fops = {
-       NULL,           /* llseek */
-       NULL,           /* read */
-       NULL,           /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       raw_ctl_ioctl,  /* ioctl */
-       NULL,           /* mmap */
-       raw_open,       /* open */
-       NULL,           /* flush */
-       NULL,           /* no special release code */
-       NULL            /* fsync */
+       ioctl:          raw_ctl_ioctl,
+       open:           raw_open,
 };
 
 void __init raw_init(void)
index 92cc0ea3ec9ff513b9dd018b7f7f62f4e8b40d65..bdc61cca66f7376f89268912de3646fffa01eda8 100644 (file)
@@ -158,18 +158,10 @@ static int softdog_ioctl(struct inode *inode, struct file *file,
 
 static struct file_operations softdog_fops=
 {
-       NULL,           /* Seek */
-       NULL,           /* Read */
-       softdog_write,  /* Write */
-       NULL,           /* Readdir */
-       NULL,           /* Select */
-       softdog_ioctl,  /* Ioctl */
-       NULL,           /* MMap */
-       softdog_open,
-       NULL,           /* flush */
-       softdog_release,
-       NULL,           
-       NULL            /* Fasync */
+       write:          softdog_write,
+       ioctl:          softdog_ioctl,
+       open:           softdog_open,
+       release:        softdog_release,
 };
 
 static struct miscdevice softdog_miscdev=
index e90400b7f21f12e0a44ee75dd11a631f938e7900..d936eef41d55a477181c373e3093c0fab08c5a22 100644 (file)
@@ -743,19 +743,9 @@ static unsigned int        sc26198_baudtable[] = {
  *     to get at port stats - only not using the port device itself.
  */
 static struct file_operations  stl_fsiomem = {
-       NULL,           /* llseek */
-       NULL,           /* read */
-       NULL,           /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       stl_memioctl,   /* ioctl */
-       NULL,           /* mmap */
-       stl_memopen,    /* open */
-       NULL,           /* flush */
-       stl_memclose,   /* release */
-       NULL,           /* fsync */
-       NULL,           /* fasync */
-       NULL            /* lock */
+       ioctl:          stl_memioctl,
+       open:           stl_memopen,
+       release:        stl_memclose,
 };
 
 /*****************************************************************************/
index ae2fb2d705bec08f59165fa6e0192a9eed96d386..7caf1058adbdb1083830abdbcb4f6f8e1422cd02 100644 (file)
@@ -531,20 +531,9 @@ static struct real_driver sx_real_driver = {
  */
 
 static struct file_operations sx_fw_fops = {
-       NULL,   /*      lseek   */
-       NULL,   /*      read    */
-       NULL,   /*      write   */
-       NULL,   /*      readdir */
-       NULL,   /*      select  */
-       sx_fw_ioctl,
-       NULL,   /*      mmap    */
-       sx_fw_open,
-#ifndef TWO_ZERO
-       NULL,   /*      flush   */
-#endif
-       sx_fw_release,
-       NULL,   /*      fsync   */
-       NULL,   /*      fasync  */
+       ioctl:          sx_fw_ioctl,
+       open:           sx_fw_open,
+       release:        sx_fw_release,
 };
 
 struct miscdevice sx_fw_device = {
index e433faecc81e9e979357a700bdf4e79ec86e7c95..7a9257ae9c3ae0a26d782c0957b313efec7adb24 100644 (file)
@@ -2765,18 +2765,12 @@ static int qic02_tape_ioctl(struct inode * inode, struct file * filp,
 
 /* These are (most) of the interface functions: */
 static struct file_operations qic02_tape_fops = {
-       qic02_tape_lseek,               /* not allowed */
-       qic02_tape_read,                /* read */
-       qic02_tape_write,               /* write */
-       NULL,                           /* readdir not allowed */
-       NULL,                           /* poll ??? */
-       qic02_tape_ioctl,               /* ioctl */
-       NULL,                           /* mmap not allowed */
-       qic02_tape_open,                /* open */
-       NULL,                           /* flush */
-       qic02_tape_release,             /* release */
-       NULL,                           /* fsync */
-       NULL,                           /* fasync */
+       llseek:         qic02_tape_lseek,       /* not allowed */
+       read:           qic02_tape_read,
+       write:          qic02_tape_write,
+       ioctl:          qic02_tape_ioctl,
+       open:           qic02_tape_open,
+       release:        qic02_tape_release,
 };
 
 
index b4194bb9b952cc6125390110cbe61398b5815d91..abc27bb910d841709fb1c009074bd2e3d2129bb6 100644 (file)
@@ -358,33 +358,23 @@ static loff_t tty_lseek(struct file * file, loff_t offset, int orig)
 }
 
 static struct file_operations tty_fops = {
-       tty_lseek,
-       tty_read,
-       tty_write,
-       NULL,           /* tty_readdir */
-       tty_poll,
-       tty_ioctl,
-       NULL,           /* tty_mmap */
-       tty_open,
-       NULL,           /* flush */
-       tty_release,
-       NULL,           /* tty_fsync */
-       tty_fasync
+       llseek:         tty_lseek,
+       read:           tty_read,
+       write:          tty_write,
+       poll:           tty_poll,
+       ioctl:          tty_ioctl,
+       open:           tty_open,
+       release:        tty_release,
+       fasync:         tty_fasync,
 };
 
 static struct file_operations hung_up_tty_fops = {
-       tty_lseek,
-       hung_up_tty_read,
-       hung_up_tty_write,
-       NULL,           /* hung_up_tty_readdir */
-       hung_up_tty_poll,
-       hung_up_tty_ioctl,
-       NULL,           /* hung_up_tty_mmap */
-       NULL,           /* hung_up_tty_open */
-       NULL,           /* flush */
-       tty_release,    /* hung_up_tty_release */
-       NULL,           /* hung_up_tty_fsync  */
-       NULL            /* hung_up_tty_fasync */
+       llseek:         tty_lseek,
+       read:           hung_up_tty_read,
+       write:          hung_up_tty_write,
+       poll:           hung_up_tty_poll,
+       ioctl:          hung_up_tty_ioctl,
+       release:        tty_release,
 };
 
 /*
index 5fc98155b74d78b69382d21a1e0f73fa34d4bcdb..e099b4ac39bb00392659e855f74495cbaaefdcc5 100644 (file)
@@ -297,17 +297,10 @@ vcs_open(struct inode *inode, struct file *filp)
 }
 
 static struct file_operations vcs_fops = {
-       vcs_lseek,      /* lseek */
-       vcs_read,       /* read */
-       vcs_write,      /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       vcs_open,       /* open */
-       NULL,           /* flush */
-       NULL,           /* release */
-       NULL            /* fsync */
+       llseek:         vcs_lseek,
+       read:           vcs_read,
+       write:          vcs_write,
+       open:           vcs_open,
 };
 
 int __init vcs_init(void)
index 05f2eeeeaeadc5ff3988cfcb81d0b7b6f27a009d..d10182d294abde2d1c53dc0f2a9eedb5bf9ab43d 100644 (file)
@@ -302,22 +302,16 @@ void video_unregister_device(struct video_device *vfd)
 
 static struct file_operations video_fops=
 {
-       video_lseek,
-       video_read,
-       video_write,
-       NULL,   /* readdir */
-#if LINUX_VERSION_CODE >= 0x020100
-       video_poll,     /* poll */
-#else
-       NULL,
-#endif
-       video_ioctl,
-       video_mmap,
-       video_open,
-#if LINUX_VERSION_CODE >= 0x020100
-       NULL,           /* flush */
+       llseek:         video_lseek,
+       read:           video_read,
+       write:          video_write,
+       ioctl:          video_ioctl,
+       mmap:           video_mmap,
+       open:           video_open,
+       release:        video_release,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+       poll:           video_poll,
 #endif
-       video_release
 };
 
 /*
index 3aceec969c4663464aef0c6865576510dbd7acc0..3f587bea423a464b490fa81814aa9b48e754db9e 100644 (file)
@@ -320,16 +320,12 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
  
  
 static struct file_operations wdt_fops = {
-       wdt_llseek,
-       wdt_read,
-       wdt_write,
-       NULL,           /* No Readdir */
-       NULL,           /* No Select */
-       wdt_ioctl,
-       NULL,           /* No mmap */
-       wdt_open,
-       NULL,           /* flush */
-       wdt_release
+       llseek:         wdt_llseek,
+       read:           wdt_read,
+       write:          wdt_write,
+       ioctl:          wdt_ioctl,
+       open:           wdt_open,
+       release:        wdt_release,
 };
 
 static struct miscdevice wdt_miscdev=
index e74337f5bd7727bddf53258223c74f967eb98360..2bb265fc499adde809e0de181fe24162b4acabac 100644 (file)
@@ -98,8 +98,7 @@ static int read_bus_i2c(char *buf, char **start, off_t offset, int len,
 /* To implement the dynamic /proc/bus/i2c-? files, we need our own 
    implementation of the read hook */
 static struct file_operations i2cproc_operations = {
-       NULL,
-       i2cproc_bus_read,
+       read:           i2cproc_bus_read,
 };
 
 static struct inode_operations i2cproc_inode_operations = {
index c2c51bef43b07a6670827bcc2b049fe9f2d64846..d73a7ff66887baf18f9f301766a688591fa9276f 100644 (file)
@@ -74,16 +74,12 @@ extern
 static int i2cdev_cleanup(void);
 
 static struct file_operations i2cdev_fops = {
-       i2cdev_lseek,
-       i2cdev_read,
-       i2cdev_write,
-       NULL,                   /* i2cdev_readdir       */
-       NULL,                   /* i2cdev_select        */
-       i2cdev_ioctl,
-       NULL,                   /* i2cdev_mmap          */
-       i2cdev_open,
-       NULL,                   /* i2cdev_flush         */
-       i2cdev_release,
+       llseek:         i2cdev_lseek,
+       read:           i2cdev_read,
+       write:          i2cdev_write,
+       ioctl:          i2cdev_ioctl,
+       open:           i2cdev_open,
+       release:        i2cdev_release,
 };
 
 #define I2CDEV_ADAPS_MAX I2C_ADAP_MAX
index 4133db0cbbf086e30f8497aabea30a05dc3bd35c..c89fe3b97f4badc32627a7d8df804e8ccc6009aa 100644 (file)
@@ -881,18 +881,13 @@ static int cfg_fasync(int fd, struct file *fp, int on)
 
 static struct file_operations config_fops =
 {
-       cfg_llseek,
-       cfg_read,
-       cfg_write,
-       NULL,
-       NULL /*cfg_poll*/,
-       cfg_ioctl,
-       NULL,           /* No mmap */
-       cfg_open,
-       NULL,           /* No flush */
-       cfg_release,
-       NULL,
-       cfg_fasync
+       llseek:         cfg_llseek,
+       read:           cfg_read,
+       write:          cfg_write,
+       ioctl:          cfg_ioctl,
+       open:           cfg_open,
+       release:        cfg_release,
+       fasync:         cfg_fasync,
 };
 
 static struct miscdevice i2o_miscdev = {
index ae87337f212186e9fbf8636de917e83aa43a7d52..2714a6eb5aca2ae04079d6369eb8c8084ebd1ab7 100644 (file)
@@ -681,12 +681,12 @@ static ssize_t mem_write(struct file*, const char*, size_t, loff_t*);
 
 
 static struct file_operations aux_ops = {
-        /* FIXME: should have custom llseek with bounds checking*/
-        read:     mem_read,
-        write:    mem_write,
-        poll:     aux_poll,
-        open:     mem_open,
-        release:  mem_release
+       /* FIXME: should have custom llseek with bounds checking */
+       read:           mem_read,
+       write:          mem_write,
+       poll:           aux_poll,
+       open:           mem_open,
+       release:        mem_release,
 };
 
 
index c214b0b28dabd5a3bd74c377207959ac7bed4db8..6214a7c75bb608cff1aa3de77ed1b7f2987eb56e 100644 (file)
@@ -511,18 +511,13 @@ capi_release(struct inode *inode, struct file *file)
 
 static struct file_operations capi_fops =
 {
-       capi_llseek,
-       capi_read,
-       capi_write,
-       NULL,                   /* capi_readdir */
-       capi_poll,
-       capi_ioctl,
-       NULL,                   /* capi_mmap */
-       capi_open,
-        NULL,                   /* capi_flush */
-       capi_release,
-       NULL,                   /* capi_fsync */
-       NULL,                   /* capi_fasync */
+       llseek:         capi_llseek,
+       read:           capi_read,
+       write:          capi_write,
+       poll:           capi_poll,
+       ioctl:          capi_ioctl,
+       open:           capi_open,
+       release:        capi_release,
 };
 
 /* -------- /proc functions ----------------------------------- */
index 09f148b5a870ad691cc3366b3bc68df2dd8efd27..38b2944f7edc92bd5215310b9c783214cc6c1a9c 100644 (file)
@@ -279,17 +279,13 @@ isdn_divert_lseek(struct file *file, loff_t offset, int orig)
 
 static struct file_operations isdn_fops =
 {
-       isdn_divert_lseek,
-       isdn_divert_read,
-       isdn_divert_write,
-       NULL,                          /* isdn_readdir */
-       isdn_divert_poll,              /* isdn_poll */
-       isdn_divert_ioctl,             /* isdn_ioctl */
-       NULL,                          /* isdn_mmap */
-       isdn_divert_open,
-       NULL,                          /* flush */ 
-       isdn_divert_close,
-       NULL                           /* fsync */
+       llseek:         isdn_divert_lseek,
+       read:           isdn_divert_read,
+       write:          isdn_divert_write,
+       poll:           isdn_divert_poll,
+       ioctl:          isdn_divert_ioctl,
+       open:           isdn_divert_open,
+       release:        isdn_divert_close,
 };
 
 struct inode_operations divert_file_inode_operations = {
index ba890846d1b081f9210fc9ea7b92c4111121c2ad..1626fa4e9d087038fca5da5110b626ce4aa44fbc 100644 (file)
@@ -2024,17 +2024,13 @@ isdn_close(struct inode *ino, struct file *filep)
 
 static struct file_operations isdn_fops =
 {
-       isdn_lseek,
-       isdn_read,
-       isdn_write,
-       NULL,                   /* isdn_readdir */
-       isdn_poll,              /* isdn_poll */
-       isdn_ioctl,             /* isdn_ioctl */
-       NULL,                   /* isdn_mmap */
-       isdn_open,
-       NULL,                   /* flush */
-       isdn_close,
-       NULL                    /* fsync */
+       llseek:         isdn_lseek,
+       read:           isdn_read,
+       write:          isdn_write,
+       poll:           isdn_poll,
+       ioctl:          isdn_ioctl,
+       open:           isdn_open,
+       release:        isdn_close,
 };
 
 char *
index 73a53a6f43ca318214b8cbc9a118140242ef5c41..1a557f0df7f58ec2ebe4ff593166b3fa47a214a0 100644 (file)
@@ -635,16 +635,11 @@ out:
 }
 
 static struct file_operations adb_fops = {
-       adb_lseek,
-       adb_read,
-       adb_write,
-       NULL,           /* no readdir */
-       NULL,           /* no poll yet */
-       NULL,           /* no ioctl yet */
-       NULL,           /* no mmap */
-       adb_open,
-       NULL,           /* flush */
-       adb_release
+       llseek:         adb_lseek,
+       read:           adb_read,
+       write:          adb_write,
+       open:           adb_open,
+       release:        adb_release,
 };
 
 void adbdev_init()
index 41a6265e9749a0e4b265fc4eecd7c5c3e2effc30..eb5dcaa3b04f823f6709089ace7b6338bdb05f67 100644 (file)
@@ -83,17 +83,11 @@ static int nvram_release(struct inode *inode, struct file *file)
 }
 
 struct file_operations nvram_fops = {
-       nvram_llseek,
-       read_nvram,
-       write_nvram,
-       NULL,           /* nvram_readdir */
-       NULL,           /* nvram_select */
-       NULL,           /* nvram_ioctl */
-       NULL,           /* nvram_mmap */
-       nvram_open,
-       NULL,           /* flush */
-       nvram_release,
-       NULL            /* fsync */
+       llseek:         nvram_llseek,
+       read:           read_nvram,
+       write:          write_nvram,
+       open:           nvram_open,
+       release:        nvram_release,
 };
 
 static struct miscdevice nvram_dev = {
index bf195f9f5b2aa89ee2b19c2cb8cedec0ec46136b..cca84d2faf99237075f54dd4357c6e3119a74e52 100644 (file)
@@ -1479,16 +1479,12 @@ static int pmu_ioctl(struct inode * inode, struct file *filp,
 }
 
 static struct file_operations pmu_device_fops = {
-       NULL,           /* no seek */
-       pmu_read,
-       pmu_write,
-       NULL,           /* no readdir */
-       pmu_fpoll,
-       pmu_ioctl,
-       NULL,           /* no mmap */
-       pmu_open,
-       NULL,           /* flush */
-       pmu_release,
+       read:           pmu_read,
+       write:          pmu_write,
+       poll:           pmu_fpoll,
+       ioctl:          pmu_ioctl,
+       open:           pmu_open,
+       release:        pmu_release,
 };
 
 static struct miscdevice pmu_device = {
index aa5279db1499f9b73cc4b289b75d8b972ea3ccf0..745df62dac1a39fc9a5878fc71d2a5021a2082be 100644 (file)
@@ -1294,7 +1294,7 @@ speedo_start_xmit(struct sk_buff *skb, struct net_device *dev)
                {
                        struct descriptor *last_cmd = sp->last_cmd;
                        sp->last_cmd = (struct descriptor *)&sp->tx_ring[entry];
-                       clear_suspend(last_cmd);
+                       last_cmd->cmd_status &= cpu_to_le32(~(CmdSuspend | CmdIntr));
                }
                if (sp->cur_tx - sp->dirty_tx >= TX_QUEUE_LIMIT)
                        sp->tx_full = 1;
index 860ecabd6dac9aa43e6c3bca20940368587d4250..7deaf807be070929f22c95014d9d7ef3405762af 100644 (file)
@@ -539,16 +539,12 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
 }
 
 static struct file_operations ppp_device_fops = {
-       NULL,           /* seek */
-       ppp_read,
-       ppp_write,
-       NULL,           /* readdir */
-       ppp_poll,
-       ppp_ioctl,
-       NULL,           /* mmap */
-       ppp_open,
-       NULL,           /* flush */
-       ppp_release
+       read:           ppp_read,
+       write:          ppp_write,
+       poll:           ppp_poll,
+       ioctl:          ppp_ioctl,
+       open:           ppp_open,
+       release:        ppp_release
 };
 
 #define PPP_MAJOR      108
index 9dc380fbb3d3aed8ec842368691d47f19a3eeccc..6883aa69f3e932b8f637d055b0e71703054390e2 100644 (file)
@@ -313,23 +313,16 @@ static int cosa_fasync(struct inode *inode, struct file *file, int on);
 #endif
 
 static struct file_operations cosa_fops = {
-       cosa_lseek,
-       cosa_read,
-       cosa_write,
-       NULL,   /* readdir */
-       cosa_poll,
-       cosa_chardev_ioctl,
-       NULL,   /* mmap */
-       cosa_open,
-       NULL,   /* flush */
-       cosa_release,
-       NULL,   /* fsync */
+       llseek:         cosa_lseek,
+       read:           cosa_read,
+       write:          cosa_write,
+       poll:           cosa_poll,
+       ioctl:          cosa_chardev_ioctl,
+       open:           cosa_open,
+       release:        cosa_release,
 #ifdef COSA_FASYNC_WORKING
-       cosa_fasync,
-#else
-       NULL,
+       fasync:         cosa_fasync,
 #endif
-       NULL    /* lock */
 };
 
 /* Ioctls */
index f85e2b4f95b41ec968da539b68be5d98ad7fb0fb..189a44fac63037012153dc685ff73967825a0742 100644 (file)
@@ -853,12 +853,12 @@ static int ds_ioctl(struct inode * inode, struct file * file,
 /*====================================================================*/
 
 static struct file_operations ds_fops = {
-    open:      ds_open,
-    release:   ds_release,
-    ioctl:     ds_ioctl,
-    read:      ds_read,
-    write:     ds_write,
-    poll:      ds_poll
+        open:          ds_open,
+        release:       ds_release,
+        ioctl:         ds_ioctl,
+        read:          ds_read,
+        write:         ds_write,
+        poll:          ds_poll,
 };
 
 EXPORT_SYMBOL(register_pccard_driver);
index a26670fc75ba88a639604b5d169be07457b7cc70..d9f73819f2afdb84bd4e45cf7769b8f36adad4c0 100644 (file)
@@ -202,19 +202,12 @@ static unsigned int isapnp_info_entry_poll(struct file *file, poll_table * wait)
 
 static struct file_operations isapnp_info_entry_operations =
 {
-       isapnp_info_entry_lseek,        /* lseek */
-       isapnp_info_entry_read,         /* read */
-       isapnp_info_entry_write,        /* write */
-       NULL,                           /* readdir */
-       isapnp_info_entry_poll,         /* poll */
-       NULL,                           /* ioctl - default */
-       NULL,                           /* mmap */
-       isapnp_info_entry_open,         /* open */
-       NULL,                           /* flush */
-       isapnp_info_entry_release,      /* release */
-       NULL,                           /* can't fsync */
-       NULL,                           /* fasync */
-       NULL,                           /* lock */
+       llseek:         isapnp_info_entry_lseek,
+       read:           isapnp_info_entry_read,
+       write:          isapnp_info_entry_write,
+       poll:           isapnp_info_entry_poll,
+       open:           isapnp_info_entry_open,
+       release:        isapnp_info_entry_release,
 };
 
 static struct inode_operations isapnp_info_entry_inode_operations =
@@ -277,19 +270,8 @@ static ssize_t isapnp_proc_bus_read(struct file *file, char *buf, size_t nbytes,
 
 static struct file_operations isapnp_proc_bus_file_operations =
 {
-       isapnp_proc_bus_lseek,          /* lseek */
-       isapnp_proc_bus_read,           /* read */
-       NULL,                           /* write */
-       NULL,                           /* readdir */
-       NULL,                           /* poll */
-       NULL,                           /* ioctl - default */
-       NULL,                           /* mmap */
-       NULL,                           /* open */
-       NULL,                           /* flush */
-       NULL,                           /* release */
-       NULL,                           /* can't fsync */
-       NULL,                           /* fasync */
-       NULL,                           /* lock */
+       llseek:         isapnp_proc_bus_lseek,
+       read:           isapnp_proc_bus_read,
 };
 
 static struct inode_operations isapnp_proc_bus_inode_operations =
index 2d5dd31a150aa5977d7421027ab36e8013250b05..86335cef45c3d5b302826ab2046e3a9af42d8983 100644 (file)
@@ -1959,18 +1959,9 @@ static void sparcaudioctl_release(struct inode * inode, struct file * file)
 #endif
 
 static struct file_operations sparcaudioctl_fops = {
-        NULL,
-        NULL,
-        NULL,
-        NULL,                   /* sparcaudio_readdir */
-        sparcaudio_select,
-        sparcaudio_ioctl,
-        NULL,                   /* sparcaudio_mmap */
-        NULL,
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff
-        NULL,                   /* sparcaudio_flush */
-#endif
-        sparcaudioctl_release,
+       poll:           sparcaudio_select,
+       ioctl:          sparcaudio_ioctl,
+       release:        sparcaudioctl_release,
 };
 
 static int sparcaudio_open(struct inode * inode, struct file * file)
@@ -2170,18 +2161,13 @@ static void sparcaudio_release(struct inode * inode, struct file * file)
 #endif
 
 static struct file_operations sparcaudio_fops = {
-       sparcaudio_lseek,
-       sparcaudio_read,
-       sparcaudio_write,
-       NULL,                   /* sparcaudio_readdir */
-       sparcaudio_select,
-       sparcaudio_ioctl,
-       NULL,                   /* sparcaudio_mmap */
-       sparcaudio_open,
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff
-        NULL,                   /* sparcaudio_flush */
-#endif
-       sparcaudio_release
+       llseek:         sparcaudio_lseek,
+       read:           sparcaudio_read,
+       write:          sparcaudio_write,
+       poll:           sparcaudio_select,
+       ioctl:          sparcaudio_ioctl,
+       open:           sparcaudio_open,
+       release:        sparcaudio_release,
 };
 
 #if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100
index 45fbca714e1cbdab30e6070c454afc17239e926e..1d2bee01aab6265aea65a07b199d28675cc9d273 100644 (file)
@@ -834,19 +834,11 @@ static int bpp_ioctl(struct inode *inode, struct file *f, unsigned int cmd,
 }
 
 static struct file_operations bpp_fops = {
-       NULL,           /* bpp_lseek */
-       bpp_read,
-       bpp_write,
-       NULL,           /* bpp_readdir */
-       NULL,           /* bpp_select */
-       bpp_ioctl,
-       NULL,           /* bpp_mmap */
-       bpp_open,
-       NULL,           /* flush */
-       bpp_release,
-  NULL,   /* fsync */
-  NULL,   /* fasync */
-  NULL,   /* lock */
+       read:           bpp_read,
+       write:          bpp_write,
+       ioctl:          bpp_ioctl,
+       open:           bpp_open,
+       release:        bpp_release,
 };
 
 #if defined(__i386__)
index 602c7b670796a5ebebc0d49f870a5837da4af29f..9a6b414012ad744617d7c78810891de782391fdd 100644 (file)
@@ -1522,16 +1522,12 @@ envctrl_release(struct inode *inode, struct file *file)
 }
 
 static struct file_operations envctrl_fops = {
-       envctrl_llseek,
-       envctrl_read,
-       envctrl_write,
-       NULL,           /* readdir */
-       NULL,           /* poll */      
-       envctrl_ioctl,
-       NULL,           /* mmap */
-       envctrl_open,
-       NULL,           /* flush */
-       envctrl_release
+       llseek:         envctrl_llseek,
+       read:           envctrl_read,
+       write:          envctrl_write,
+       ioctl:          envctrl_ioctl,
+       open:           envctrl_open,
+       release:        envctrl_release,
 };
 
 static struct miscdevice envctrl_dev = {
index 9aee3418b723e7f5e87e379cdd4468338b99c374..f88cdedf1f53dbbdbcdd75a161c061edfa38d930 100644 (file)
@@ -128,18 +128,14 @@ flash_release(struct inode *inode, struct file *file)
 }
 
 static struct file_operations flash_fops = {
-       flash_llseek,
-       flash_read,
-       NULL,           /* no write to the Flash, use mmap
-                        * and play flash dependent tricks.
-                        */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       NULL,           /* ioctl */
-       flash_mmap,
-       flash_open,
-       NULL,           /* flush */
-       flash_release
+       /* no write to the Flash, use mmap
+        * and play flash dependent tricks.
+        */
+       llseek:         flash_llseek,
+       read:           flash_read,
+       ioctl:          flash_mmap,
+       mmap:           flash_open,
+       flush:          flash_release,
 };
 
 static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops };
index fa357abe409a7d6769083eb8cec15eaeeb65a755..af9f6c95f295037c3a31f54a329a7c19a78dfeb7 100644 (file)
@@ -360,17 +360,13 @@ static int jsf_release(struct inode *inode, struct file *file)
 }
 
 static struct file_operations jsf_fops = {
-       jsf_lseek,
-       jsf_read,
-       jsf_write,
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       jsf_ioctl,
-       jsf_mmap,
-       jsf_open,
-       NULL,           /* flush */
-       jsf_release,
-       NULL            /* fsync */
+       llseek:         jsf_lseek,
+       read:           jsf_read,
+       write:          jsf_write,
+       ioctl:          jsf_ioctl,
+       mmap:           jsf_mmap,
+       open:           jsf_open,
+       release:        jsf_release,
 };
 
 static struct miscdevice jsf_dev = { JSF_MINOR, "jsflash", &jsf_fops };
index 78492a9da60266b7c9a1b68b590ccba9673310a5..8bba6512eb38fc064719e117905182d02116f394 100644 (file)
@@ -608,16 +608,10 @@ static int openprom_release(struct inode * inode, struct file * file)
 }
 
 static struct file_operations openprom_fops = {
-       openprom_lseek,
-       NULL,                   /* openprom_read */
-       NULL,                   /* openprom_write */
-       NULL,                   /* openprom_readdir */
-       NULL,                   /* openprom_poll */
-       openprom_ioctl,
-       NULL,                   /* openprom_mmap */
-       openprom_open,
-       NULL,                   /* flush */
-       openprom_release
+       llseek:         openprom_lseek,
+       ioctl:          openprom_ioctl,
+       open:           openprom_open,
+       release:        openprom_release,
 };
 
 static struct miscdevice openprom_dev = {
index 1c5846ade3b65eedfc66564797002defc91b8557..fd1d6f0d62206323726f526837c7dc55b384de78 100644 (file)
@@ -889,18 +889,12 @@ static unsigned int aux_poll(struct file *file, poll_table * wait)
 }
 
 struct file_operations psaux_fops = {
-       NULL,           /* seek */
-       aux_read,
-       aux_write,
-       NULL,           /* readdir */
-       aux_poll,
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       aux_open,
-       NULL,           /* flush */
-       aux_release,
-       NULL,
-       aux_fasync,
+       read:           aux_read,
+       write:          aux_write,
+       poll:           aux_poll,
+       open:           aux_open,
+       release:        aux_release,
+       fasync:         aux_fasync,
 };
 
 static int aux_no_open(struct inode *inode, struct file *file)
@@ -909,14 +903,7 @@ static int aux_no_open(struct inode *inode, struct file *file)
 }
 
 struct file_operations psaux_no_fops = {
-       NULL,           /* seek */
-       NULL,
-       NULL,
-       NULL,           /* readdir */
-       NULL,
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       aux_no_open,
+       open:           aux_no_open,
 };
 
 static struct miscdevice psaux_mouse = {
index 2a6f8624b8166817ef4222ae3dc209f8ce0b4664..4a39da89945b4c2e8d54fdea3d069168cd9b2c60 100644 (file)
@@ -137,16 +137,10 @@ static int rtc_release(struct inode *inode, struct file *file)
 }
 
 static struct file_operations rtc_fops = {
-       rtc_lseek,
-       NULL,           /* rtc_read */
-       NULL,           /* rtc_write */
-       NULL,           /* rtc_readdir */
-       NULL,           /* rtc_poll */
-       rtc_ioctl,
-       NULL,           /* rtc_mmap */
-       rtc_open,
-       NULL,           /* flush */
-       rtc_release
+       llseek:         rtc_lseek,
+       ioctl:          rtc_ioctl,
+       open:           rtc_open,
+       release:        rtc_release,
 };
 
 static struct miscdevice rtc_dev = { RTC_MINOR, "rtc", &rtc_fops };
index 6b7a893b791efa5b6bb369f89179af6e86f4b0ee..118ff45eb9a887e9e679547a7577cd67d86be0d5 100644 (file)
@@ -1486,21 +1486,14 @@ kbd_close (struct inode *i, struct file *f)
        return 0;
 }
 
-static struct
-file_operations kbd_fops =
+static struct file_operations kbd_fops =
 {
-       NULL,                   /* seek */
-       kbd_read,               /* read */
-       NULL,                   /* write */
-       NULL,                   /* readdir */
-       kbd_poll,               /* poll */
-       kbd_ioctl,              /* ioctl */
-       NULL,                   /* mmap */
-       kbd_open,               /* open */
-       NULL,                   /* flush */
-       kbd_close,              /* close */
-       NULL,                   /* fsync */
-       kbd_fasync,             /* fasync */
+       read:           kbd_read,
+       poll:           kbd_poll,
+       ioctl:          kbd_ioctl,
+       open:           kbd_open,
+       release:        kbd_close,
+       fasync:         kbd_fasync,
 };
 
 void __init keyboard_zsinit(void (*put_char)(unsigned char))
index 2409d2e676330d6d1630ff89104c2dfb18dfdd2c..091702d156ac045f866330f773157cf86e2bdb7d 100644 (file)
@@ -542,18 +542,13 @@ sun_mouse_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsig
 }
 
 struct file_operations sun_mouse_fops = {
-       NULL,
-       sun_mouse_read,
-       sun_mouse_write,
-       NULL,
-       sun_mouse_poll,
-       sun_mouse_ioctl,
-       NULL,
-       sun_mouse_open,
-       NULL,           /* flush */
-       sun_mouse_close,
-       NULL,
-       sun_mouse_fasync,
+       read:           sun_mouse_read,
+       write:          sun_mouse_write,
+       poll:           sun_mouse_poll,
+       ioctl:          sun_mouse_ioctl,
+       open:           sun_mouse_open,
+       release:        sun_mouse_close,
+       fasync:         sun_mouse_fasync,
 };
 
 static struct miscdevice sun_mouse_mouse = {
index 6d9decaf33f2ff0a0947211627bb1e39342d4b46..fed2885409cbbd277b9e5819cf3efff5e48caa0f 100644 (file)
@@ -238,16 +238,10 @@ void uctrl_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 }
 
 static struct file_operations uctrl_fops = {
-       uctrl_llseek,
-       NULL,           /* read */
-       NULL,           /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */      
-       uctrl_ioctl,
-       NULL,           /* mmap */
-       uctrl_open,
-       NULL,           /* flush */
-       uctrl_release
+       llseek:         uctrl_llseek,
+       ioctl:          uctrl_ioctl,
+       open:           uctrl_open,
+       release:        uctrl_release,
 };
 
 static struct miscdevice uctrl_dev = {
index 516e356173d20fcf260d05cdf037bb2d4f40711c..5f7af8642afabab08db3081dff4b1f9c168828a6 100644 (file)
@@ -627,16 +627,11 @@ static int vfc_lseek(struct inode *inode, struct file *file,
 }
 
 static struct file_operations vfc_fops = {
-       vfc_lseek,   /* vfc_lseek */
-       NULL,        /* vfc_write */
-       NULL,        /* vfc_read */
-       NULL,        /* vfc_readdir */
-       NULL,        /* vfc_select */
-       vfc_ioctl,   
-       vfc_mmap, 
-       vfc_open,
-       NULL,        /* flush */
-       vfc_release,
+       llseek:         vfc_lseek,
+       ioctl:          vfc_ioctl,
+       mmap:           vfc_mmap,
+       open:           vfc_open,
+       release:        vfc_release,
 };
 
 static int vfc_probe(void)
index c1db9ffbda8d3b0897dbf6584be5e66b59765f37..5e1abb8347c7d58d9956501645126d8257b82a85 100644 (file)
@@ -934,19 +934,13 @@ static void sg_debug(const Sg_device * sdp, const Sg_fd * sfp, int part_of)
 }
 
 static struct file_operations sg_fops = {
-    NULL,            /* lseek */
-    sg_read,         /* read */
-    sg_write,        /* write */
-    NULL,            /* readdir */
-    sg_poll,         /* poll */
-    sg_ioctl,        /* ioctl */
-    NULL,            /* mmap */
-    sg_open,         /* open */
-    NULL,            /* flush */
-    sg_release,      /* release, was formerly sg_close */
-    NULL,            /* fsync */
-    sg_fasync,       /* fasync */
-    NULL,            /* lock */
+        read:          sg_read,
+        write:         sg_write,
+        poll:          sg_poll,
+        ioctl:         sg_ioctl,
+        open:          sg_open,
+        release:       sg_release,
+        fasync:        sg_fasync,
 };
 
 
index 90d0d213f8d21b05e124e8e06c673751f2134c82..5817b1424c08ca2915f3637c3618b903678781a7 100644 (file)
@@ -3217,17 +3217,12 @@ __setup("st=", st_setup);
 
 static struct file_operations st_fops =
 {
-       NULL,                   /* lseek - default */
-       st_read,                /* read - general block-dev read */
-       st_write,               /* write - general block-dev write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* select */
-       st_ioctl,               /* ioctl */
-       NULL,                   /* mmap */
-       scsi_tape_open,         /* open */
-       scsi_tape_flush,        /* flush */
-       scsi_tape_close,        /* release */
-       NULL                    /* fsync */
+       read:           st_read,
+       write:          st_write,
+       ioctl:          st_ioctl,
+       open:           scsi_tape_open,
+       flush:          scsi_tape_flush,
+       release:        scsi_tape_close,
 };
 
 static int st_attach(Scsi_Device * SDp)
index 2e0e0621f41af496764d59293f793e6994890d4e..29fa2b1d70cf1376bdb019f81c9c8813cef06117 100644 (file)
@@ -373,16 +373,12 @@ static unsigned int ds1286_poll(struct file *file, poll_table *wait)
  */
 
 static struct file_operations ds1286_fops = {
-       ds1286_llseek,
-       ds1286_read,
-       NULL,           /* No write */
-       NULL,           /* No readdir */
-       ds1286_poll,
-       ds1286_ioctl,
-       NULL,           /* No mmap */
-       ds1286_open,
-       NULL,
-       ds1286_release
+       llseek:         ds1286_llseek,
+       read:           ds1286_read,
+       poll:           ds1286_poll,
+       ioctl:          ds1286_ioctl,
+       open:           ds1286_open,
+       release:        ds1286_release,
 };
 
 static struct miscdevice ds1286_dev=
index 7c68774c421e6b493e14881c50579922399217ea..8cef318d9a8e012b860698b9ded36457afb52224 100644 (file)
@@ -287,18 +287,10 @@ graphics_ops_post_init (int slot)
 #endif
 
 struct file_operations sgi_graphics_fops = {
-       NULL,                   /* llseek */
-       NULL,                   /* read */
-       NULL,                   /* write */
-       NULL,                   /* readdir */
-       NULL,                   /* poll */
-       sgi_graphics_ioctl,     /* ioctl */
-       sgi_graphics_mmap,      /* mmap */
-       sgi_graphics_open,      /* open */
-       NULL,                   /* flush */
-       sgi_graphics_close,     /* release */
-       NULL,                   /* fsync */
-       NULL                    /* lock */
+       ioctl:          sgi_graphics_ioctl,
+       mmap:           sgi_graphics_mmap,
+       open:           sgi_graphics_open,
+       release:        sgi_graphics_close,
 };
 
 /* /dev/graphics */
index 0b1965b6f5dd7bb1974f14701bbcc70358e2372f..b49ca3f76429c5fd8468dca5201ea5663798c226 100644 (file)
@@ -429,21 +429,14 @@ shmiq_qcntl_close (struct inode *inode, struct file *filp)
 }
 
 
-static struct
-file_operations shmiq_fops =
+static struct file_operations shmiq_fops =
 {
-        NULL,                   /* seek */
-        NULL,                   /* read */
-        NULL,                   /* write */
-        NULL,                   /* readdir */
-        shmiq_qcntl_poll,       /* poll */
-        shmiq_qcntl_ioctl,      /* ioctl */
-        shmiq_qcntl_mmap,       /* mmap */
-        shmiq_qcntl_open,       /* open */
-       NULL,                   /* flush */
-        shmiq_qcntl_close,      /* close */
-        NULL,                   /* fsync */
-        shmiq_qcntl_fasync,     /* fasync */
+       poll:           shmiq_qcntl_poll,
+       ioctl:          shmiq_qcntl_ioctl,
+       mmap:           shmiq_qcntl_mmap,
+       open:           shmiq_qcntl_open,
+       release:        shmiq_qcntl_close,
+       fasync:         shmiq_qcntl_fasync,
 };
 
 void
index d367e79321b6321d3f5635dfd2104aabc862663d..9ad99d8d947e7ca23b8d0d94bc7d48085ccfbeb6 100644 (file)
@@ -72,18 +72,9 @@ sgi_gfx_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigne
 }
 
 struct file_operations sgi_gfx_fops = {
-       NULL,                   /* llseek */
-       NULL,                   /* read */
-       NULL,                   /* write */
-       NULL,                   /* readdir */
-       NULL,                   /* poll */
-       sgi_gfx_ioctl,          /* ioctl */
-       NULL,                   /* mmap */
-       sgi_gfx_open,           /* open */
-       NULL,                   /* flush */
-       sgi_gfx_close,          /* release */
-       NULL,                   /* fsync */
-       NULL                    /* lock */
+       ioctl:          sgi_gfx_ioctl,
+       open:           sgi_gfx_open,
+       release:        sgi_gfx_close,
 };
  
 static struct miscdevice dev_gfx = {
@@ -191,18 +182,8 @@ sgi_keyb_open (struct inode *inode, struct file *file)
 }
 
 struct file_operations sgi_keyb_fops = {
-       NULL,                   /* llseek */
-       NULL,                   /* read */
-       NULL,                   /* write */
-       NULL,                   /* readdir */
-       NULL,                   /* poll */
-       sgi_keyb_ioctl,         /* ioctl */
-       NULL,                   /* mmap */
-       sgi_keyb_open,          /* open */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       NULL,                   /* fsync */
-       NULL                    /* lock */
+       ioctl:          sgi_keyb_ioctl,
+       open:           sgi_keyb_open,
 };
 
 static struct miscdevice dev_input_keyboard = {
@@ -330,18 +311,9 @@ sgi_mouse_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsig
 }
 
 struct file_operations sgi_mouse_fops = {
-       NULL,                   /* llseek */
-       NULL,                   /* read */
-       NULL,                   /* write */
-       NULL,                   /* readdir */
-       NULL,                   /* poll */
-       sgi_mouse_ioctl,        /* ioctl */
-       NULL,                   /* mmap */
-       sgi_mouse_open,         /* open */
-       NULL,                   /* flush */
-       sgi_mouse_close,        /* release */
-       NULL,                   /* fsync */
-       NULL                    /* lock */
+       ioctl:          sgi_mouse_ioctl,
+       open:           sgi_mouse_open,
+       release:        sgi_mouse_close,
 };
 
 /* /dev/input/mouse */
index 329810322ef0eb04a2f2e1bca493764f9d682d13..9ab379ed16d03639f2f26672b8e90502da6d446c 100644 (file)
@@ -170,18 +170,10 @@ sgi_usemaclone_release(struct inode *inode, struct file *filp)
 }
 
 struct file_operations sgi_usemaclone_fops = {
-       NULL,                   /* llseek */
-       NULL,                   /* read */
-       NULL,                   /* write */
-       NULL,                   /* readdir */
-       sgi_usemaclone_poll,    /* poll */
-       sgi_usemaclone_ioctl,   /* ioctl */
-       NULL,                   /* mmap */
-       sgi_usemaclone_open,    /* open */
-       NULL,                   /* flush */
-       sgi_usemaclone_release, /* release */
-       NULL,                   /* fsync */
-       NULL                    /* lock */
+       poll:           sgi_usemaclone_poll,
+       ioctl:          sgi_usemaclone_ioctl,
+       open:           sgi_usemaclone_open,
+       release:        sgi_usemaclone_release,
 };
 
 static struct miscdevice dev_usemaclone = {
index e01aa242948cbb031b19c8342c35932473b46eb5..ce77027f7c3faeaf512d58135b712f870883dc81 100644 (file)
@@ -1180,19 +1180,10 @@ static int cm_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int
 }
 
 static /*const*/ struct file_operations cm_mixer_fops = {
-       &cm_llseek,
-       NULL,  /* read */
-       NULL,  /* write */
-       NULL,  /* readdir */
-       NULL,  /* poll */
-       &cm_ioctl_mixdev,
-       NULL,  /* mmap */
-       &cm_open_mixdev,
-       NULL,   /* flush */
-       &cm_release_mixdev,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         cm_llseek,
+       ioctl:          cm_ioctl_mixdev,
+       open:           cm_open_mixdev,
+       release:        cm_release_mixdev,
 };
 
 /* --------------------------------------------------------------------- */
@@ -1801,19 +1792,14 @@ static int cm_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations cm_audio_fops = {
-       &cm_llseek,
-       &cm_read,
-       &cm_write,
-       NULL,  /* readdir */
-       &cm_poll,
-       &cm_ioctl,
-       &cm_mmap,
-       &cm_open,
-       NULL,   /* flush */
-       &cm_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         cm_llseek,
+       read:           cm_read,
+       write:          cm_write,
+       poll:           cm_poll,
+       ioctl:          cm_ioctl,
+       mmap:           cm_mmap,
+       open:           cm_open,
+       release:        cm_release,
 };
 
 /* --------------------------------------------------------------------- */
@@ -2080,19 +2066,12 @@ static int cm_midi_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations cm_midi_fops = {
-       &cm_llseek,
-       &cm_midi_read,
-       &cm_midi_write,
-       NULL,  /* readdir */
-       &cm_midi_poll,
-       NULL,  /* ioctl */
-       NULL,  /* mmap */
-       &cm_midi_open,
-       NULL,   /* flush */
-       &cm_midi_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         cm_llseek,
+       read:           cm_midi_read,
+       write:          cm_midi_write,
+       poll:           cm_midi_poll,
+       open:           cm_midi_open,
+       release:        cm_midi_release,
 };
 
 /* --------------------------------------------------------------------- */
@@ -2252,19 +2231,10 @@ static int cm_dmfm_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations cm_dmfm_fops = {
-       &cm_llseek,
-       NULL,  /* read */
-       NULL,  /* write */
-       NULL,  /* readdir */
-       NULL,  /* poll */
-       &cm_dmfm_ioctl,
-       NULL,  /* mmap */
-       &cm_dmfm_open,
-       NULL,   /* flush */
-       &cm_dmfm_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         cm_llseek,
+       ioctl:          cm_dmfm_ioctl,
+       open:           cm_dmfm_open,
+       release:        cm_dmfm_release,
 };
 
 /* --------------------------------------------------------------------- */
index 410a8fbd9c46ab3d921f33079b7012de18928726..55aa0aae48482b4f37393c743b542fb72b3856b0 100644 (file)
@@ -4605,16 +4605,10 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd,
 
 static struct file_operations mixer_fops =
 {
-       sound_lseek,
-       NULL,                   /* mixer_read */
-       NULL,                   /* mixer_write */
-       NULL,                   /* mixer_readdir */
-       NULL,                   /* mixer_poll */
-       mixer_ioctl,
-       NULL,                   /* mixer_mmap */
-       mixer_open,
-       NULL,                   /* flush */
-       mixer_release,
+       llseek:         sound_lseek,
+       ioctl:          mixer_ioctl,
+       open:           mixer_open,
+       release:        mixer_release,
 };
 
 
@@ -5231,20 +5225,14 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
 
 static struct file_operations sq_fops =
 {
-       sound_lseek,
+       llseek:         sound_lseek,
+       write:          sq_write,
+       ioctl:          sq_ioctl,
+       open:           sq_open,
+       release:        sq_release,
 #ifdef CONFIG_PPC
-       sq_read,                        /* sq_read */
-#else
-       NULL,                   /* sq_read */
+       read:           sq_read,                        /* sq_read */
 #endif
-       sq_write,
-       NULL,                   /* sq_readdir */
-       NULL,                   /* sq_poll */
-       sq_ioctl,
-       NULL,                   /* sq_mmap */
-       sq_open,
-       NULL,                   /* flush */
-       sq_release,
 };
 
 
@@ -5449,16 +5437,10 @@ static ssize_t state_read(struct file *file, char *buf, size_t count,
 
 static struct file_operations state_fops =
 {
-       sound_lseek,
-       state_read,
-       NULL,                   /* state_write */
-       NULL,                   /* state_readdir */
-       NULL,                   /* state_poll */
-       NULL,                   /* state_ioctl */
-       NULL,                   /* state_mmap */
-       state_open,
-       NULL,                   /* flush */
-       state_release,
+       llseek:         sound_lseek,
+       read:           state_read,
+       open:           state_open,
+       release:        state_release,
 };
 
 
index 2c751982aa1e593e7ead966773ab3a603801e7b9..a6d6603ace76aae9eda32b2b1ace8366a2e94833 100644 (file)
@@ -1049,19 +1049,10 @@ static int es1370_ioctl_mixdev(struct inode *inode, struct file *file, unsigned
 }
 
 static /*const*/ struct file_operations es1370_mixer_fops = {
-       &es1370_llseek,
-       NULL,  /* read */
-       NULL,  /* write */
-       NULL,  /* readdir */
-       NULL,  /* poll */
-       &es1370_ioctl_mixdev,
-       NULL,  /* mmap */
-       &es1370_open_mixdev,
-       NULL,   /* flush */
-       &es1370_release_mixdev,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         es1370_llseek,
+       ioctl:          es1370_ioctl_mixdev,
+       open:           es1370_open_mixdev,
+       release:        es1370_release_mixdev,
 };
 
 /* --------------------------------------------------------------------- */
@@ -1747,19 +1738,14 @@ static int es1370_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations es1370_audio_fops = {
-       &es1370_llseek,
-       &es1370_read,
-       &es1370_write,
-       NULL,  /* readdir */
-       &es1370_poll,
-       &es1370_ioctl,
-       &es1370_mmap,
-       &es1370_open,
-       NULL,   /* flush */
-       &es1370_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         es1370_llseek,
+       read:           es1370_read,
+       write:          es1370_write,
+       poll:           es1370_poll,
+       ioctl:          es1370_ioctl,
+       mmap:           es1370_mmap,
+       open:           es1370_open,
+       release:        es1370_release,
 };
 
 /* --------------------------------------------------------------------- */
@@ -2149,19 +2135,13 @@ static int es1370_release_dac(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations es1370_dac_fops = {
-       &es1370_llseek,
-       NULL,  /* read */
-       &es1370_write_dac,
-       NULL,  /* readdir */
-       &es1370_poll_dac,
-       &es1370_ioctl_dac,
-       &es1370_mmap_dac,
-       &es1370_open_dac,
-       NULL,   /* flush */
-       &es1370_release_dac,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         es1370_llseek,
+       write:          es1370_write_dac,
+       poll:           es1370_poll_dac,
+       ioctl:          es1370_ioctl_dac,
+       mmap:           es1370_mmap_dac,
+       open:           es1370_open_dac,
+       release:        es1370_release_dac,
 };
 
 /* --------------------------------------------------------------------- */
@@ -2425,19 +2405,12 @@ static int es1370_midi_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations es1370_midi_fops = {
-       &es1370_llseek,
-       &es1370_midi_read,
-       &es1370_midi_write,
-       NULL,  /* readdir */
-       &es1370_midi_poll,
-       NULL,  /* ioctl */
-       NULL,  /* mmap */
-       &es1370_midi_open,
-       NULL,   /* flush */
-       &es1370_midi_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         es1370_llseek,
+       read:           es1370_midi_read,
+       write:          es1370_midi_write,
+       poll:           es1370_midi_poll,
+       open:           es1370_midi_open,
+       release:        es1370_midi_release,
 };
 
 /* --------------------------------------------------------------------- */
index 45d88a5596532eecacb4f1fc086c6170ab255776..21e2c7c2b549d3027bb14716437d1782091a6d7d 100644 (file)
@@ -1182,19 +1182,10 @@ static int es1371_ioctl_mixdev(struct inode *inode, struct file *file, unsigned
 }
 
 static /*const*/ struct file_operations es1371_mixer_fops = {
-       &es1371_llseek,
-       NULL,  /* read */
-       NULL,  /* write */
-       NULL,  /* readdir */
-       NULL,  /* poll */
-       &es1371_ioctl_mixdev,
-       NULL,  /* mmap */
-       &es1371_open_mixdev,
-       NULL,   /* flush */
-       &es1371_release_mixdev,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         es1371_llseek,
+       ioctl:          es1371_ioctl_mixdev,
+       open:           es1371_open_mixdev,
+       release:        es1371_release_mixdev,
 };
 
 /* --------------------------------------------------------------------- */
@@ -1875,19 +1866,14 @@ static int es1371_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations es1371_audio_fops = {
-       &es1371_llseek,
-       &es1371_read,
-       &es1371_write,
-       NULL,  /* readdir */
-       &es1371_poll,
-       &es1371_ioctl,
-       &es1371_mmap,
-       &es1371_open,
-       NULL,   /* flush */
-       &es1371_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         es1371_llseek,
+       read:           es1371_read,
+       write:          es1371_write,
+       poll:           es1371_poll,
+       ioctl:          es1371_ioctl,
+       mmap:           es1371_mmap,
+       open:           es1371_open,
+       release:        es1371_release,
 };
 
 /* --------------------------------------------------------------------- */
@@ -2267,19 +2253,13 @@ static int es1371_release_dac(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations es1371_dac_fops = {
-       &es1371_llseek,
-       NULL,  /* read */
-       &es1371_write_dac,
-       NULL,  /* readdir */
-       &es1371_poll_dac,
-       &es1371_ioctl_dac,
-       &es1371_mmap_dac,
-       &es1371_open_dac,
-       NULL,   /* flush */
-       &es1371_release_dac,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         es1371_llseek,
+       write:          es1371_write_dac,
+       poll:           es1371_poll_dac,
+       ioctl:          es1371_ioctl_dac,
+       mmap:           es1371_mmap_dac,
+       open:           es1371_open_dac,
+       release:        es1371_release_dac,
 };
 
 /* --------------------------------------------------------------------- */
@@ -2542,19 +2522,12 @@ static int es1371_midi_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations es1371_midi_fops = {
-       &es1371_llseek,
-       &es1371_midi_read,
-       &es1371_midi_write,
-       NULL,  /* readdir */
-       &es1371_midi_poll,
-       NULL,  /* ioctl */
-       NULL,  /* mmap */
-       &es1371_midi_open,
-       NULL,   /* flush */
-       &es1371_midi_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         es1371_llseek,
+       read:           es1371_midi_read,
+       write:          es1371_midi_write,
+       poll:           es1371_midi_poll,
+       open:           es1371_midi_open,
+       release:        es1371_midi_release,
 };
 
 /* --------------------------------------------------------------------- */
index 730027f0ae7f54fc4d7bdbf6cf736be06cd36db6..72fbd14a5b4a1925b37c3fc5a69d93ee8e07ff19 100644 (file)
@@ -925,19 +925,10 @@ static int solo1_ioctl_mixdev(struct inode *inode, struct file *file, unsigned i
 }
 
 static /*const*/ struct file_operations solo1_mixer_fops = {
-       &solo1_llseek,
-       NULL,  /* read */
-       NULL,  /* write */
-       NULL,  /* readdir */
-       NULL,  /* poll */
-       &solo1_ioctl_mixdev,
-       NULL,  /* mmap */
-       &solo1_open_mixdev,
-       NULL,  /* flush */
-       &solo1_release_mixdev,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         solo1_llseek,
+       ioctl:          solo1_ioctl_mixdev,
+       open:           solo1_open_mixdev,
+       release:        solo1_release_mixdev,
 };
 
 /* --------------------------------------------------------------------- */
@@ -1583,19 +1574,14 @@ static int solo1_open(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations solo1_audio_fops = {
-       &solo1_llseek,
-       &solo1_read,
-       &solo1_write,
-       NULL,  /* readdir */
-       &solo1_poll,
-       &solo1_ioctl,
-       &solo1_mmap,
-       &solo1_open,
-       NULL,  /* flush */
-       &solo1_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         solo1_llseek,
+       read:           solo1_read,
+       write:          solo1_write,
+       poll:           solo1_poll,
+       ioctl:          solo1_ioctl,
+       mmap:           solo1_mmap,
+       open:           solo1_open,
+       release:        solo1_release,
 };
 
 /* --------------------------------------------------------------------- */
@@ -1929,19 +1915,12 @@ static int solo1_midi_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations solo1_midi_fops = {
-       &solo1_llseek,
-       &solo1_midi_read,
-       &solo1_midi_write,
-       NULL,  /* readdir */
-       &solo1_midi_poll,
-       NULL,  /* ioctl */
-       NULL,  /* mmap */
-       &solo1_midi_open,
-       NULL,  /* flush */
-       &solo1_midi_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         solo1_llseek,
+       read:           solo1_midi_read,
+       write:          solo1_midi_write,
+       poll:           solo1_midi_poll,
+       open:           solo1_midi_open,
+       release:        solo1_midi_release,
 };
 
 /* --------------------------------------------------------------------- */
@@ -2117,19 +2096,10 @@ static int solo1_dmfm_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations solo1_dmfm_fops = {
-       &solo1_llseek,
-       NULL,  /* read */
-       NULL,  /* write */
-       NULL,  /* readdir */
-       NULL,  /* poll */
-       &solo1_dmfm_ioctl,
-       NULL,  /* mmap */
-       &solo1_dmfm_open,
-       NULL,  /* flush */
-       &solo1_dmfm_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         solo1_llseek,
+       ioctl:          solo1_dmfm_ioctl,
+       open:           solo1_dmfm_open,
+       release:        solo1_dmfm_release,
 };
 
 /* --------------------------------------------------------------------- */
index 4580a62c4d68f5fa5c45421fe39bd1e4e73ad1ae..8561df555f3182861e72b0768ff252e96f4daea6 100644 (file)
@@ -2023,19 +2023,10 @@ static int ess_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int
 }
 
 static /*const*/ struct file_operations ess_mixer_fops = {
-       &ess_llseek,
-       NULL,  /* read */
-       NULL,  /* write */
-       NULL,  /* readdir */
-       NULL,  /* poll */
-       &ess_ioctl_mixdev,
-       NULL,  /* mmap */
-       &ess_open_mixdev,
-       NULL,   /* flush */
-       &ess_release_mixdev,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         ess_llseek,
+       ioctl:          ess_ioctl_mixdev,
+       open:           ess_open_mixdev,
+       release:        ess_release_mixdev,
 };
 
 /* --------------------------------------------------------------------- */
@@ -2893,19 +2884,14 @@ ess_release(struct inode *inode, struct file *file)
 }
 
 static struct file_operations ess_audio_fops = {
-       &ess_llseek,
-       &ess_read,
-       &ess_write,
-       NULL,  /* readdir */
-       &ess_poll,
-       &ess_ioctl,
-       &ess_mmap,
-       &ess_open,
-       NULL,   /* flush */
-       &ess_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         ess_llseek,
+       read:           ess_read,
+       write:          ess_write,
+       poll:           ess_poll,
+       ioctl:          ess_ioctl,
+       mmap:           ess_mmap,
+       open:           ess_open,
+       release:        ess_release,
 };
 
 static int
index 0217f3a8542d756058b4ceb8d7cea4888196bd04..b220433ce8041105d503ad21f5ccae9ac2b9a895 100644 (file)
@@ -1122,20 +1122,11 @@ static void intr(int irq, void *dev_id, struct pt_regs *regs)
 }
 
 static struct file_operations dev_fileops = {
-       NULL,           /* llseek */
-       dev_read,       /* read */
-       dev_write,      /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       dev_ioctl,      /* ioctl */
-       NULL,           /* mmap */
-       dev_open,       /* open */
-#ifndef LINUX20
-       NULL,           /* flush */
-#endif
-       dev_release,    /* release */
-       NULL,           /* fsync */
-       NULL,           /* fasync */
+       read:           dev_read,
+       write:          dev_write,
+       ioctl:          dev_ioctl,
+       open:           dev_open,
+       release:        dev_release,
 };
 
 static int reset_dsp(void)
index 2dc7c2ffcedb83c151b7210ac0ea9f6e9c952ee1..6e17c8f93014efa86fa311ec7674d116e27bd78e 100644 (file)
@@ -1259,19 +1259,10 @@ static int sv_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int
 }
 
 static /*const*/ struct file_operations sv_mixer_fops = {
-       &sv_llseek,
-       NULL,  /* read */
-       NULL,  /* write */
-       NULL,  /* readdir */
-       NULL,  /* poll */
-       &sv_ioctl_mixdev,
-       NULL,  /* mmap */
-       &sv_open_mixdev,
-       NULL,   /* flush */
-       &sv_release_mixdev,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         sv_llseek,
+       ioctl:          sv_ioctl_mixdev,
+       open:           sv_open_mixdev,
+       release:        sv_release_mixdev,
 };
 
 /* --------------------------------------------------------------------- */
@@ -1936,19 +1927,14 @@ static int sv_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations sv_audio_fops = {
-       &sv_llseek,
-       &sv_read,
-       &sv_write,
-       NULL,  /* readdir */
-       &sv_poll,
-       &sv_ioctl,
-       &sv_mmap,
-       &sv_open,
-       NULL,   /* flush */
-       &sv_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         sv_llseek,
+       read:           sv_read,
+       write:          sv_write,
+       poll:           sv_poll,
+       ioctl:          sv_ioctl,
+       mmap:           sv_mmap,
+       open:           sv_open,
+       release:        sv_release,
 };
 
 /* --------------------------------------------------------------------- */
@@ -2220,19 +2206,12 @@ static int sv_midi_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations sv_midi_fops = {
-       &sv_llseek,
-       &sv_midi_read,
-       &sv_midi_write,
-       NULL,  /* readdir */
-       &sv_midi_poll,
-       NULL,  /* ioctl */
-       NULL,  /* mmap */
-       &sv_midi_open,
-       NULL,   /* flush */
-       &sv_midi_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         sv_llseek,
+       read:           sv_midi_read,
+       write:          sv_midi_write,
+       poll:           sv_midi_poll,
+       open:           sv_midi_open,
+       release:        sv_midi_release,
 };
 
 /* --------------------------------------------------------------------- */
@@ -2401,19 +2380,10 @@ static int sv_dmfm_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations sv_dmfm_fops = {
-       &sv_llseek,
-       NULL,  /* read */
-       NULL,  /* write */
-       NULL,  /* readdir */
-       NULL,  /* poll */
-       &sv_dmfm_ioctl,
-       NULL,  /* mmap */
-       &sv_dmfm_open,
-       NULL,   /* flush */
-       &sv_dmfm_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         sv_llseek,
+       ioctl:          sv_dmfm_ioctl,
+       open:           sv_dmfm_open,
+       release:        sv_dmfm_release,
 };
 
 /* --------------------------------------------------------------------- */
index 4bbfe051ad07e357b50e377f765088cf58fddc15..d8a9c2be74392331ba4f1603d1752f7807fd4986 100644 (file)
@@ -778,16 +778,14 @@ static int sound_mmap(struct file *file, struct vm_area_struct *vma)
 
 struct file_operations oss_sound_fops =
 {
-       sound_lseek,
-       sound_read,
-       sound_write,
-       NULL,                   /* sound_readdir */
-       sound_poll,
-       sound_ioctl,
-       sound_mmap,
-       sound_open,
-       NULL,                   /* flush */
-       sound_release
+       llseek:         sound_lseek,
+       read:           sound_read,
+       write:          sound_write,
+       poll:           sound_poll,
+       ioctl:          sound_ioctl,
+       mmap:           sound_mmap,
+       open:           sound_open,
+       release:        sound_release,
 };
 
 /*
index 035c99bd1cfb1b07def1b243264fe6351915e8d2..1860b4505f458ff8462c78d482b7e5f96b59a8f0 100644 (file)
@@ -1832,19 +1832,14 @@ static int trident_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations trident_audio_fops = {
-       &trident_llseek,
-       &trident_read,
-       &trident_write,
-       NULL,   /* readdir */
-       &trident_poll,
-       &trident_ioctl,
-       &trident_mmap,
-       &trident_open,
-       NULL,   /* flush */
-       &trident_release,
-       NULL,   /* fsync */
-       NULL,   /* fasync */
-       NULL,   /* lock */
+       llseek:         trident_llseek,
+       read:           trident_read,
+       write:          trident_write,
+       poll:           trident_poll,
+       ioctl:          trident_ioctl,
+       mmap:           trident_mmap,
+       open:           trident_open,
+       release:        trident_release,
 };
 
 /* trident specific AC97 functions */
@@ -1994,19 +1989,10 @@ static int trident_ioctl_mixdev(struct inode *inode, struct file *file, unsigned
 }
 
 static /*const*/ struct file_operations trident_mixer_fops = {
-       &trident_llseek,
-       NULL,  /* read */
-       NULL,  /* write */
-       NULL,  /* readdir */
-       NULL,  /* poll */
-       &trident_ioctl_mixdev,
-       NULL,  /* mmap */
-       &trident_open_mixdev,
-       NULL,   /* flush */
-       &trident_release_mixdev,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         trident_llseek,
+       ioctl:          trident_ioctl_mixdev,
+       open:           trident_open_mixdev,
+       release:        trident_release_mixdev,
 };
 
 /* AC97 codec initialisation. */
index 811d07ef59708ad15c1b2638ec3338b7f208dc23..c09a204a245f2c319d23b37672ad25017540515c 100644 (file)
@@ -3029,19 +3029,14 @@ static int vwsnd_audio_release(struct inode *inode, struct file *file)
 }
 
 static struct file_operations vwsnd_audio_fops = {
-       &vwsnd_audio_llseek,
-       &vwsnd_audio_read,
-       &vwsnd_audio_write,
-       NULL,                           /* readdir */
-       &vwsnd_audio_poll,
-       &vwsnd_audio_ioctl,
-       &vwsnd_audio_mmap,
-       &vwsnd_audio_open,
-       NULL,                           /* flush */
-       &vwsnd_audio_release,
-       NULL,                           /* fsync */
-       NULL,                           /* fasync */
-       NULL,                           /* lock */
+       llseek:         vwsnd_audio_llseek,
+       read:           vwsnd_audio_read,
+       write:          vwsnd_audio_write,
+       poll:           vwsnd_audio_poll,
+       ioctl:          vwsnd_audio_ioctl,
+       mmap:           vwsnd_audio_mmap,
+       open:           vwsnd_audio_open,
+       release:        vwsnd_audio_release,
 };
 
 /*****************************************************************************/
@@ -3238,19 +3233,10 @@ static int vwsnd_mixer_ioctl(struct inode *ioctl,
 }
 
 static struct file_operations vwsnd_mixer_fops = {
-       &vwsnd_mixer_llseek,
-       NULL,                           /* read */
-       NULL,                           /* write */
-       NULL,                           /* readdir */
-       NULL,                           /* poll */
-       &vwsnd_mixer_ioctl,
-       NULL,                           /* mmap */
-       &vwsnd_mixer_open,
-       NULL,                           /* flush */
-       &vwsnd_mixer_release,
-       NULL,                           /* fsync */
-       NULL,                           /* fasync */
-       NULL,                           /* lock */
+       llseek:         vwsnd_mixer_llseek,
+       ioctl:          vwsnd_mixer_ioctl,
+       open:           vwsnd_mixer_open,
+       release:        vwsnd_mixer_release,
 };
 
 /*****************************************************************************/
index 1fb406dc1fbe3b2b9a03b73577f1db47ef67020a..d7df1790b183a9d9b1542ea4a497e32e3ec091c5 100644 (file)
@@ -2002,19 +2002,10 @@ wavefront_ioctl(struct inode *inode, struct file *file,
 }
 
 static /*const*/ struct file_operations wavefront_fops = {
-       &wavefront_llseek,
-       NULL,  /* read */
-       NULL,  /* write */
-       NULL,  /* readdir */
-       NULL,  /* poll */
-       &wavefront_ioctl,
-       NULL,  /* mmap */
-       &wavefront_open,
-       NULL,  /* flush */
-       &wavefront_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         wavefront_llseek,
+       ioctl:          wavefront_ioctl,
+       open:           wavefront_open,
+       release:        wavefront_release,
 };
 
 \f
index 0d590da2344a548baef62f42f23509ee31052405..9665598b904669be0b8b4e6189329ef53ae1d7ee 100644 (file)
@@ -3922,20 +3922,12 @@ static int ixj_fasync(int fd, struct file *file_p, int mode)
 
 struct file_operations ixj_fops =
 {
-       NULL,                   /* ixj_lseek */
-       ixj_enhanced_read,
-       ixj_enhanced_write,
-       NULL,                   /* ixj_readdir */
-       ixj_poll,
-       ixj_ioctl,
-       NULL,                   /* ixj_mmap */
-//  ixj_open,
-       NULL,                   /* ixj_open */
-       NULL,                   /* ixj_flush */
-       ixj_release,
-       NULL,                   /* ixj_fsync */
-       ixj_fasync,             /* ixj_fasync */
-       NULL                    /* lock */
+       read:           ixj_enhanced_read,
+       write:          ixj_enhanced_write,
+       poll:           ixj_poll,
+       ioctl:          ixj_ioctl,
+       release:        ixj_release,
+       fasync:         ixj_fasync,
 };
 
 static int ixj_linetest(int board)
index fa6d41556274a6c26140bd4051190c4421414539..21f850d9bb1ef59927692b23c4fb4a43fb4fa4e6 100644 (file)
@@ -112,16 +112,7 @@ void phone_unregister_device(struct phone_device *pfd)
 
 static struct file_operations phone_fops =
 {
-       NULL,
-       NULL,
-       NULL,
-       NULL,                   /* readdir */
-       NULL,
-       NULL,
-       NULL,
-       phone_open,
-       NULL,                   /* flush */
-       NULL
+       open:           phone_open,
 };
 
 /*
index 1459f1d103fdd5577264af16a4494babf7644e79..585a8a2780074673e1a8f0bc36267b6f3e6c97b7 100644 (file)
@@ -223,21 +223,25 @@ static void acm_read_bulk(struct urb *urb)
 
        if (!ACM_READY(acm)) return;
 
+       if (urb->status)
+               dbg("nonzero read bulk status received: %d", urb->status);
+
        if (!urb->status & !acm->throttle)  {
                for (i = 0; i < urb->actual_length && !acm->throttle; i++)
                        tty_insert_flip_char(tty, data[i], 0);
                tty_flip_buffer_push(tty);
-       } else
-               dbg("nonzero read bulk status received: %d", urb->status);
+       }
 
-       if (!acm->throttle) {
-               urb->actual_length = 0;
-               if (usb_submit_urb(urb))
-                       dbg("failed resubmitting read urb");
-       } else {
+       if (acm->throttle) {
                memmove(data, data + i, urb->actual_length - i);
                urb->actual_length -= i;
+               return;
        }
+
+       urb->actual_length = 0;
+
+       if (usb_submit_urb(urb))
+               dbg("failed resubmitting read urb");
 }
 
 static void acm_write_bulk(struct urb *urb)
index 708729c4eb1fe0567690a47e87d6e3dfba23ccf5..6bf36689059c5eda8a175597126c27e734ab631b 100644 (file)
@@ -1894,19 +1894,10 @@ static int usb_audio_ioctl_mixdev(struct inode *inode, struct file *file, unsign
 }
 
 static /*const*/ struct file_operations usb_mixer_fops = {
-       &usb_audio_llseek,
-       NULL,  /* read */
-       NULL,  /* write */
-       NULL,  /* readdir */
-       NULL,  /* poll */
-       &usb_audio_ioctl_mixdev,
-       NULL,  /* mmap */
-       &usb_audio_open_mixdev,
-       NULL,   /* flush */
-       &usb_audio_release_mixdev,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         usb_audio_llseek,
+       ioctl:          usb_audio_ioctl_mixdev,
+       open:           usb_audio_open_mixdev,
+       release:        usb_audio_release_mixdev,
 };
 
 /* --------------------------------------------------------------------- */
@@ -2504,19 +2495,14 @@ static int usb_audio_release(struct inode *inode, struct file *file)
 }
 
 static /*const*/ struct file_operations usb_audio_fops = {
-       &usb_audio_llseek,
-       &usb_audio_read,
-       &usb_audio_write,
-       NULL,  /* readdir */
-       &usb_audio_poll,
-       &usb_audio_ioctl,
-       &usb_audio_mmap,
-       &usb_audio_open,
-       NULL,   /* flush */
-       &usb_audio_release,
-       NULL,  /* fsync */
-       NULL,  /* fasync */
-       NULL,  /* lock */
+       llseek:         usb_audio_llseek,
+       read:           usb_audio_read,
+       write:          usb_audio_write,
+       poll:           usb_audio_poll,
+       ioctl:          usb_audio_ioctl,
+       mmap:           usb_audio_mmap,
+       open:           usb_audio_open,
+       release:        usb_audio_release,
 };
 
 /* --------------------------------------------------------------------- */
index 74c19fb5b401826dc27e1ac50b9a51da5cdff853..b67d70ac85ebecf88ba146354267589b9b6a5ada 100644 (file)
@@ -641,7 +641,6 @@ static int dabusb_ioctl (struct inode *inode, struct file *file, unsigned int cm
        pbulk_transfer_t pbulk;
        int ret = 0;
        int version = DABUSB_VERSION;
-       DECLARE_WAITQUEUE (wait, current);
 
        dbg("dabusb_ioctl");
 
@@ -694,23 +693,11 @@ static int dabusb_ioctl (struct inode *inode, struct file *file, unsigned int cm
 
 static struct file_operations dabusb_fops =
 {
-       dabusb_llseek,
-       dabusb_read,
-       NULL,                   /* write */
-       NULL,                   /* readdir */
-       NULL,                   /* poll */
-       dabusb_ioctl,
-       NULL,                   /* mmap */
-       dabusb_open,
-       NULL,                   /* flush */
-       dabusb_release,
-       NULL,                   /* fsync */
-       NULL,                   /* fasync */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38)
-       NULL,                   /* check_media_change */
-       NULL,                   /* revalidate */
-#endif
-       NULL                    /* lock */
+       llseek:         dabusb_llseek,
+       read:           dabusb_read,
+       ioctl:          dabusb_ioctl,
+       open:           dabusb_open,
+       release:        dabusb_release,
 };
 
 static int dabusb_find_struct (void)
index 8b3167a1119ff23b3810a6820633c62633d751e9..db6e69c90d7e38cd279a5d1b839aef32c0baf8b3 100644 (file)
@@ -388,14 +388,13 @@ static char *usb_device_dump(char *start, char *end, struct usb_device *usbdev,
         * index = parent's connector number;
         * count = device count at this level
         */
-       /* If this is the root hub, display the bandwidth information but not the descriptors */
+       /* If this is the root hub, display the bandwidth information */
        if (level == 0)
                start += sprintf(start, format_bandwidth, bus->bandwidth_allocated, 
                                FRAME_TIME_MAX_USECS_ALLOC,
                                (100 * bus->bandwidth_allocated + FRAME_TIME_MAX_USECS_ALLOC / 2) / FRAME_TIME_MAX_USECS_ALLOC,
                                 bus->bandwidth_int_reqs, bus->bandwidth_isoc_reqs);
-       else 
-               start = usb_dump_desc(start, end, usbdev);
+       start = usb_dump_desc(start, end, usbdev);
        if (start > end)
                return start + sprintf(start, "(truncated)\n");
        /* Now look at all of this device's children. */
@@ -514,15 +513,9 @@ static long long usb_device_lseek(struct file * file, long long offset, int orig
 }
 
 struct file_operations usbdevfs_devices_fops = {
-       usb_device_lseek,   /* lseek   */
-       usb_device_read,    /* read    */
-       NULL,               /* write   */
-       NULL,               /* readdir */
-       usb_device_poll,    /* poll    */
-       NULL,               /* ioctl   */
-       NULL,               /* mmap    */
-       usb_device_open,    /* open    */
-       NULL,               /* flush   */
-       usb_device_release, /* release */
-       NULL                /* fsync   */
+       llseek:         usb_device_lseek,
+       read:           usb_device_read,
+       poll:           usb_device_poll,
+       open:           usb_device_open,
+       release:        usb_device_release,
 };
index d395e210adaaa5963a9280785b20107fa4fb4331..82a55ec8e16cc31edafcc250c6d0dbb0eee366a8 100644 (file)
@@ -1003,17 +1003,12 @@ static unsigned int usbdev_poll(struct file *file, struct poll_table_struct *wai
 }
 
 static struct file_operations usbdevfs_device_file_operations = {
-       usbdev_lseek,    /* lseek   */
-       usbdev_read,     /* read    */
-       NULL,            /* write   */
-       NULL,            /* readdir */
-       usbdev_poll,     /* poll    */
-       usbdev_ioctl,    /* ioctl   */
-       NULL,            /* mmap    */
-       usbdev_open,     /* open    */
-       NULL,            /* flush   */
-       usbdev_release,  /* release */
-       NULL             /* fsync   */
+       llseek:         usbdev_lseek,
+       read:           usbdev_read,
+       poll:           usbdev_poll,
+       ioctl:          usbdev_ioctl,
+       open:           usbdev_open,
+       release:        usbdev_release,
 };
 
 struct inode_operations usbdevfs_device_inode_operations = {
index 45413000698469dfb905d1ef98be17e189193e3e..932fca8e053eb5c72c6bbb38807d6adcc8fef61f 100644 (file)
@@ -112,15 +112,6 @@ static long long usb_driver_lseek(struct file * file, long long offset, int orig
 }
 
 struct file_operations usbdevfs_drivers_fops = {
-       usb_driver_lseek, /* lseek   */
-       usb_driver_read,  /* read    */
-       NULL,             /* write   */
-       NULL,             /* readdir */
-       NULL,             /* poll    */
-       NULL,             /* ioctl   */
-       NULL,             /* mmap    */
-       NULL,             /* open    */
-       NULL,             /* flush   */
-       NULL,             /* release */
-       NULL              /* fsync   */
+       llseek:         usb_driver_lseek,
+       read:           usb_driver_read,
 };
index 00a2ac52346180905051d4f43786a7586febdf1f..64405957029fc75df3f18b6eeadfcc11b4bd18df 100644 (file)
@@ -400,21 +400,21 @@ static int usbdevfs_bus_readdir(struct file *filp, void *dirent, filldir_t filld
 }
 
 static struct file_operations usbdevfs_root_file_operations = {
-       readdir: usbdevfs_root_readdir
+       readdir: usbdevfs_root_readdir,
 };
 
 static struct inode_operations usbdevfs_root_inode_operations = {
        default_file_ops: &usbdevfs_root_file_operations,
-       lookup: usbdevfs_root_lookup
+       lookup: usbdevfs_root_lookup,
 };
 
 static struct file_operations usbdevfs_bus_file_operations = {
-       readdir: usbdevfs_bus_readdir
+       readdir: usbdevfs_bus_readdir,
 };
 
 static struct inode_operations usbdevfs_bus_inode_operations = {
        default_file_ops: &usbdevfs_bus_file_operations,
-       lookup: usbdevfs_bus_lookup
+       lookup: usbdevfs_bus_lookup,
 };
 
 static void usbdevfs_read_inode(struct inode *inode)
index 6dacc46b40755a163184951b51315f59ed349c91..b63ddb7e8e87ebca9bed3af580b4c199b0a8e0b8 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * OmniVision OV511 Camera-to-USB Bridge Driver
- * Copyright 1999/2000 Mark W. McClelland
+ * Copyright (c) 1999/2000 Mark W. McClelland
+ * Many improvements by Bret Wallach
  *
  * Based on the Linux CPiA driver.
  * 
@@ -11,7 +12,7 @@
  *    DEBUG - Debugging code.
  *    FIXME - Something that is broken or needs improvement.
  *
- * Version: 1.06
+ * Version: 1.07
  *
  * Please see the file: linux/Documentation/usb/ov511.txt 
  * and the website at:  http://people.delphi.com/mmcclelland/linux/ 
@@ -58,7 +59,7 @@
 #include <linux/wrapper.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
-
+#include <linux/time.h>
 #include <asm/io.h>
 
 #include "usb.h"
@@ -70,9 +71,9 @@
 
 /* Video Size 640 x 480 x 3 bytes for RGB */
 #define MAX_FRAME_SIZE (640 * 480 * 3)
+#define MAX_DATA_SIZE (MAX_FRAME_SIZE + sizeof(struct timeval))
 
-// FIXME - Force CIF to make some apps happy for the moment. Should find a 
-//         better way to do this.
+// FIXME - Should find a better way to do this.
 #define DEFAULT_WIDTH 640
 #define DEFAULT_HEIGHT 480
 
@@ -206,7 +207,7 @@ int ov511_reg_write(struct usb_device *dev, unsigned char reg, unsigned char val
                0, (__u16)reg, &value, 1, HZ);  
                        
 #if 0
-       PDEBUG("reg write: 0x%02X:0x%02X", reg, value);
+       PDEBUG("reg write: 0x%02X:0x%02X, 0x%x", reg, value, rc);
 #endif
                        
        return rc;
@@ -261,10 +262,10 @@ int ov511_i2c_write(struct usb_device *dev, unsigned char reg, unsigned char val
 
                if((rc&2) == 0) /* Ack? */
                        break;
-
+#if 0
                /* I2C abort */ 
                ov511_reg_write(dev, OV511_REG_I2C_CONTROL, 0x10);
-
+#endif
                if (--retries < 0) return -1;
        }
 
@@ -331,6 +332,58 @@ int ov511_i2c_read(struct usb_device *dev, unsigned char reg)
        return (value);
 }
 
+
+// This version doesn't always work
+#if 0
+ /* returns: negative is error, pos or zero is data */
+ int ov511_i2c_read(struct usb_device *dev, unsigned char reg)
+ {
+       int rc, value;
+
+       /* Select camera register */
+       rc = ov511_reg_write(dev, OV511_REG_I2C_SUB_ADDRESS_2_BYTE, reg);
+       if (rc < 0) return rc;
+
+       /* Initiate 2-byte write cycle */
+       rc = ov511_reg_write(dev, OV511_REG_I2C_CONTROL, 0x03);
+       if (rc < 0) return rc;
+
+       /* Initiate 2-byte read cycle */
+       rc = ov511_reg_write(dev, OV511_REG_I2C_CONTROL, 0x05);
+       if (rc < 0) return rc;
+       value = ov511_reg_read(dev, OV511_REG_I2C_DATA_PORT);
+ #if 0
+       PDEBUG("i2c read: 0x%02X:0x%02X", reg, value);
+ #endif
+               
+       return (value);
+ }
+#endif
+
+static int ov511_write_regvals(struct usb_device *dev,
+                              struct ov511_regvals * pRegvals)
+{
+       int ret;
+       while(pRegvals->bus != OV511_DONE_BUS) {
+               if (pRegvals->bus == OV511_REG_BUS) {
+                       if ((ret = ov511_reg_write(dev, pRegvals->reg,
+                                                  pRegvals->val)) < 0)
+                               return ret;
+               } else if (pRegvals->bus == OV511_I2C_BUS) {
+                       if ((ret = ov511_i2c_write(dev, pRegvals->reg, 
+                                                  pRegvals->val)) < 0)
+                               return ret;
+               } else {
+                 err("Bad regval array");
+               }
+               pRegvals++;
+       }
+       return 0;
+}
+
 #if 0
 static void ov511_dump_i2c_range( struct usb_device *dev, int reg1, int regn)
 {
@@ -384,18 +437,6 @@ static void ov511_dump_regs( struct usb_device *dev)
 }
 #endif
 
-int ov511_i2c_reset(struct usb_device *dev)
-{
-       int rc;
-
-       PDEBUG("Reset 7610");
-       rc = ov511_i2c_write(dev, 0x12, 0x80);
-       if (rc < 0)
-               err("i2c reset: command failed");
-
-       return rc;
-}
-
 int ov511_reset(struct usb_device *dev, unsigned char reset_type)
 {
        int rc;
@@ -480,6 +521,21 @@ int ov511_set_packet_size(struct usb_ov511 *ov511, int size)
 static inline int ov7610_set_picture(struct usb_ov511 *ov511,
                                      struct video_picture *p)
 {
+       int ret;
+
+       /* Stop the camera */
+       if (ov511_reg_write(ov511->dev, OV511_REG_SYSTEM_RESET, 0x3d) < 0) {
+               err("reset: command failed");
+               return -EIO;
+       }
+
+       if((ret = ov511_i2c_read(ov511->dev, OV7610_REG_COM_B)) < 0)
+               return -EIO;
+#if 0
+       if(ov511_i2c_write(ov511->dev, OV7610_REG_COM_B, ret & 0xfe) < 0)
+               return -EIO;
+#endif
+
        if(ov511_i2c_write(ov511->dev, OV7610_REG_SAT, p->colour >> 8) < 0)
                return -EIO;
 
@@ -489,6 +545,12 @@ static inline int ov7610_set_picture(struct usb_ov511 *ov511,
        if(ov511_i2c_write(ov511->dev, OV7610_REG_BRT, p->brightness >> 8) < 0)
                return -EIO;
 
+       /* Restart the camera */
+       if (ov511_reg_write(ov511->dev, OV511_REG_SYSTEM_RESET, 0x0) < 0) {
+               err("reset: command failed");
+               return -EIO;
+       }
+
        return 0;
 }
 
@@ -497,6 +559,12 @@ static inline int ov7610_get_picture(struct usb_ov511 *ov511,
 {
        int ret;
 
+       /* Stop the camera */
+       if (ov511_reg_write(ov511->dev, OV511_REG_SYSTEM_RESET, 0x3d) < 0) {
+               err("reset: command failed");
+               return -EIO;
+       }
+
        if((ret = ov511_i2c_read(ov511->dev, OV7610_REG_SAT)) < 0) return -EIO;
        p->colour = ret << 8;
 
@@ -511,43 +579,71 @@ static inline int ov7610_get_picture(struct usb_ov511 *ov511,
        p->depth = 24;
        p->palette = VIDEO_PALETTE_RGB24;
 
+       /* Restart the camera */
+       if (ov511_reg_write(ov511->dev, OV511_REG_SYSTEM_RESET, 0x0) < 0) {
+               err("reset: command failed");
+               return -EIO;
+       }
+
        return 0;
 }
 
 static int ov511_mode_init_regs(struct usb_ov511 *ov511,
-                               int width, int height, int mode)
+                               int width, int height, int mode, int sub_flag)
 {
        int rc = 0;
        struct usb_device *dev = ov511->dev;
 
 #if 0
-       PDEBUG("ov511_mode_init_regs(ov511, %d, %d, %d)", width, height, mode);
+       PDEBUG("ov511_mode_init_regs(ov511, %d, %d, %d, %d)",
+              width, height, mode, sub_flag);
 #endif
-       ov511_set_packet_size(ov511, 0);
 
-       /* Set mode consistent registers */
-       ov511_i2c_write(dev, 0x0f, 0x03);
-       ov511_i2c_write(dev, 0x10, 0xff);
-       ov511_i2c_write(dev, 0x13, 0x01);
-       ov511_i2c_write(dev, 0x16, 0x06);
-       ov511_i2c_write(dev, 0x20, 0x1c);
-       ov511_i2c_write(dev, 0x24, 0x2e); /* 10 */
-       ov511_i2c_write(dev, 0x25, 0x7c); /* 8a */
-       ov511_i2c_write(dev, 0x26, 0x00); /* was 0x70 */
-       ov511_i2c_write(dev, 0x28, 0x24); /* 24 */
-       ov511_i2c_write(dev, 0x2b, 0xac);
-       ov511_i2c_write(dev, 0x2c, 0xfe);
-       ov511_i2c_write(dev, 0x2d, 0x93);
-       ov511_i2c_write(dev, 0x34, 0x8b);
+//     ov511_set_packet_size(ov511, 0);
+       if (ov511_reg_write(dev, OV511_REG_SYSTEM_RESET, 0x3d) < 0) {
+               err("reset: command failed");
+               return -EIO;
+       }
+
+       if (mode == VIDEO_PALETTE_GREY) {
+               ov511_reg_write(dev, 0x16, 0);
+               ov511_i2c_write(dev, 0xe, 0x44);
+               ov511_i2c_write(dev, 0x13, 0x21);
+       } else {
+               ov511_reg_write(dev, 0x16, 1);
+               ov511_i2c_write(dev, 0xe, 0x4);
+               ov511_i2c_write(dev, 0x13, 0x1);
+       }
 
        if (width == 640 && height == 480) {
-               ov511_reg_write(dev, 0x12, 0x4f);
-               ov511_reg_write(dev, 0x13, 0x3d);
+               if (sub_flag) {
+                       ov511_i2c_write(ov511->dev, 0x17, 0x38+(ov511->subx>>2));
+                       ov511_i2c_write(ov511->dev, 0x18,
+                                       0x3a+((ov511->subx+ov511->subw)>>2));
+                       ov511_i2c_write(ov511->dev, 0x19, 0x5+(ov511->suby>>1));
+                       ov511_i2c_write(ov511->dev, 0x1a,
+                                       0x5+((ov511->suby+ov511->subh)>>1));
+                       ov511_reg_write(ov511->dev, 0x12, (ov511->subw>>3)-1);
+                       ov511_reg_write(ov511->dev, 0x13, (ov511->subh>>3)-1);
+                       ov511_i2c_write(dev, 0x11, 0x01);
+               } else {
+                       ov511_i2c_write(ov511->dev, 0x17, 0x38);
+                       ov511_i2c_write(ov511->dev, 0x18, 0x3a + (640>>2));
+                       ov511_i2c_write(ov511->dev, 0x19, 0x5);
+                       ov511_i2c_write(ov511->dev, 0x1c, + (480>>1));
+                       ov511_reg_write(dev, 0x12, 0x4f);
+                       ov511_reg_write(dev, 0x13, 0x3d);
+                       if (mode == VIDEO_PALETTE_GREY) {
+                         ov511_i2c_write(dev, 0x11, 4); /* check */
+                       } else {
+                         ov511_i2c_write(dev, 0x11, 6); /* check */
+                       }
+               }
+
                ov511_reg_write(dev, 0x14, 0x00);
                ov511_reg_write(dev, 0x15, 0x00);
                ov511_reg_write(dev, 0x18, 0x03);
 
-               ov511_i2c_write(dev, 0x11, 0x01);
                ov511_i2c_write(dev, 0x12, 0x24);
                ov511_i2c_write(dev, 0x14, 0x04);
                ov511_i2c_write(dev, 0x35, 0x9e);
@@ -558,7 +654,12 @@ static int ov511_mode_init_regs(struct usb_ov511 *ov511,
                ov511_reg_write(dev, 0x15, 0x00);
                ov511_reg_write(dev, 0x18, 0x03);
 
-               ov511_i2c_write(dev, 0x11, 0x00);
+               if (mode == VIDEO_PALETTE_GREY) {
+                 ov511_i2c_write(dev, 0x11, 1); /* check */
+               } else {
+                 ov511_i2c_write(dev, 0x11, 1); /* check */
+               }
+
                ov511_i2c_write(dev, 0x12, 0x04);
                ov511_i2c_write(dev, 0x14, 0x24);
                ov511_i2c_write(dev, 0x35, 0x1e);
@@ -566,7 +667,13 @@ static int ov511_mode_init_regs(struct usb_ov511 *ov511,
                err("Unknown mode (%d, %d): %d", width, height, mode);
                rc = -EINVAL;
        }
-       ov511_set_packet_size(ov511, 993);
+
+//     ov511_set_packet_size(ov511, 993);
+
+       if (ov511_reg_write(dev, OV511_REG_SYSTEM_RESET, 0x00) < 0) {
+               PDEBUG("reset: command failed");
+               return -EIO;
+       }
 
        return rc;
 }
@@ -633,25 +740,20 @@ this data is scrambled.
 #define HDIV 8
 #define WDIV (256/HDIV)
 
-static void ov511_parse_data(unsigned char * pIn0,
-                            unsigned char * pOut0,
-                            int iWidth,
-                            int iSegment)
-                           
+
+static void ov511_parse_data_rgb24(unsigned char * pIn0,
+                                  unsigned char * pOut0,
+                                  int iOutY,
+                                  int iOutUV,
+                                  int iHalf,
+                                  int iWidth)
+                                                   
 {
 #ifndef OV511_DUMPPIX
     int k, l, m;
     unsigned char * pIn;
     unsigned char * pOut, * pOut1;
 
-    int iHalf = (iSegment / (iWidth / 32)) & 1;
-    int iY     = iSegment / (iWidth / WDIV);
-    int jY     = iSegment - iY * (iWidth / WDIV);
-    int iOutY  = (iY*HDIV*iWidth + jY*WDIV) * 3;
-    int iUV    = iSegment / (iWidth / WDIV * 2);
-    int jUV    = iSegment - iUV * (iWidth / WDIV * 2);
-    int iOutUV = (iUV*HDIV*2*iWidth + jUV*WDIV/2) * 3;
-
     /* Just copy the Y's if in the first stripe */
     if (!iHalf) {
        pIn = pIn0 + 128;
@@ -723,13 +825,49 @@ static void ov511_parse_data(unsigned char * pIn0,
 #else
        /* Just dump pix data straight out for debug */
        int i;
-       pOut0 += iSegment * 384;
+       pOut0 += iSegmentY * 384;
        for(i=0; i<384; i++) {
          *pOut0++ = *pIn0++;
        }
 #endif
 }
 
+/***************************************************************
+
+For 640x480 RAW BW images, data shows up in 1200 256 byte segments.
+The segments represent 4 squares of 8x8 pixels as
+follows:
+
+  0  1 ...  7    64  65 ...  71   ...  192 193 ... 199
+  8  9 ... 15    72  73 ...  79        200 201 ... 207
+       ...              ...                    ...
+ 56 57 ... 63   120 121     127        248 249 ... 255
+
+****************************************************************/ 
+static void ov511_parse_data_grey(unsigned char * pIn0,
+                                 unsigned char * pOut0,
+                                 int iOutY,
+                                 int iWidth)
+                           
+{
+    int k, l, m;
+    unsigned char * pIn;
+    unsigned char * pOut, * pOut1;
+
+    pIn = pIn0;
+    pOut = pOut0 + iOutY;
+    for(k=0; k<4; k++) {
+      pOut1 = pOut;
+      for(l=0; l<8; l++) {
+       for(m=0; m<8; m++) {
+         *pOut1++ = *pIn++;
+       }
+       pOut1 += iWidth - 8;
+      }
+      pOut += 8;
+    }
+}
+
 static int ov511_move_data(struct usb_ov511 *ov511, urb_t *urb)
 {
        unsigned char *cdata;
@@ -741,12 +879,13 @@ static int ov511_move_data(struct usb_ov511 *ov511, urb_t *urb)
                int n = urb->iso_frame_desc[i].actual_length;
                int st = urb->iso_frame_desc[i].status;
                urb->iso_frame_desc[i].actual_length = 0;
-               urb->iso_frame_desc[i].status = 0;              
+               urb->iso_frame_desc[i].status = 0;
                cdata = urb->transfer_buffer + urb->iso_frame_desc[i].offset;
 
                aPackNum[i] = n ? cdata[992] : -1;
 
                if (!n || ov511->curframe == -1) continue;
+
                if (st)
                        PDEBUG("data error: [%d] len=%d, status=%d", i, n, st);
 
@@ -757,33 +896,35 @@ static int ov511_move_data(struct usb_ov511 *ov511, urb_t *urb)
                     cdata[4] | cdata[5] | cdata[6] | cdata[7]) == 0 &&
                    (cdata[8] & 8) && (cdata[8] & 0x80)) {
 
+                   struct timeval *ts;
+                   ts = (struct timeval *)(frame->data + MAX_FRAME_SIZE);
+                   do_gettimeofday(ts);
 #if 0
-                   PDEBUG("Found Frame End!, packnum = %d", (int)(cdata[992]));
-                   PDEBUG("Current frame = %d", ov511->curframe);
+                   PDEBUG("Frame End, curframe = %d, packnum=%d, hw=%d, vw=%d",
+                          ov511->curframe, (int)(cdata[992]),
+                          (int)(cdata[9]), (int)(cdata[10]));
 #endif
 
                    if (frame->scanstate == STATE_LINES) {
                        int iFrameNext;
+                               frame->grabstate = FRAME_DONE;
                        if (waitqueue_active(&frame->wq)) {
+                                       frame->grabstate = FRAME_DONE;
+                                       wake_up_interruptible(&frame->wq);
+                               }
+                               /* If next frame is ready or grabbing, point to it */
+                               iFrameNext = (ov511->curframe + 1) % OV511_NUMFRAMES;
+                               if (ov511->frame[iFrameNext].grabstate== FRAME_READY ||
+                                   ov511->frame[iFrameNext].grabstate== FRAME_GRABBING) {
+                                 ov511->curframe = iFrameNext;
+                                 ov511->frame[iFrameNext].scanstate = STATE_SCANNING;
+                               } else {
 #if 0
-                         PDEBUG("About to wake up waiting processes");
-#endif
-                         frame->grabstate = FRAME_DONE;
-                         wake_up_interruptible(&frame->wq);
-                       }
-                       /* If next frame is ready or grabbing, point to it */
-                       iFrameNext = (ov511->curframe + 1) % OV511_NUMFRAMES;
-                       if (ov511->frame[iFrameNext].grabstate== FRAME_READY ||
-                           ov511->frame[iFrameNext].grabstate== FRAME_GRABBING) {
-                         ov511->curframe = iFrameNext;
-                         frame->scanstate = STATE_SCANNING;
-                       } else {
-#if 0
-                         PDEBUG("Frame not ready? state = %d",
-                                ov511->frame[iFrameNext].grabstate);
+                                 PDEBUG("Frame not ready? state = %d",
+                                        ov511->frame[iFrameNext].grabstate);
 #endif
-                         ov511->curframe = -1;
-                       }
+                                 ov511->curframe = -1;
+                               }
                    }
                }
 
@@ -792,8 +933,8 @@ static int ov511_move_data(struct usb_ov511 *ov511, urb_t *urb)
                          cdata[4] | cdata[5] | cdata[6] | cdata[7]) == 0 &&
                         (cdata[8] & 8)) {
 #if 0
-                       PDEBUG("ov511: Found Frame Start!, packnum = %d", (int)(cdata[992]));
-                       PDEBUG("ov511: Frame Header Byte = 0x%x", (int)(cdata[8]));
+                       PDEBUG("ov511: Found Frame Start!, framenum = %d",
+                              ov511->curframe);
 #endif
                    frame->scanstate = STATE_LINES;
                        frame->segment = 0;
@@ -808,26 +949,67 @@ static int ov511_move_data(struct usb_ov511 *ov511, urb_t *urb)
                        if (frame->segment) {
                          pData = ov511->scratch;
                          iPix = - ov511->scratchlen;
-                         memmove(pData + ov511->scratchlen, cdata, iPix+384);
-                 } else {
+                         memmove(pData + ov511->scratchlen, cdata,
+                                 iPix+frame->segsize);
+                       } else {
                          pData = &cdata[iPix = 9];
-                 }
+                       }
 
                        /* Parse the segments */
-                       while(iPix <= 992 - 384 &&
+                       while(iPix <= 992 - frame->segsize &&
                              frame->segment < frame->width * frame->height / 256) {
-                         ov511_parse_data(pData, frame->data,
-                                          frame->width,
-                                          frame->segment);
+                         int iSegY;
+                         int iSegUV;
+                         int iY, jY, iUV, jUV;
+                         int iOutY, iOutUV;
+                         unsigned char * pOut;
+
+                         iSegY = iSegUV = frame->segment;
+                         pOut = frame->data;
+                         
                          frame->segment++;
-                         iPix += 384;
+                         iPix += frame->segsize;
+
+                         if (frame->sub_flag) {
+                           int iSeg1;
+                           iSeg1 = iSegY / (ov511->subw / 32);
+                           iSeg1 *= frame->width / 32;
+                           iSegY = iSeg1 + (iSegY % (ov511->subw / 32));
+                           if (iSegY >= frame->width * ov511->subh / 256)
+                             break;
+
+                           iSeg1 = iSegUV / (ov511->subw / 16);
+                           iSeg1 *= frame->width / 16;
+                           iSegUV = iSeg1 + (iSegUV % (ov511->subw / 16));
+
+                           pOut += (ov511->subx +
+                                    ov511->suby * frame->width) * frame->depth;
+                         }
+
+                         iY     = iSegY / (frame->width / WDIV);
+                         jY     = iSegY - iY * (frame->width / WDIV);
+                         iOutY  = (iY*HDIV*frame->width + jY*WDIV) * frame->depth;
+                         iUV    = iSegUV / (frame->width / WDIV * 2);
+                         jUV    = iSegUV - iUV * (frame->width / WDIV * 2);
+                         iOutUV = (iUV*HDIV*2*frame->width + jUV*WDIV/2) * frame->depth;
+
+                         if (frame->format == VIDEO_PALETTE_GREY) {
+                           ov511_parse_data_grey(pData, pOut, iOutY, frame->width);
+                         } else if (frame->format == VIDEO_PALETTE_RGB24) {
+                           ov511_parse_data_rgb24(pData, pOut, iOutY, iOutUV, iY & 1,
+                                                  frame->width);
+                         }
                          pData = &cdata[iPix];
-               }
+                       }
 
                        /* Save extra data for next time */
                        if (frame->segment < frame->width * frame->height / 256) {
-                         memmove(ov511->scratch, pData, 992 - iPix);
                          ov511->scratchlen = 992 - iPix;
+                         if (ov511->scratchlen < frame->segsize) {
+                           memmove(ov511->scratch, pData, ov511->scratchlen);
+                         } else {
+                           ov511->scratchlen = 0;
+                         }
                        }
                }
        }
@@ -845,7 +1027,9 @@ static void ov511_isoc_irq(struct urb *urb)
        int len;
        struct usb_ov511 *ov511 = urb->context;
        struct ov511_sbuf *sbuf;
-       int i;
+
+       if (!ov511->dev)
+               return;
 
        if (!ov511->streaming) {
                PDEBUG("hmmm... not streaming, but got interrupt\n");
@@ -855,14 +1039,10 @@ static void ov511_isoc_irq(struct urb *urb)
        sbuf = &ov511->sbuf[ov511->cursbuf];
 
        /* Copy the data received into our scratch buffer */
-       if (ov511->curframe >= 0) {
+       if (ov511->curframe >= 0)
          len = ov511_move_data(ov511, urb);
-       }
-
-       for (i = 0; i < FRAMES_PER_DESC; i++) {
-               sbuf->urb->iso_frame_desc[i].status = 0;
-               sbuf->urb->iso_frame_desc[i].actual_length = 0;
-       }
+       else if (waitqueue_active(&ov511->wq))
+         wake_up_interruptible(&ov511->wq);
        
        /* Move to the next sbuf */
        ov511->cursbuf = (ov511->cursbuf + 1) % OV511_NUMSBUF;
@@ -872,7 +1052,6 @@ static void ov511_isoc_irq(struct urb *urb)
 
 static int ov511_init_isoc(struct usb_ov511 *ov511)
 {
-       struct usb_device *dev = ov511->dev;
        urb_t *urb;
        int fx, err;
        
@@ -891,9 +1070,9 @@ static int ov511_init_isoc(struct usb_ov511 *ov511)
                return -ENOMEM;
        }
        ov511->sbuf[0].urb = urb;
-       urb->dev = dev;
+       urb->dev = ov511->dev;
        urb->context = ov511;
-       urb->pipe = usb_rcvisocpipe(dev, OV511_ENDPOINT_ADDRESS);
+       urb->pipe = usb_rcvisocpipe(ov511->dev, OV511_ENDPOINT_ADDRESS);
        urb->transfer_flags = USB_ISO_ASAP;
        urb->transfer_buffer = ov511->sbuf[0].data;
        urb->complete = ov511_isoc_irq;
@@ -910,9 +1089,9 @@ static int ov511_init_isoc(struct usb_ov511 *ov511)
                return -ENOMEM;
        }
        ov511->sbuf[1].urb = urb;
-       urb->dev = dev;
+       urb->dev = ov511->dev;
        urb->context = ov511;
-       urb->pipe = usb_rcvisocpipe(dev, OV511_ENDPOINT_ADDRESS);
+       urb->pipe = usb_rcvisocpipe(ov511->dev, OV511_ENDPOINT_ADDRESS);
        urb->transfer_flags = USB_ISO_ASAP;
        urb->transfer_buffer = ov511->sbuf[1].data;
        urb->complete = ov511_isoc_irq;
@@ -928,10 +1107,10 @@ static int ov511_init_isoc(struct usb_ov511 *ov511)
 
        err = usb_submit_urb(ov511->sbuf[0].urb);
        if (err)
-               err("ov511_init_isoc: usb_run_isoc(0) ret %d", err);
+               err("ov511_init_isoc: usb_submit_urb(0) ret %d", err);
        err = usb_submit_urb(ov511->sbuf[1].urb);
        if (err)
-               err("ov511_init_isoc: usb_run_isoc(1) ret %d", err);
+               err("ov511_init_isoc: usb_submit_urb(1) ret %d", err);
 
        ov511->streaming = 1;
 
@@ -941,27 +1120,37 @@ static int ov511_init_isoc(struct usb_ov511 *ov511)
 
 static void ov511_stop_isoc(struct usb_ov511 *ov511)
 {
-       if (!ov511->streaming)
+       if (!ov511->streaming || !ov511->dev)
                return;
 
        ov511_set_packet_size(ov511, 0);
-       
-       /* Unschedule all of the iso td's */
-       usb_unlink_urb(ov511->sbuf[1].urb);
-       usb_unlink_urb(ov511->sbuf[0].urb);
 
        ov511->streaming = 0;
 
-       /* Delete them all */
-       usb_free_urb(ov511->sbuf[1].urb);
-       usb_free_urb(ov511->sbuf[0].urb);
+       /* Unschedule all of the iso td's */
+       if (ov511->sbuf[1].urb) {
+               ov511->sbuf[1].urb->next = NULL;
+               usb_unlink_urb(ov511->sbuf[1].urb);
+               usb_free_urb(ov511->sbuf[1].urb);
+               ov511->sbuf[1].urb = NULL;
+       }
+       if (ov511->sbuf[0].urb) {
+               ov511->sbuf[0].urb->next = NULL;
+               usb_unlink_urb(ov511->sbuf[0].urb);
+               usb_free_urb(ov511->sbuf[0].urb);
+               ov511->sbuf[0].urb = NULL;
+       }
 }
 
 static int ov511_new_frame(struct usb_ov511 *ov511, int framenum)
 {
+#if 1
        struct ov511_frame *frame;
        int width, height;
 
+       if (!ov511->dev)
+               return -1;
+
        /* If we're not grabbing a frame right now and the other frame is */
        /*  ready to be grabbed into, then use it instead */
        if (ov511->curframe == -1) {
@@ -988,15 +1177,15 @@ static int ov511_new_frame(struct usb_ov511 *ov511, int framenum)
        if (height > DEFAULT_HEIGHT)
                height = DEFAULT_HEIGHT;
        height = (height / 4) * 4;      /* Multiple of 4 */
-       
+
 //     /* We want a fresh frame every 30 we get */
 //     ov511->compress = (ov511->compress + 1) % 30;
 
+#endif
        return 0;
 }
 
 
-
 /* Video 4 Linux API */
 static int ov511_open(struct video_device *dev, int flags)
 {
@@ -1004,23 +1193,24 @@ static int ov511_open(struct video_device *dev, int flags)
        struct usb_ov511 *ov511 = (struct usb_ov511 *)dev;
 
        PDEBUG("ov511_open");
-       
+
        down(&ov511->lock);
        if (ov511->user)
                goto out_unlock;
-               
+
        ov511->frame[0].grabstate = FRAME_UNUSED;
        ov511->frame[1].grabstate = FRAME_UNUSED;
 
        err = -ENOMEM;
-       
-       /* Allocate memory for the frame buffers */                             
-       ov511->fbuf = rvmalloc(2 * MAX_FRAME_SIZE);
+
+       /* Allocate memory for the frame buffers */
+       ov511->fbuf = rvmalloc(2 * MAX_DATA_SIZE);
        if (!ov511->fbuf)
                goto open_err_ret;
 
        ov511->frame[0].data = ov511->fbuf;
-       ov511->frame[1].data = ov511->fbuf + MAX_FRAME_SIZE;
+       ov511->frame[1].data = ov511->fbuf + MAX_DATA_SIZE;
+       ov511->sub_flag = 0;
 
        PDEBUG("frame [0] @ %p", ov511->frame[0].data);
        PDEBUG("frame [1] @ %p", ov511->frame[1].data);
@@ -1051,7 +1241,7 @@ open_err_on2:
 open_err_on1:
        kfree (ov511->sbuf[0].data);
 open_err_on0:
-       rvfree(ov511->fbuf, 2 * MAX_FRAME_SIZE);
+       rvfree(ov511->fbuf, 2 * MAX_DATA_SIZE);
 open_err_ret:
        return err;
 out_unlock:
@@ -1073,12 +1263,17 @@ static void ov511_close(struct video_device *dev)
 
        ov511_stop_isoc(ov511);
 
-       rvfree(ov511->fbuf, 2 * MAX_FRAME_SIZE);
+       rvfree(ov511->fbuf, 2 * MAX_DATA_SIZE);
 
        kfree(ov511->sbuf[1].data);
        kfree(ov511->sbuf[0].data);
 
        up(&ov511->lock);
+
+       if (!ov511->dev) {
+               video_unregister_device(&ov511->vdev);
+               kfree(ov511);
+       }
 }
 
 static int ov511_init_done(struct video_device *dev)
@@ -1091,13 +1286,16 @@ static long ov511_write(struct video_device *dev, const char *buf, unsigned long
        return -EINVAL;
 }
 
-// FIXME - Needs much work!!!
 static int ov511_ioctl(struct video_device *vdev, unsigned int cmd, void *arg)
 {
        struct usb_ov511 *ov511 = (struct usb_ov511 *)vdev;
 #if 0  
        PDEBUG("IOCtl: 0x%X", cmd);
 #endif 
+
+       if (!ov511->dev)
+               return -EIO;    
+
        switch (cmd) {
                case VIDIOCGCAP:
                {
@@ -1109,8 +1307,8 @@ static int ov511_ioctl(struct video_device *vdev, unsigned int cmd, void *arg)
                        b.audios = 0;
                        b.maxwidth = DEFAULT_WIDTH;
                        b.maxheight = DEFAULT_HEIGHT;
-                       b.minwidth = 8;
-                       b.minheight = 4;
+                       b.minwidth = 32;
+                       b.minheight = 16;
 
                        if (copy_to_user(arg, &b, sizeof(b)))
                                return -EFAULT;
@@ -1173,6 +1371,42 @@ static int ov511_ioctl(struct video_device *vdev, unsigned int cmd, void *arg)
 
                        return 0;
                }
+               case VIDIOCGCAPTURE:
+               {
+                       int vf;
+                       if (copy_from_user(&vf, arg, sizeof(vf)))
+                               return -EFAULT;
+                       ov511->sub_flag = vf;
+                       return 0;
+               }
+               case VIDIOCSCAPTURE:
+               {
+                       struct video_capture vc;
+
+                       if (copy_from_user(&vc, arg, sizeof(vc)))
+                               return -EFAULT;
+                       if (vc.flags)
+                               return -EINVAL;
+                       if (vc.decimation)
+                               return -EINVAL;
+                       vc.x /= 4;
+                       vc.x *= 4;
+                       vc.y /= 2;
+                       vc.y *= 2;
+                       vc.width /= 32;
+                       vc.width *= 32;
+                       if (vc.width == 0) vc.width = 32;
+                       vc.height /= 16;
+                       vc.height *= 16;
+                       if (vc.height == 0) vc.height = 16;
+
+                       ov511->subx = vc.x;
+                       ov511->suby = vc.y;
+                       ov511->subw = vc.width;
+                       ov511->subh = vc.height;
+
+                       return 0;
+               }
                case VIDIOCSWIN:
                {
                        struct video_window vw;
@@ -1213,10 +1447,10 @@ static int ov511_ioctl(struct video_device *vdev, unsigned int cmd, void *arg)
                        struct video_mbuf vm;
 
                        memset(&vm, 0, sizeof(vm));
-                       vm.size = MAX_FRAME_SIZE * 2;
+                       vm.size = 2 * MAX_DATA_SIZE;
                        vm.frames = 2;
                        vm.offsets[0] = 0;
-                       vm.offsets[1] = MAX_FRAME_SIZE;
+                       vm.offsets[1] = MAX_FRAME_SIZE + sizeof (struct timeval);
 
                        if (copy_to_user((void *)arg, (void *)&vm, sizeof(vm)))
                                return -EFAULT;
@@ -1236,7 +1470,8 @@ static int ov511_ioctl(struct video_device *vdev, unsigned int cmd, void *arg)
                                vm.frame, vm.width, vm.height, vm.format);
 #endif
 
-                       if (vm.format != VIDEO_PALETTE_RGB24)
+                       if (vm.format != VIDEO_PALETTE_RGB24 &&
+                           vm.format != VIDEO_PALETTE_GREY)
                                return -EINVAL;
 
                        if ((vm.frame != 0) && (vm.frame != 1))
@@ -1247,18 +1482,27 @@ static int ov511_ioctl(struct video_device *vdev, unsigned int cmd, void *arg)
 
                        /* Don't compress if the size changed */
                        if ((ov511->frame[vm.frame].width != vm.width) ||
-                           (ov511->frame[vm.frame].height != vm.height)) {
-                               ov511->compress = 0;
+                           (ov511->frame[vm.frame].height != vm.height) ||
+                           (ov511->frame[vm.frame].format != vm.format) ||
+                           (ov511->frame[vm.frame].sub_flag !=
+                            ov511->sub_flag)) {
+                               /* If we're collecting previous frame wait
+                                  before changing modes */
+                               interruptible_sleep_on(&ov511->wq);
+                               if (signal_pending(current)) return -EINTR;
                                ov511_mode_init_regs(ov511,
-                                                    vm.width, vm.height, 0);
-#if 0
-                               PDEBUG("ov511: Setting frame %d to (%d, %d) : %d",
-                                      vm.frame, vm.width, vm.height, 0);
-#endif
+                                                    vm.width, vm.height,
+                                                    vm.format, ov511->sub_flag);
                        }
 
                        ov511->frame[vm.frame].width = vm.width;
                        ov511->frame[vm.frame].height = vm.height;
+                       ov511->frame[vm.frame].format = vm.format;
+                       ov511->frame[vm.frame].sub_flag = ov511->sub_flag;
+                       ov511->frame[vm.frame].segsize =
+                         vm.format == VIDEO_PALETTE_RGB24 ? 384 : 256;
+                       ov511->frame[vm.frame].depth =
+                         vm.format == VIDEO_PALETTE_RGB24 ? 3 : 1;
 
                        /* Mark it as ready */
                        ov511->frame[vm.frame].grabstate = FRAME_READY;
@@ -1273,7 +1517,8 @@ static int ov511_ioctl(struct video_device *vdev, unsigned int cmd, void *arg)
                                return -EFAULT;
 
 #if 0
-                       PDEBUG("syncing to frame %d", frame);
+                       PDEBUG("syncing to frame %d, grabstate = %d", frame,
+                              ov511->frame[frame].grabstate);
 #endif
                        switch (ov511->frame[frame].grabstate) {
                                case FRAME_UNUSED:
@@ -1282,6 +1527,9 @@ static int ov511_ioctl(struct video_device *vdev, unsigned int cmd, void *arg)
                                case FRAME_GRABBING:
                                case FRAME_ERROR:
 redo:
+                               if (!ov511->dev)
+                                       return -EIO;
+
                                do {
 #if 0
                                        init_waitqueue_head(&ov511->frame[frame].wq);
@@ -1351,6 +1599,9 @@ static long ov511_read(struct video_device *dev, char *buf, unsigned long count,
        if (!dev || !buf)
                return -EFAULT;
 
+       if (!ov511->dev)
+               return -EIO;
+
        /* See if a frame is completed, then use it. */
        if (ov511->frame[0].grabstate >= FRAME_DONE)    /* _DONE or _ERROR */
                frmx = 0;
@@ -1376,6 +1627,9 @@ static long ov511_read(struct video_device *dev, char *buf, unsigned long count,
        frame = &ov511->frame[frmx];
 
 restart:
+       if (!ov511->dev)
+               return -EIO;
+
        while (frame->grabstate == FRAME_GRABBING) {
                interruptible_sleep_on(&ov511->frame[frmx].wq);
                if (signal_pending(current))
@@ -1422,9 +1676,12 @@ static int ov511_mmap(struct video_device *dev, const char *adr, unsigned long s
        unsigned long start = (unsigned long)adr;
        unsigned long page, pos;
 
+       if (!ov511->dev)
+               return -EIO;
+
        PDEBUG("mmap: %ld (%lX) bytes", size, size);
 
-       if (size > (((2 * MAX_FRAME_SIZE) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))
+       if (size > (((2 * MAX_DATA_SIZE) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))
                return -EINVAL;
 
        pos = (unsigned long)ov511->fbuf;
@@ -1444,11 +1701,10 @@ static int ov511_mmap(struct video_device *dev, const char *adr, unsigned long s
        return 0;
 }
 
-// FIXME - needs V4L ID to be assigned
 static struct video_device ov511_template = {
        "OV511 USB Camera",
        VID_TYPE_CAPTURE,
-       VID_HARDWARE_CPIA,  /* FIXME */
+       VID_HARDWARE_OV511,
        ov511_open,
        ov511_close,
        ov511_read,
@@ -1471,25 +1727,17 @@ static int ov7610_configure(struct usb_device *dev)
        if(ov511_reg_write(dev, OV511_REG_I2C_SLAVE_ID_READ,
                                OV7610_I2C_READ_ID) < 0)
                return -1;
-       
-       /* Reset the camera chip */
-       if (ov511_i2c_reset(dev) < 0)
-               return -1;
 
-#if 0
-       if(usb_ov511_reg_write(dev, OV511_REG_I2C_CLOCK_PRESCALER,
-                                   OV511_I2C_CLOCK_PRESCALER))
-               return -1;
-#endif
-       
        if (ov511_reset(dev, OV511_RESET_NOREGS) < 0)
                return -1;
        
+       if (ov511_i2c_write(dev, 0x12, 0x80) < 0) return -1;
+       schedule_timeout (1 + 150 * HZ / 1000);
+
        /* Dummy read to sync I2C */
        if(ov511_i2c_read(dev, 0x00) < 0)
                return -1;
-       
-
        if((ov511_i2c_read(dev, OV7610_REG_ID_HIGH) != 0x7F) ||
           (ov511_i2c_read(dev, OV7610_REG_ID_LOW) != 0xA2)) {
                err("Failed to read OV7610 ID. You might not have an OV7610,");
@@ -1504,6 +1752,74 @@ static int ov7610_configure(struct usb_device *dev)
 static int ov511_configure(struct usb_ov511 *ov511)
 {
        struct usb_device *dev = ov511->dev;
+       int rc;
+
+       static struct ov511_regvals aRegvalsInit[] =
+       {{OV511_REG_BUS,  OV511_REG_SYSTEM_RESET, 0x7f},
+        {OV511_REG_BUS,  OV511_REG_SYSTEM_INIT, 0x01},
+        {OV511_REG_BUS,  OV511_REG_SYSTEM_RESET, 0x7f},
+        {OV511_REG_BUS,  OV511_REG_SYSTEM_INIT, 0x01},
+        {OV511_REG_BUS,  OV511_REG_SYSTEM_RESET, 0x3f},
+        {OV511_REG_BUS,  OV511_REG_SYSTEM_INIT, 0x01},
+        {OV511_REG_BUS,  OV511_REG_SYSTEM_RESET, 0x3d},
+        {OV511_DONE_BUS, 0x0, 0x00},
+       };
+       static struct ov511_regvals aRegvalsNorm[] =
+       {{OV511_REG_BUS, 0x20, 1},
+#if 1
+        {OV511_REG_BUS, 0x52, 0x02},
+        {OV511_REG_BUS, 0x52, 0x00},
+        {OV511_REG_BUS, 0x31, 0x1f}, /* 0f */
+        {OV511_REG_BUS, 0x70, 0x3f},
+        {OV511_REG_BUS, 0x71, 0x3f},
+        {OV511_REG_BUS, 0x72, 0x01},
+        {OV511_REG_BUS, 0x73, 0x01},
+        {OV511_REG_BUS, 0x74, 0x01},
+        {OV511_REG_BUS, 0x75, 0x01},
+        {OV511_REG_BUS, 0x76, 0x01},
+        {OV511_REG_BUS, 0x77, 0x01},
+        {OV511_REG_BUS, 0x78, 0x06},
+        {OV511_REG_BUS, 0x79, 0x03},
+
+
+        {OV511_I2C_BUS, 0x10, 0xff},
+        {OV511_I2C_BUS, 0x16, 0x06},
+        {OV511_I2C_BUS, 0x28, 0x24}, /* 24 */
+        {OV511_I2C_BUS, 0x2b, 0xac},
+        {OV511_I2C_BUS, 0x5, 0x00},
+        {OV511_I2C_BUS, 0x6, 0x00},
+#if 0
+#endif
+        {OV511_I2C_BUS, 0x12, 0x00},
+        {OV511_I2C_BUS, 0x13, 0x00},
+        {OV511_I2C_BUS, 0x38, 0x81},
+        {OV511_I2C_BUS, 0x28, 0x24}, /* 0c */
+        {OV511_I2C_BUS, 0x05, 0x00},
+        {OV511_I2C_BUS, 0x0f, 0x05},
+        {OV511_I2C_BUS, 0x15, 0x01},
+        {OV511_I2C_BUS, 0x20, 0x1c},
+        {OV511_I2C_BUS, 0x23, 0x2a},
+        {OV511_I2C_BUS, 0x24, 0x10},
+        {OV511_I2C_BUS, 0x25, 0x8a},
+        {OV511_I2C_BUS, 0x26, 0x90},
+        {OV511_I2C_BUS, 0x27, 0xc2},
+        {OV511_I2C_BUS, 0x29, 0x03}, /* 91 */
+        {OV511_I2C_BUS, 0x2a, 0x04},
+        {OV511_I2C_BUS, 0x2c, 0xfe},
+        {OV511_I2C_BUS, 0x2d, 0x93}, /* d7 */
+        {OV511_I2C_BUS, 0x30, 0x71},
+        {OV511_I2C_BUS, 0x31, 0x60},
+        {OV511_I2C_BUS, 0x32, 0x26},
+        {OV511_I2C_BUS, 0x33, 0x20},
+        {OV511_I2C_BUS, 0x34, 0x48},
+        {OV511_I2C_BUS, 0x12, 0x24},
+        {OV511_I2C_BUS, 0x13, 0x01},
+        {OV511_I2C_BUS, 0x11, 0x01},
+        {OV511_I2C_BUS, 0x0c, 0x24},
+        {OV511_I2C_BUS, 0x0d, 0x24},
+#endif
+        {OV511_DONE_BUS, 0x0, 0x00},
+       };
 
        /* Set altsetting 0 */
        if (usb_set_interface(dev, ov511->iface, 0) < 0) {
@@ -1515,25 +1831,15 @@ static int ov511_configure(struct usb_ov511 *ov511)
 
        init_waitqueue_head(&ov511->frame[0].wq);
        init_waitqueue_head(&ov511->frame[1].wq);
+       init_waitqueue_head(&ov511->wq);
 
        if (video_register_device(&ov511->vdev, VFL_TYPE_GRABBER) == -1) {
                err("video_register_device failed");
                return -EBUSY;
        }
 
-       /* Reset in case driver was unloaded and reloaded without unplug */
-       if (ov511_reset(dev, OV511_RESET_ALL) < 0)
-               goto error;
-
-       /* Initialize system */
-       if (ov511_reg_write(dev, OV511_REG_SYSTEM_INIT, 0x01) < 0) {
-               err("enable system: command failed");
-               goto error;
-       }
-
-       /* This seems to be necessary */
-       if (ov511_reset(dev, OV511_RESET_ALL) < 0)
-               goto error;
+       if ((rc = ov511_write_regvals(dev, aRegvalsInit)))
+               return rc;
 
        if(ov7610_configure(dev) < 0) {
                err("failed to configure OV7610");
@@ -1558,7 +1864,10 @@ static int ov511_configure(struct usb_ov511 *ov511)
        ov511->frame[1].bytes_read = 0;
 
        /* Initialize to DEFAULT_WIDTH, DEFAULT_HEIGHT, YUV4:2:0 */
-       ov511_mode_init_regs(ov511, DEFAULT_WIDTH, DEFAULT_HEIGHT, 0);
+       if ((rc = ov511_write_regvals(dev, aRegvalsNorm))) return rc;
+       if ((rc = ov511_mode_init_regs(ov511, DEFAULT_WIDTH, DEFAULT_HEIGHT,
+                                      VIDEO_PALETTE_RGB24, 0)) < 0) return rc;
+
 
        return 0;
        
@@ -1624,6 +1933,9 @@ static void* ov511_probe(struct usb_device *dev, unsigned int ifnum)
        case 3:
                printk("ov511: Camera is a D-Link DSB-C300\n");
                break;
+       case 5:
+               printk("ov511: Camera is a Puretek PT-6007\n");
+               break;
        case 21:
                printk("ov511: Camera is a Creative Labs WebCam 3\n");
                break;
@@ -1661,13 +1973,49 @@ static void ov511_disconnect(struct usb_device *dev, void *ptr)
 
        struct usb_ov511 *ov511 = (struct usb_ov511 *) ptr;
 
-       video_unregister_device(&ov511->vdev);
+//     video_unregister_device(&ov511->vdev);
+
+       /* We don't want people trying to open up the device */
+       if (!ov511->user)
+               video_unregister_device(&ov511->vdev);
 
        usb_driver_release_interface(&ov511_driver,
                &ov511->dev->actconfig->interface[ov511->iface]);
 
+       ov511->dev = NULL;
+       ov511->frame[0].grabstate = FRAME_ERROR;
+       ov511->frame[1].grabstate = FRAME_ERROR;
+       ov511->curframe = -1;
+
+       /* This will cause the process to request another frame */
+       if (waitqueue_active(&ov511->frame[0].wq))
+               wake_up_interruptible(&ov511->frame[0].wq);
+       if (waitqueue_active(&ov511->frame[1].wq))
+               wake_up_interruptible(&ov511->frame[1].wq);
+       if (waitqueue_active(&ov511->wq))
+               wake_up_interruptible(&ov511->wq);
+
+       ov511->streaming = 0;
+
+       /* Unschedule all of the iso td's */
+       if (ov511->sbuf[1].urb) {
+               ov511->sbuf[1].urb->next = NULL;
+               usb_unlink_urb(ov511->sbuf[1].urb);
+               usb_free_urb(ov511->sbuf[1].urb);
+               ov511->sbuf[1].urb = NULL;
+       }
+       if (ov511->sbuf[0].urb) {
+               ov511->sbuf[0].urb->next = NULL;
+               usb_unlink_urb(ov511->sbuf[0].urb);
+               usb_free_urb(ov511->sbuf[0].urb);
+               ov511->sbuf[0].urb = NULL;
+       }       
+
        /* Free the memory */
-       kfree(ov511); ov511 = NULL;
+       if (!ov511->user) {
+               kfree(ov511);
+               ov511 = NULL;
+       }
 }
 
 static struct usb_driver ov511_driver = {
index 3f41e382dfc0ad891594ebecdd49ccbd2cecc63f..ba54fb47a2c5ac41e1d488ff17b74b200006b69c 100644 (file)
 
 /* Prototypes */
 int usb_ov511_reg_read(struct usb_device *dev, unsigned char reg);
-int usb_ov511_reg_write(struct usb_device *dev, unsigned char reg, unsigned char value);
+int usb_ov511_reg_write(struct usb_device *dev,
+                        unsigned char reg,
+                        unsigned char value);
 
 
 enum {
@@ -175,10 +177,6 @@ enum {
        STATE_LINES,            /* Parsing lines */
 };
 
-struct ov511_frame_header {
-       // FIXME - nothing here yet
-};
-
 struct usb_device;
 
 struct ov511_sbuf {
@@ -194,17 +192,30 @@ enum {
        FRAME_ERROR,            /* Something bad happened while processing */
 };
 
+struct ov511_regvals {
+       enum {
+         OV511_DONE_BUS,
+         OV511_REG_BUS,
+         OV511_I2C_BUS,
+       } bus;
+       unsigned char reg;
+       unsigned char val;
+};
+
 struct ov511_frame {
        char *data;             /* Frame buffer */
 
-       struct ov511_frame_header header;       /* Header from stream */
-
+       int depth;              /* Bytes per pixel */
        int width;              /* Width application is expecting */
        int height;             /* Height */
 
        int hdrwidth;           /* Width the frame actually is */
        int hdrheight;          /* Height */
 
+       int sub_flag;           /* Sub-capture mode for this frame? */
+       int format;             /* Format for this frame */
+       int segsize;            /* How big is each segment from the camera? */
+
        volatile int grabstate; /* State of grabbing */
        int scanstate;          /* State of scanning */
 
@@ -241,6 +252,12 @@ struct usb_ov511 {
 
        char *fbuf;                     /* Videodev buffer area */
 
+       int sub_flag;           /* Pix Array subcapture on flag */
+       int subx;               /* Pix Array subcapture x offset */
+       int suby;               /* Pix Array subcapture y offset */
+       int subw;               /* Pix Array subcapture width */
+       int subh;               /* Pix Array subcapture height */
+
        int curframe;           /* Current receiving sbuf */
        struct ov511_frame frame[OV511_NUMFRAMES];      
 
@@ -250,6 +267,8 @@ struct usb_ov511 {
        /* Scratch space from the Isochronous pipe */
        unsigned char scratch[SCRATCH_BUF_SIZE];
        int scratchlen;
+
+       wait_queue_head_t wq;   /* Processes waiting */
 };
 
 #endif
index a00a9f0379c1baff1a790e2c46c9cfe081c78e75..7a4bcd1084ff55987df11cc34767d258f62baff4 100644 (file)
@@ -206,7 +206,6 @@ static unsigned int usblp_poll(struct file *file, struct poll_table_struct *wait
 
 static ssize_t usblp_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
 {
-       DECLARE_WAITQUEUE(wait, current);
        struct usblp *usblp = file->private_data;
        int retval, timeout, writecount = 0;
 
@@ -267,7 +266,6 @@ static ssize_t usblp_write(struct file *file, const char *buffer, size_t count,
 static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
 {
        struct usblp *usblp = file->private_data;
-       DECLARE_WAITQUEUE(wait, current);
 
        if (!usblp->bidir)
                return -EINVAL;
@@ -423,7 +421,7 @@ static struct file_operations usblp_fops = {
        write:          usblp_write,
        open:           usblp_open,
        release:        usblp_release,
-       poll:           usblp_poll
+       poll:           usblp_poll,
 };
 
 static struct usb_driver usblp_driver = {
index 01045b43041504a3ec0a254034759b3fea98ac0f..b5cd41d857cd11b5a242f6f0109be0e7044ef7d5 100644 (file)
@@ -763,18 +763,11 @@ ioctl_scanner(struct inode *inode, struct file *file,
 
 static struct
 file_operations usb_scanner_fops = {
-       NULL,           /* seek */
-       read_scanner,
-       write_scanner,
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       ioctl_scanner,
-       NULL,           /* mmap */
-       open_scanner,
-       NULL,           /* flush */
-       close_scanner,
-       NULL,         
-       NULL,           /* fasync */
+       read:           read_scanner,
+       write:          write_scanner,
+       ioctl:          ioctl_scanner,
+       open:           open_scanner,
+       release:        close_scanner,
 };
 
 static struct
index db5663c1ee0975405d560827519ede0d4558318a..4377e3325c08762c604085a1c45b21a270c3dbf5 100644 (file)
@@ -1759,16 +1759,7 @@ static int usb_open(struct inode * inode, struct file * file)
 }
 
 static struct file_operations usb_fops = {
-       NULL,           /* seek */
-       NULL,           /* read */
-       NULL,           /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       usb_open,
-       NULL,           /* flush */
-       NULL            /* release */
+       open:           usb_open,
 };
 
 int usb_major_init(void)
index 7a01b74f6b16673bb65fa6df5875d572a7338833..7969042925ebdf14976c5ff7d603908a467ce4f8 100644 (file)
@@ -550,17 +550,12 @@ fb_release(struct inode *inode, struct file *file)
 }
 
 static struct file_operations fb_fops = {
-       NULL,           /* lseek        */
-       fb_read,        /* read         */
-       fb_write,       /* write        */
-       NULL,           /* readdir      */
-       NULL,           /* poll         */
-       fb_ioctl,       /* ioctl        */
-       fb_mmap,        /* mmap         */
-       fb_open,        /* open         */
-       NULL,           /* flush        */
-       fb_release,     /* release      */
-       NULL            /* fsync        */
+       read:           fb_read,
+       write:          fb_write,
+       ioctl:          fb_ioctl,
+       mmap:           fb_mmap,
+       open:           fb_open,
+       release:        fb_release,
 };
 
 int
index 8b5ada2513e06d8c42369fb9aa37e9a8c067542a..823893aad4c7b114d726061aabd6d171c4b00aa2 100644 (file)
@@ -73,17 +73,8 @@ proc_bus_zorro_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos)
 }
 
 static struct file_operations proc_bus_zorro_operations = {
-       proc_bus_zorro_lseek,
-       proc_bus_zorro_read,
-       NULL,           /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       NULL,           /* no special open code */
-       NULL,           /* flush */
-       NULL,           /* no special release code */
-       NULL            /* can't fsync */
+       llseek:         proc_bus_zorro_lseek,
+       read:           proc_bus_zorro_read,
 };
 
 static struct inode_operations proc_bus_zorro_inode_operations = {
index e61261428d20722107bc59911d2e1ba2b2a9cd14..05937987535cae229e5cff6e6002d731b042b7fe 100644 (file)
@@ -195,18 +195,9 @@ adfs_dir_no_read(struct file *filp, char *buf, size_t siz, loff_t *ppos)
 }
 
 static struct file_operations adfs_dir_operations = {
-       NULL,                   /* lseek - default      */
-       adfs_dir_no_read,       /* read                 */
-       NULL,                   /* write - bad          */
-       adfs_readdir,           /* readdir              */
-       NULL,                   /* poll - default       */
-       NULL,                   /* ioctl                */
-       NULL,                   /* mmap                 */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush                */
-       NULL,                   /* no special release code */
-       file_fsync,             /* fsync                */
-       NULL,                   /* fasync               */
+       read:           adfs_dir_no_read,
+       readdir:        adfs_readdir,
+       fsync:          file_fsync,
 };
 
 static int
index 348234abc241d8ea50e302aeac01cab3cbb939bb..a02eae894cdfd09b16af9ca6b8b03c355f3a2efc 100644 (file)
@@ -56,22 +56,12 @@ adfs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
  * the adfs filesystem.
  */
 static struct file_operations adfs_file_operations = {
-       NULL,                   /* lseek                */
-       generic_file_read,      /* read                 */
+       read:           generic_file_read,
+       mmap:           generic_file_mmap,
+       fsync:          file_fsync,
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
-       adfs_file_write,        /* write                */
-#else
-       NULL,
+       write:          adfs_file_write,
 #endif
-       NULL,                   /* readdir              */
-       NULL,                   /* poll                 */
-       NULL,                   /* ioctl                */
-       generic_file_mmap,      /* mmap                 */
-       NULL,                   /* open                 */
-       NULL,                   /* flush                */
-       NULL,                   /* release              */
-       file_fsync,             /* fsync                */
-       NULL,                   /* fasync               */
 };
 
 struct inode_operations adfs_file_inode_operations = {
index f126dcbb80308f75761a49e194e59a6b288b0db1..818a45b59823eee1ed05ad2caca88b0039d305fb 100644 (file)
@@ -28,17 +28,9 @@ static int affs_readdir(struct file *, void *, filldir_t);
 static ssize_t affs_dir_read(struct file *, char *, size_t, loff_t *);
 
 static struct file_operations affs_dir_operations = {
-       NULL,                   /* lseek - default */
-       affs_dir_read,          /* read */
-       NULL,                   /* write - bad */
-       affs_readdir,           /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       file_fsync              /* default fsync */
+       read:           affs_dir_read,
+       readdir:        affs_readdir,
+       fsync:          file_fsync,
 };
 
 /*
index 7a751e40b0aa33688d52f024baa0b620da530fd9..52ccd1d31dad4742ee502dfbda44c54e1f11dc87 100644 (file)
@@ -44,19 +44,10 @@ static ssize_t affs_file_write_ofs(struct file *filp, const char *buf, size_t cn
 static int alloc_ext_cache(struct inode *inode);
 
 static struct file_operations affs_file_operations = {
-       NULL,                   /* lseek - default */
-       generic_file_read,      /* read */
-       affs_file_write,        /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       generic_file_mmap,      /* mmap */
-       NULL,                   /* no special open */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       file_fsync,             /* brute force, but works */
-       NULL,                   /* fasync */
-       NULL                    /* lock */
+       read:           generic_file_read,
+       write:          affs_file_write,
+       mmap:           generic_file_mmap,
+       fsync:          file_fsync,
 };
 
 struct inode_operations affs_file_inode_operations = {
@@ -81,19 +72,9 @@ struct inode_operations affs_file_inode_operations = {
 };
 
 static struct file_operations affs_file_operations_ofs = {
-       NULL,                   /* lseek - default */
-       affs_file_read_ofs,     /* read */
-       affs_file_write_ofs,    /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       file_fsync,             /* brute force, but works */
-       NULL,                   /* fasync */
-       NULL                    /* lock */
+       read:           affs_file_read_ofs,
+       write:          affs_file_write_ofs,
+       fsync:          file_fsync,
 };
 
 struct inode_operations affs_file_inode_operations_ofs = {
index ae53396af6c9a80c8e900adf9424fb74294e6ebc..1aedab1e43b46ec64243fa71b3c2ba18ab7d1b9d 100644 (file)
@@ -43,10 +43,7 @@ static struct dentry *autofs_dir_lookup(struct inode *dir,struct dentry *dentry)
 }
 
 static struct file_operations autofs_dir_operations = {
-       NULL,                   /* llseek */
-       NULL,                   /* read */
-       NULL,                   /* write */
-       autofs_dir_readdir,     /* readdir */
+       readdir:        autofs_dir_readdir,
 };
 
 struct inode_operations autofs_dir_inode_operations = {
index 46fc4503ea4f2936cbc007bba85f367c709c50e4..e5a4d84ca5b4dd9f92469ffb9f0fd567296a28fe 100644 (file)
@@ -24,12 +24,8 @@ static int autofs_root_mkdir(struct inode *,struct dentry *,int);
 static int autofs_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long);
 
 static struct file_operations autofs_root_operations = {
-        NULL,                   /* llseek */
-        NULL,                   /* read */
-        NULL,                   /* write */
-        autofs_root_readdir,    /* readdir */
-        NULL,                   /* poll */
-        autofs_root_ioctl,     /* ioctl */
+       readdir:        autofs_root_readdir,
+       ioctl:          autofs_root_ioctl,
 };
 
 struct inode_operations autofs_root_inode_operations = {
index bff2689a0d9f86c89e70670cdd468111d2214fb0..0febe463c4ff40eeff63252193668666f4b841cc 100644 (file)
@@ -30,19 +30,19 @@ static int return_EIO(void)
 
 static struct file_operations bad_file_ops =
 {
-       EIO_ERROR,              /* lseek */
-       EIO_ERROR,              /* read */
-       EIO_ERROR,              /* write */
-       EIO_ERROR,              /* readdir */
-       EIO_ERROR,              /* select */
-       EIO_ERROR,              /* ioctl */
-       EIO_ERROR,              /* mmap */
-       EIO_ERROR,              /* open */
-       EIO_ERROR,              /* flush */
-       EIO_ERROR,              /* release */
-       EIO_ERROR,              /* fsync */
-       EIO_ERROR,              /* fasync */
-       EIO_ERROR,              /* lock */
+       llseek:         EIO_ERROR,
+       read:           EIO_ERROR,
+       write:          EIO_ERROR,
+       readdir:        EIO_ERROR,
+       poll:           EIO_ERROR,
+       ioctl:          EIO_ERROR,
+       mmap:           EIO_ERROR,
+       open:           EIO_ERROR,
+       flush:          EIO_ERROR,
+       release:        EIO_ERROR,
+       fsync:          EIO_ERROR,
+       fasync:         EIO_ERROR,
+       lock:           EIO_ERROR,
 };
 
 struct inode_operations bad_inode_ops =
index b89f6e3acaef4bc845254c89e897f31b5e318762..9ca1ce88a4a1c3314747e074d7f2f2cccc6b4653 100644 (file)
@@ -76,18 +76,9 @@ static int bfs_readdir(struct file * f, void * dirent, filldir_t filldir)
 }
 
 static struct file_operations bfs_dir_operations = {
-       llseek:                 NULL,
        read:                   bfs_dir_read,
-       write:                  NULL,
        readdir:                bfs_readdir,
-       poll:                   NULL,
-       ioctl:                  NULL,
-       mmap:                   NULL,
-       open:                   NULL,
-       flush:                  NULL,
-       release:                NULL,
        fsync:                  file_fsync,
-       fasync:                 NULL,
 };
 
 extern void dump_imap(const char *, struct super_block *);
index 2c18805eed5e642e61eecaf2b4e87eea52be80b2..8b6632f8f6c127e031eb02742be13952d9cfa89c 100644 (file)
@@ -24,18 +24,9 @@ static ssize_t bfs_file_write(struct file * f, const char * buf, size_t count, l
 }
 
 static struct file_operations bfs_file_operations = {
-       llseek:                 NULL,
        read:                   generic_file_read,
        write:                  bfs_file_write,
-       readdir:                NULL,
-       poll:                   NULL,
-       ioctl:                  NULL,
        mmap:                   generic_file_mmap,
-       open:                   NULL,
-       flush:                  NULL,
-       release:                NULL,
-       fsync:                  NULL,
-       fasync:                 NULL,
 };
 
 static int bfs_move_block(unsigned long from, unsigned long to, kdev_t dev)
index 37b17bde899ab55f1d6b9838625319cc83b24116..fbcb5364eedf2d4daedb7d8d873fd438911ba61f 100644 (file)
@@ -323,7 +323,9 @@ int file_fsync(struct file *filp, struct dentry *dentry)
        struct inode * inode = dentry->d_inode;
        struct super_block * sb;
        kdev_t dev;
+       int ret;
 
+       lock_kernel();
        /* sync the inode to buffers */
        write_inode_now(inode);
 
@@ -335,7 +337,9 @@ int file_fsync(struct file *filp, struct dentry *dentry)
 
        /* .. finally sync the buffers to disk */
        dev = inode->i_dev;
-       return sync_buffers(dev, 1);
+       ret = sync_buffers(dev, 1);
+       unlock_kernel();
+       return ret;
 }
 
 asmlinkage long sys_fsync(unsigned int fd)
@@ -345,7 +349,6 @@ asmlinkage long sys_fsync(unsigned int fd)
        struct inode * inode;
        int err;
 
-       lock_kernel();
        err = -EBADF;
        file = fget(fd);
        if (!file)
@@ -371,7 +374,6 @@ asmlinkage long sys_fsync(unsigned int fd)
 out_putf:
        fput(file);
 out:
-       unlock_kernel();
        return err;
 }
 
@@ -382,7 +384,6 @@ asmlinkage long sys_fdatasync(unsigned int fd)
        struct inode * inode;
        int err;
 
-       lock_kernel();
        err = -EBADF;
        file = fget(fd);
        if (!file)
@@ -408,7 +409,6 @@ asmlinkage long sys_fdatasync(unsigned int fd)
 out_putf:
        fput(file);
 out:
-       unlock_kernel();
        return err;
 }
 
index 2a1a122c82fc17eca60bcb62d0420f43f15bedbf..bfc975409e0af2d657415247978bd927eb838ffa 100644 (file)
@@ -86,17 +86,10 @@ struct inode_operations coda_dir_inode_operations =
 };
 
 struct file_operations coda_dir_operations = {
-        NULL,                   /* lseek */
-        NULL,                   /* read -- bad  */
-        NULL,                   /* write */
-        coda_readdir,           /* readdir */
-        NULL,                   /* select */
-        NULL,                   /* ioctl */
-        NULL,                   /* mmap */
-        coda_open,              /* open */
-       NULL,
-        coda_release,           /* release */
-       coda_fsync,             /* fsync */
+       readdir:        coda_readdir,
+       open:           coda_open,
+       release:        coda_release,
+       fsync:          coda_fsync,
 };
 
 
index 726bd18fdab5d6c91c592b400cc18d796a965494..a19d0d93f34af19a088b2f5f9d5741f30feb5872 100644 (file)
@@ -56,19 +56,12 @@ struct inode_operations coda_file_inode_operations = {
 };
 
 struct file_operations coda_file_operations = {
-       NULL,                   /* lseek - default should work for coda */
-       coda_file_read,         /* read */
-       coda_file_write,        /* write */
-       NULL,                   /* readdir */
-       NULL,                   /* select - default */
-       NULL,                   /* ioctl */
-       coda_file_mmap,         /* mmap */
-       coda_open,              /* open */
-       NULL,
-       coda_release,           /* release */
-       coda_fsync,             /* fsync */
-       NULL,                   /* fasync */
-       NULL                    /* lock */
+       read:           coda_file_read,
+       write:          coda_file_write,
+       mmap:           coda_file_mmap,
+       open:           coda_open,
+       release:        coda_release,
+       fsync:          coda_fsync,
 };
 
 /*  File file operations */
@@ -213,12 +206,14 @@ int coda_fsync(struct file *coda_file, struct dentry *coda_dentry)
              S_ISLNK(coda_inode->i_mode)))
                return -EINVAL;
 
+       lock_kernel();
         cnp = ITOC(coda_inode);
         CHECK_CNODE(cnp);
 
         cont_inode = cnp->c_ovp;
         if ( cont_inode == NULL ) {
                 printk("coda_file_write: cached inode is 0!\n");
+               unlock_kernel();
                 return -1; 
         }
 
@@ -235,6 +230,7 @@ int coda_fsync(struct file *coda_file, struct dentry *coda_dentry)
        up(&cont_inode->i_sem);
 
         coda_restore_codafile(coda_inode, coda_file, cont_inode, &cont_file);
+       unlock_kernel();
         return result;
 }
 /* 
index cec92b7f4c914e0f46beaa77a1daea88e3465b02..3f813c2f1fccabc5590790a4863156edbaa970f2 100644 (file)
@@ -55,17 +55,9 @@ struct inode_operations coda_ioctl_inode_operations =
 };
 
 struct file_operations coda_ioctl_operations = {
-       NULL,                   /* lseek - default should work for coda */
-       NULL,                   /* read */
-       NULL,                   /* write */
-       NULL,                   /* readdir */
-       NULL,                   /* select - default */
-       coda_pioctl,            /* ioctl */
-       NULL,                   /* mmap */
-       coda_ioctl_open,        /* open */
-       NULL,
-       coda_ioctl_release,     /* release */
-       NULL,                   /* fsync */
+       ioctl:          coda_pioctl,
+       open:           coda_ioctl_open,
+       release:        coda_ioctl_release,
 };
 
 /* the coda pioctl inode ops */
index 65aeee08e2b908a67886515090d81090a9a9716c..dbabfa9c309c2af3508ec790cb4bec91a7025436 100644 (file)
@@ -315,19 +315,11 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
 
 
 static struct file_operations coda_psdev_fops = {
-      NULL,                  /* llseek */
-      coda_psdev_read,       /* read */
-      coda_psdev_write,      /* write */
-      NULL,                 /* coda_psdev_readdir */
-      coda_psdev_poll,       /* poll */
-      NULL,                  /* ioctl */
-      NULL,                 /* coda_psdev_mmap */
-      coda_psdev_open,       /* open */
-      NULL,
-      coda_psdev_release,    /* release */
-      NULL,                  /* fsync */
-      NULL,                  /* fasync */
-      NULL                   /* lock */
+       read:           coda_psdev_read,
+       write:          coda_psdev_write,
+       poll:           coda_psdev_poll,
+       open:           coda_psdev_open,
+       release:        coda_psdev_release,
 };
 
 
index 07c8f15a1015d4c063f1c133b9f6aea75108e02d..0e04600d50fa3277c338f9dbc9c6db0e9caff408 100644 (file)
@@ -398,36 +398,15 @@ static struct dentry *cramfs_follow_link(struct dentry *dentry, struct dentry *b
  * A regular file can be read and mmap'ed.
  */
 static struct file_operations cramfs_file_operations = {
-       NULL,                   /* lseek - default */
-       generic_file_read,      /* read */
-       NULL,                   /* write - bad */
-       NULL,                   /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl */
-       generic_file_mmap,      /* mmap */
-       NULL,                   /* open */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       NULL,                   /* fsync */
-       NULL,                   /* fasync */
+       read:           generic_file_read,
+       mmap:           generic_file_mmap,
 };
 
 /*
  * A directory can only readdir
  */
 static struct file_operations cramfs_directory_operations = {
-       NULL,                   /* lseek - default */
-       NULL,                   /* read */
-       NULL,                   /* write - bad */
-       cramfs_readdir,         /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl */
-       NULL,                   /* mmap */
-       NULL,                   /* open */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       NULL,                   /* fsync */
-       NULL,                   /* fasync */
+       readdir:        cramfs_readdir,
 };
 
 static struct inode_operations cramfs_file_inode_operations = {
index 36e15475a2ca3d0b3c78d0968d1a94c049249297..607a96edd7378ba9e0ca1fb5c89a82629c83b159 100644 (file)
@@ -157,7 +157,7 @@ int chrdev_open(struct inode * inode, struct file * filp)
  * depending on the special file...
  */
 static struct file_operations def_chr_fops = {
-       open:   chrdev_open
+       open:           chrdev_open,
 };
 
 static struct inode_operations chrdev_inode_operations = {
index 92978217f7123a6565449cfdbae0867033eb787a..cb814730616a67330f6a52bcfb665efc4935a9db 100644 (file)
@@ -21,10 +21,7 @@ static struct dentry *devpts_root_lookup(struct inode *,struct dentry *);
 static int devpts_revalidate(struct dentry *, int);
 
 static struct file_operations devpts_root_operations = {
-       NULL,                   /* llseek */
-       NULL,                   /* read */
-       NULL,                   /* write */
-       devpts_root_readdir,    /* readdir */
+       readdir:        devpts_root_readdir,
 };
 
 struct inode_operations devpts_root_inode_operations = {
index 4e84b1abbbd7b359d694ff69ab1942ab098c37c4..c4d17248187da66a3e856034e4d3dc91f1f4a0bc 100644 (file)
@@ -9,18 +9,7 @@
 static int efs_readdir(struct file *, void *, filldir_t);
 
 static struct file_operations efs_dir_operations = {
-       NULL,                   /* lseek */
-       NULL,                   /* read */
-       NULL,                   /* write */
-       efs_readdir,            /* readdir */
-       NULL,                   /* poll */
-       NULL,                   /* ioctl */
-       NULL,                   /* mmap */
-       NULL,                   /* open */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       NULL,                   /* fsync */
-       NULL,                   /* fasync */
+       readdir:        efs_readdir,
 };
 
 extern int efs_get_block(struct inode *, long, struct buffer_head *, int);
index 8a2a8163d278c4d4c9ea6609a4797f4f90377af6..3106e192766dc964f0c0f7d00334a1e8f3c33629 100644 (file)
@@ -62,18 +62,8 @@ int efs_bmap(struct inode *inode, efs_block_t block) {
 }
 
 static struct file_operations efs_file_operations = {
-       NULL,                   /* lseek */
-       generic_file_read,      /* read */
-       NULL,                   /* write */
-       NULL,                   /* readdir */
-       NULL,                   /* poll */
-       NULL,                   /* ioctl */
-       generic_file_mmap,      /* mmap */
-       NULL,                   /* open */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       NULL,                   /* fsync */
-       NULL,                   /* fasync */
+       read:           generic_file_read,
+       mmap:           generic_file_mmap,
 };
 
 struct inode_operations efs_file_inode_operations = {
index c97292620d24d843f0dbbbb41c3becb9c1237ca7..b8a5c2f9d819350b29ed233c649c65ac0580c960 100644 (file)
@@ -31,18 +31,10 @@ static ssize_t ext2_dir_read (struct file * filp, char * buf,
 static int ext2_readdir(struct file *, void *, filldir_t);
 
 static struct file_operations ext2_dir_operations = {
-       NULL,                   /* lseek - default */
-       ext2_dir_read,          /* read */
-       NULL,                   /* write - bad */
-       ext2_readdir,           /* readdir */
-       NULL,                   /* poll - default */
-       ext2_ioctl,             /* ioctl */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       ext2_sync_file,         /* fsync */
-       NULL,                   /* fasync */
+       read:           ext2_dir_read,
+       readdir:        ext2_readdir,
+       ioctl:          ext2_ioctl,
+       fsync:          ext2_sync_file,
 };
 
 /*
index df010f223b203cf2f5f6bd9a1a9508dc30afd2cd..70864a857571f3b2447b0ecaba812d58e12fd90d 100644 (file)
@@ -137,18 +137,14 @@ static int ext2_open_file (struct inode * inode, struct file * filp)
  * the ext2 filesystem.
  */
 static struct file_operations ext2_file_operations = {
-       ext2_file_lseek,        /* lseek */
-       generic_file_read,      /* read */
-       ext2_file_write,        /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* poll - default */
-       ext2_ioctl,             /* ioctl */
-       generic_file_mmap,      /* mmap */
-       ext2_open_file,
-       NULL,                   /* flush */
-       ext2_release_file,      /* release */
-       ext2_sync_file,         /* fsync */
-       NULL,                   /* fasync */
+       llseek:         ext2_file_lseek,
+       read:           generic_file_read,
+       write:          ext2_file_write,
+       ioctl:          ext2_ioctl,
+       mmap:           generic_file_mmap,
+       open:           ext2_open_file,
+       release:        ext2_release_file,
+       fsync:          ext2_sync_file,
 };
 
 struct inode_operations ext2_file_inode_operations = {
index c29fef5ea7379a66e6983eeb40322c8f020d3bab..52ffd6138b2de797b12fc7ac046d83faca34da21 100644 (file)
@@ -24,8 +24,7 @@
 
 #include <linux/fs.h>
 #include <linux/locks.h>
-
-
+#include <linux/smp_lock.h>
 
 
 #define blocksize      (EXT2_BLOCK_SIZE(inode->i_sb))
@@ -130,6 +129,7 @@ int ext2_sync_file(struct file * file, struct dentry *dentry)
        int wait, err = 0;
        struct inode *inode = dentry->d_inode;
 
+       lock_kernel();
        if (S_ISLNK(inode->i_mode) && !(inode->i_blocks))
                /*
                 * Don't sync fast links!
@@ -152,5 +152,6 @@ int ext2_sync_file(struct file * file, struct dentry *dentry)
        }
 skip:
        err |= ext2_sync_inode (inode);
+       unlock_kernel();
        return err ? -EIO : 0;
 }
index 83565fcbef09995613cf11d129c6742c7605222e..80487627043394273aea4a5840fd2ef690255bbb 100644 (file)
@@ -41,17 +41,10 @@ static ssize_t fat_dir_read(struct file * filp, char * buf,
 }
 
 struct file_operations fat_dir_operations = {
-       NULL,                   /* lseek - default */
-       fat_dir_read,           /* read */
-       NULL,                   /* write - bad */
-       fat_readdir,            /* readdir */
-       NULL,                   /* select v2.0.x/poll v2.1.x - default */
-       fat_dir_ioctl,          /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       file_fsync              /* fsync */
+       read:           fat_dir_read,
+       readdir:        fat_readdir,
+       ioctl:          fat_dir_ioctl,
+       fsync:          file_fsync,
 };
 
 /*
index 06da340fb2164164851212eb73a3ae4af93bad52..830bc8eda5548ad391de5a6e8c33a58f4848bb5f 100644 (file)
 #define Printk(x) printk x
 
 static struct file_operations fat_file_operations = {
-       NULL,                   /* lseek - default */
-       fat_file_read,          /* read */
-       fat_file_write,         /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* select v2.0.x/poll v2.1.x - default */
-       NULL,                   /* ioctl - default */
-       generic_file_mmap,      /* mmap */
-       NULL,                   /* no special open is needed */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       file_fsync              /* fsync */
+       read:           fat_file_read,
+       write:          fat_file_write,
+       mmap:           generic_file_mmap,
+       fsync:          file_fsync,
 };
 
 struct inode_operations fat_file_inode_operations = {
index 88d8bd33b6a5e306061607232a0b8a313d3f328a..fd48328e9953a644cd06633da57c58a2f59cf26e 100644 (file)
--- a/fs/fifo.c
+++ b/fs/fifo.c
@@ -153,7 +153,7 @@ err_nolock_nocleanup:
  * depending on the access mode of the file...
  */
 static struct file_operations def_fifo_fops = {
-       open:   fifo_open,      /* will set read or write pipe_fops */
+       open:           fifo_open,      /* will set read or write pipe_fops */
 };
 
 struct inode_operations fifo_inode_operations = {
index cdf01737abdc9767098f9583da63599e0a50c4bf..78903169e68f1059f217b68b1dbe3ba0cb93bb97 100644 (file)
@@ -58,18 +58,9 @@ const struct hfs_name hfs_cap_reserved2[] = {
 #define DOT_ROOTINFO   (&hfs_cap_reserved2[0])
 
 static struct file_operations hfs_cap_dir_operations = {
-       NULL,                   /* lseek - default */
-       hfs_dir_read,           /* read - invalid */
-       NULL,                   /* write - bad */
-       cap_readdir,            /* readdir */
-       NULL,                   /* select - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap - none */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       file_fsync,             /* fsync - default */
-       NULL,                   /* fasync - default */
+       read:           hfs_dir_read,
+       readdir:        cap_readdir,
+       fsync:          file_fsync,
 };
 
 struct inode_operations hfs_cap_ndir_inode_operations = {
index 1e13465d1317551e019c7e31d9c783b22961fe28..70ba2926317fa28cac1a8dc8690fba4a987baca8 100644 (file)
@@ -57,18 +57,9 @@ const struct hfs_name hfs_dbl_reserved2[] = {
 #define PCNT_ROOTINFO  (&hfs_dbl_reserved2[1])
 
 static struct file_operations hfs_dbl_dir_operations = {
-       NULL,                   /* lseek - default */
-       hfs_dir_read,           /* read - invalid */
-       NULL,                   /* write - bad */
-       dbl_readdir,            /* readdir */
-       NULL,                   /* select - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap - none */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       file_fsync,             /* fsync - default */
-        NULL,                  /* fasync - default */
+       read:           hfs_dir_read,
+       readdir:        dbl_readdir,
+       fsync:          file_fsync,
 };
 
 struct inode_operations hfs_dbl_dir_inode_operations = {
index ab274d18fe1a48b68de01c50b2b2a61d21b3c271..0cd9583b42cc2c356dd96019cd38af8d5264dd13 100644 (file)
@@ -63,19 +63,9 @@ const struct hfs_name hfs_nat_reserved2[] = {
 #define ROOTINFO        (&hfs_nat_reserved2[0])
 
 static struct file_operations hfs_nat_dir_operations = {
-       NULL,                   /* lseek - default */
-       hfs_dir_read,           /* read - invalid */
-       NULL,                   /* write - bad */
-       nat_readdir,            /* readdir */
-       NULL,                   /* select - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap - none */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       file_fsync,             /* fsync - default */
-        NULL,                  /* fasync - default */
-       NULL                    /* lock - none */
+       read:           hfs_dir_read,
+       readdir:        nat_readdir,
+       fsync:          file_fsync,
 };
 
 struct inode_operations hfs_nat_ndir_inode_operations = {
index d5edeac45f44ea4c1c57ded04f9e97b70d407d01..1e4c046a3b11884d985f2278446981c4d34cc9a2 100644 (file)
@@ -33,19 +33,10 @@ static int hfs_get_block(struct inode *, long, struct buffer_head *, int);
 /*================ Global variables ================*/
 
 static struct file_operations hfs_file_operations = {
-       NULL,                   /* lseek - default */
-       hfs_file_read,          /* read */
-       hfs_file_write,         /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* select - default */
-       NULL,                   /* ioctl - default */
-       generic_file_mmap,      /* mmap */
-       NULL,                   /* open */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       file_fsync,             /* fsync - default */
-        NULL,                  /* fasync - default */
-        NULL                   /* lock - none */
+       read:           hfs_file_read,
+       write:          hfs_file_write,
+       mmap:           generic_file_mmap,
+       fsync:          file_fsync,
 };
 
 struct inode_operations hfs_file_inode_operations = {
index 4e723af6349a74bbef7582726dad910ddceb5028..51f997f87dd371523dc055d40cce69b7499f1637 100644 (file)
@@ -47,19 +47,9 @@ static void cap_info_truncate(struct inode *);
 /*================ Global variables ================*/
 
 static struct file_operations hfs_cap_info_operations = {
-       NULL,                   /* lseek - default */
-       cap_info_read,          /* read */
-       cap_info_write,         /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* select - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap - not yet */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       file_fsync,             /* fsync - default */
-       NULL,                   /* fasync - default */
-       NULL                    /* lock - none */
+       read:           cap_info_read,
+       write:          cap_info_write,
+       fsync:          file_fsync,
 };
 
 struct inode_operations hfs_cap_info_inode_operations = {
index efbe84f75ac3d7f71c7dd334aeab7bea5ae3562e..d26aab9b74ac6abaae6124fe8523e21c9becf419 100644 (file)
@@ -48,19 +48,9 @@ static void hdr_truncate(struct inode *);
 /*================ Global variables ================*/
 
 static struct file_operations hfs_hdr_operations = {
-       NULL,                   /* lseek - default */
-       hdr_read,               /* read */
-       hdr_write,              /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* select - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap - XXX: not yet */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       file_fsync,             /* fsync - default */
-        NULL,                  /* fasync - default */
-        NULL                   /* lock - none */
+       read:           hdr_read,
+       write:          hdr_write,
+       fsync:          file_fsync,
 };
 
 struct inode_operations hfs_hdr_inode_operations = {
index 0b6ab80534bfb7a937e7565ece34c5829112981e..68f5f9c3cb8699da824c64f6ee9b80672eb4a7b0 100644 (file)
 
 static const struct file_operations hpfs_file_ops =
 {
-       NULL,                           /* lseek - default */
-       generic_file_read,              /* read */
-       hpfs_file_write,                /* write */
-       NULL,                           /* readdir - bad */
-       NULL,                           /* poll - default */
-       NULL,                           /* ioctl - default */
-       generic_file_mmap,              /* mmap */
-       hpfs_open,                      /* open */
-       NULL,                           /* flush */
-       hpfs_file_release,              /* release */
-       hpfs_file_fsync,                /* fsync */
-       NULL,                           /* fasync */
-       NULL,                           /* lock */
+       read:           generic_file_read,
+       write:          hpfs_file_write,
+       mmap:           generic_file_mmap,
+       open:           hpfs_open,
+       release:        hpfs_file_release,
+       fsync:          hpfs_file_fsync,
 };
 
 static const struct inode_operations hpfs_file_iops =
@@ -49,19 +42,12 @@ static const struct inode_operations hpfs_file_iops =
 
 static const struct file_operations hpfs_dir_ops =
 {
-       hpfs_dir_lseek,                 /* lseek */
-       hpfs_dir_read,                  /* read */
-       NULL,                           /* write - bad */
-       hpfs_readdir,                   /* readdir */
-       NULL,                           /* poll - default */
-       NULL,                           /* ioctl - default */
-       NULL,                           /* mmap */
-       hpfs_open,                      /* open */
-       NULL,                           /* flush */
-       hpfs_dir_release,               /* no special release code */
-       hpfs_file_fsync,                /* fsync */
-       NULL,                           /* fasync */
-       NULL,                           /* lock */
+       llseek:         hpfs_dir_lseek,
+       read:           hpfs_dir_read,
+       readdir:        hpfs_readdir,
+       open:           hpfs_open,
+       release:        hpfs_dir_release,
+       fsync:          hpfs_file_fsync,
 };
 
 static const struct inode_operations hpfs_dir_iops =
index fb60d3a5545b87abf8b0e0df29307a8922b30936..6081179c923388ab6c43a13af6d8d03e1b278ecf 100644 (file)
@@ -28,16 +28,7 @@ static int isofs_readdir(struct file *, void *, filldir_t);
 
 static struct file_operations isofs_dir_operations =
 {
-       NULL,                   /* lseek - default */
-       NULL,                   /* read */
-       NULL,                   /* write - bad */
-       isofs_readdir,          /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       NULL                    /* fsync */
+       readdir:        isofs_readdir,
 };
 
 /*
index b15b6c5dcb9bccbf10c4f13292518f9ba23a0e20..db491343a09901c6a1b9587e3ea84974f7a24feb 100644 (file)
  * the isofs filesystem.
  */
 static struct file_operations isofs_file_operations = {
-       NULL,                   /* lseek - default */
-       generic_file_read,      /* read */
-       NULL,                   /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       generic_file_mmap,      /* mmap */
-       NULL,                   /* no special open is needed */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       NULL                    /* fsync */
+       read:           generic_file_read,
+       mmap:           generic_file_mmap,
 };
 
 struct inode_operations isofs_file_inode_operations = {
index 52c0e0ceefdf7a9f1814e49c2a496a548438d7cc..56344946d744b863f775e212f2298e457f647dd7 100644 (file)
@@ -23,17 +23,9 @@ static ssize_t minix_dir_read(struct file * filp, char * buf,
 static int minix_readdir(struct file *, void *, filldir_t);
 
 static struct file_operations minix_dir_operations = {
-       NULL,                   /* lseek - default */
-       minix_dir_read,         /* read */
-       NULL,                   /* write - bad */
-       minix_readdir,          /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       file_fsync              /* default fsync */
+       read:           minix_dir_read,
+       readdir:        minix_readdir,
+       fsync:          file_fsync,
 };
 
 /*
index 6445c225c92674ff1759ce2f210418e1c329c6d7..a821a6522eb844e958ec17e64f324db5345c34ed 100644 (file)
@@ -41,18 +41,10 @@ minix_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
  * the minix filesystem.
  */
 static struct file_operations minix_file_operations = {
-       NULL,                   /* lseek - default */
-       generic_file_read,      /* read */
-       minix_file_write,       /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       generic_file_mmap,      /* mmap */
-       NULL,                   /* no special open is needed */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       minix_sync_file,        /* fsync */
-       NULL,                   /* fasync */
+       read:           generic_file_read,
+       write:          minix_file_write,
+       mmap:           generic_file_mmap,
+       fsync:          minix_sync_file,
 };
 
 struct inode_operations minix_file_inode_operations = {
index 2fcdddf1595fdd3a180eb207ce7c7343631d4b27..acb5e94b729846cb6e8dcb61afdcb78282ac5b76 100644 (file)
@@ -148,10 +148,7 @@ static int V1_minix_sync_file(struct inode * inode, struct file * file)
 {
        int wait, err = 0;
        
-       if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
-            S_ISLNK(inode->i_mode)))
-               return -EINVAL;
-
+       lock_kernel();
        for (wait=0; wait<=1; wait++)
        {
                err |= V1_sync_direct(inode, wait);
@@ -159,6 +156,7 @@ static int V1_minix_sync_file(struct inode * inode, struct file * file)
                err |= V1_sync_dindirect(inode, inode->u.minix_i.u.i1_data + 8, wait);
        }
        err |= minix_sync_inode (inode);
+       unlock_kernel();
        return (err < 0) ? -EIO : 0;
 }
 
@@ -309,10 +307,7 @@ static int V2_minix_sync_file(struct inode * inode, struct file * file)
 {
        int wait, err = 0;
        
-       if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
-            S_ISLNK(inode->i_mode)))
-               return -EINVAL;
-
+       lock_kernel();
        for (wait=0; wait<=1; wait++)
        {
                err |= V2_sync_direct(inode, wait);
@@ -324,6 +319,7 @@ static int V2_minix_sync_file(struct inode * inode, struct file * file)
                      (unsigned long *) inode->u.minix_i.u.i2_data + 9, wait);
        }
        err |= minix_sync_inode (inode);
+       unlock_kernel();
        return (err < 0) ? -EIO : 0;
 }
 
@@ -336,6 +332,10 @@ int minix_sync_file(struct file * file, struct dentry *dentry)
 {
        struct inode *inode = dentry->d_inode;
        
+       if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
+            S_ISLNK(inode->i_mode)))
+               return -EINVAL;
+
        if (INODE_VERSION(inode) == MINIX_V1)
                return V1_minix_sync_file(inode, file);
        else
index 565f88c5bab60b8872da375cedfbdfad381a348f..20b44a9b20f0aa62de6f0eb8237b442cb7a0f681 100644 (file)
@@ -47,17 +47,9 @@ extern int ncp_symlink(struct inode *, struct dentry *, const char *);
                      
 static struct file_operations ncp_dir_operations =
 {
-       NULL,                   /* lseek - default */
-       ncp_dir_read,           /* read - bad */
-       NULL,                   /* write - bad */
-       ncp_readdir,            /* readdir */
-       NULL,                   /* poll - default */
-       ncp_ioctl,              /* ioctl */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       NULL                    /* fsync */
+       read:           ncp_dir_read,
+       readdir:        ncp_readdir,
+       ioctl:          ncp_ioctl,
 };
 
 struct inode_operations ncp_dir_inode_operations =
index 5e28516bfe74583ba478d0655e7516fda82664a4..50e24bd011114fc83b67b24292f27d34e8ae5156 100644 (file)
@@ -277,17 +277,11 @@ out:
 
 static struct file_operations ncp_file_operations =
 {
-       NULL,                   /* lseek - default */
-       ncp_file_read,          /* read */
-       ncp_file_write,         /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* poll - default */
-       ncp_ioctl,              /* ioctl */
-       ncp_mmap,               /* mmap */
-       NULL,                   /* open */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       ncp_fsync,              /* fsync */
+       read:           ncp_file_read,
+       write:          ncp_file_write,
+       ioctl:          ncp_ioctl,
+       mmap:           ncp_mmap,
+       fsync:          ncp_fsync,
 };
 
 struct inode_operations ncp_file_inode_operations =
index 788307cc261b980d12a599c65707e12695789d9a..4341547f7eff515508586a68002b01039deac0d1 100644 (file)
@@ -52,17 +52,10 @@ static int nfs_rename(struct inode *, struct dentry *,
                      struct inode *, struct dentry *);
 
 static struct file_operations nfs_dir_operations = {
-       NULL,                   /* lseek - default */
-       nfs_dir_read,           /* read - bad */
-       NULL,                   /* write - bad */
-       nfs_readdir,            /* readdir */
-       NULL,                   /* select - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap */
-       nfs_open,               /* open */
-       NULL,                   /* flush */
-       nfs_release,            /* release */
-       NULL                    /* fsync */
+       read:           nfs_dir_read,
+       readdir:        nfs_readdir,
+       open:           nfs_open,
+       release:        nfs_release,
 };
 
 struct inode_operations nfs_dir_inode_operations = {
index f687cfdabb2d74050d5198b5e7de15005a5518f7..c883545d310dac531f36b2bebc8b6eb132d1ab07 100644 (file)
@@ -41,19 +41,14 @@ static int  nfs_file_flush(struct file *);
 static int  nfs_fsync(struct file *, struct dentry *dentry);
 
 static struct file_operations nfs_file_operations = {
-       NULL,                   /* lseek - default */
-       nfs_file_read,          /* read */
-       nfs_file_write,         /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* select - default */
-       NULL,                   /* ioctl - default */
-       nfs_file_mmap,          /* mmap */
-       nfs_open,               /* open */
-       nfs_file_flush,         /* flush */
-       nfs_release,            /* release */
-       nfs_fsync,              /* fsync */
-       NULL,                   /* fasync */
-       nfs_lock,               /* lock */
+       read:           nfs_file_read,
+       write:          nfs_file_write,
+       mmap:           nfs_file_mmap,
+       open:           nfs_open,
+       flush:          nfs_file_flush,
+       release:        nfs_release,
+       fsync:          nfs_fsync,
+       lock:           nfs_lock,
 };
 
 struct inode_operations nfs_file_inode_operations = {
@@ -146,11 +141,13 @@ nfs_fsync(struct file *file, struct dentry *dentry)
 
        dfprintk(VFS, "nfs: fsync(%x/%ld)\n", inode->i_dev, inode->i_ino);
 
+       lock_kernel();
        status = nfs_wb_file(inode, file);
        if (!status) {
                status = file->f_error;
                file->f_error = 0;
        }
+       unlock_kernel();
        return status;
 }
 
index 7de7eb5c4942130d0dcf47c4607b3ce7c6a87763..a5f378c66da35a1816ade87be686f7f414d8a0cf 100644 (file)
@@ -405,23 +405,10 @@ static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *d)
 }
 
 static struct file_operations ntfs_file_operations_nommap = {
-       NULL, /* lseek */
-       ntfs_read,
+       read:           ntfs_read,
 #ifdef CONFIG_NTFS_RW
-       ntfs_write,
-#else
-       NULL,
+       write:          ntfs_write,
 #endif
-       NULL, /* readdir */
-       NULL, /* select */
-       NULL, /* ioctl */
-       NULL, /* mmap */
-       NULL, /* open */
-       NULL, /* flush */
-       NULL, /* release */
-       NULL, /* fsync */
-       NULL, /* fasync */
-       NULL, /* lock */
 };
 
 static struct inode_operations ntfs_inode_operations_nobmap = {
@@ -584,23 +571,11 @@ ntfs_bmap(struct inode *ino,int block)
 }
 
 static struct file_operations ntfs_file_operations = {
-       NULL, /* lseek */
-       ntfs_read,
+       read:           ntfs_read,
+       mmap:           generic_file_mmap,
 #ifdef CONFIG_NTFS_RW
-       ntfs_write,
-#else
-       NULL,
+       write:          ntfs_write,
 #endif
-       NULL, /* readdir */
-       NULL, /* select */
-       NULL, /* ioctl */
-       generic_file_mmap,
-       NULL, /* open */
-       NULL, /* flush */
-       NULL, /* release */
-       NULL, /* fsync */
-       NULL, /* fasync */
-       NULL, /* lock */
 };
 
 static struct inode_operations ntfs_inode_operations = {
@@ -625,10 +600,7 @@ static struct inode_operations ntfs_inode_operations = {
 };
 
 static struct file_operations ntfs_dir_operations = {
-       NULL, /* lseek */
-       NULL, /* read */
-       NULL, /* write */
-       ntfs_readdir, /* readdir */
+       readdir:        ntfs_readdir,
 };
 
 static struct inode_operations ntfs_dir_inode_operations = {
index b09462b8960e24903fb3aa416ae0821f964a7206..c1de111127279e9ec7b35532f5643ab6070319cb 100644 (file)
@@ -553,17 +553,9 @@ int property_release (struct inode *inode, struct file *filp)
 }
 
 static struct file_operations openpromfs_prop_ops = {
-       NULL,                   /* lseek - default */
-       property_read,          /* read */
-       property_write,         /* write - bad */
-       NULL,                   /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       property_release,       /* no special release code */
-       NULL                    /* can't fsync */
+       read:           property_read,
+       write:          property_write,
+       release:        property_release,
 };
 
 static struct inode_operations openpromfs_prop_inode_ops = {
@@ -571,17 +563,7 @@ static struct inode_operations openpromfs_prop_inode_ops = {
 };
 
 static struct file_operations openpromfs_nodenum_ops = {
-       NULL,                   /* lseek - default */
-       nodenum_read,           /* read */
-       NULL,                   /* write - bad */
-       NULL,                   /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       NULL                    /* can't fsync */
+       read:           nodenum_read,
 };
 
 static struct inode_operations openpromfs_nodenum_inode_ops = {
@@ -589,17 +571,7 @@ static struct inode_operations openpromfs_nodenum_inode_ops = {
 };
 
 static struct file_operations openprom_alias_operations = {
-       NULL,                   /* lseek - default */
-       NULL,                   /* read - bad */
-       NULL,                   /* write - bad */
-       openpromfs_readdir,     /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       NULL                    /* can't fsync */
+       readdir:        openpromfs_readdir,
 };
 
 static struct inode_operations openprom_alias_inode_operations = {
@@ -1019,10 +991,7 @@ static u16 get_nodes (u16 parent, u32 node)
 
 
 static struct file_operations openprom_operations = {
-       NULL,                   /* lseek - default */
-       NULL,                   /* read - bad */
-       NULL,                   /* write - bad */
-       openpromfs_readdir,     /* readdir */
+       readdir:        openpromfs_readdir,
 };
 
 static struct inode_operations openprom_inode_operations = {
index 68922b9b80bbfecd27985d595664958f6ca2496a..2dea69d60c79ae4d5282db7bcda2fcbce2ac7152 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -462,101 +462,73 @@ pipe_rdwr_open(struct inode *inode, struct file *filp)
  * are also used in linux/fs/fifo.c to do operations on FIFOs.
  */
 struct file_operations connecting_fifo_fops = {
-       pipe_lseek,
-       connect_read,
-       bad_pipe_w,
-       NULL,           /* no readdir */
-       connect_poll,
-       pipe_ioctl,
-       NULL,           /* no mmap on pipes.. surprise */
-       pipe_read_open,
-       NULL,           /* flush */
-       pipe_read_release,
-       NULL
+       llseek:         pipe_lseek,
+       read:           connect_read,
+       write:          bad_pipe_w,
+       poll:           connect_poll,
+       ioctl:          pipe_ioctl,
+       open:           pipe_read_open,
+       release:        pipe_read_release,
 };
 
 struct file_operations read_fifo_fops = {
-       pipe_lseek,
-       pipe_read,
-       bad_pipe_w,
-       NULL,           /* no readdir */
-       fifo_poll,
-       pipe_ioctl,
-       NULL,           /* no mmap on pipes.. surprise */
-       pipe_read_open,
-       NULL,           /* flush */
-       pipe_read_release,
-       NULL
+       llseek:         pipe_lseek,
+       read:           pipe_read,
+       write:          bad_pipe_w,
+       poll:           fifo_poll,
+       ioctl:          pipe_ioctl,
+       open:           pipe_read_open,
+       release:        pipe_read_release,
 };
 
 struct file_operations write_fifo_fops = {
-       pipe_lseek,
-       bad_pipe_r,
-       pipe_write,
-       NULL,           /* no readdir */
-       fifo_poll,
-       pipe_ioctl,
-       NULL,           /* mmap */
-       pipe_write_open,
-       NULL,           /* flush */
-       pipe_write_release,
-       NULL
+       llseek:         pipe_lseek,
+       read:           bad_pipe_r,
+       write:          pipe_write,
+       poll:           fifo_poll,
+       ioctl:          pipe_ioctl,
+       open:           pipe_write_open,
+       release:        pipe_write_release,
 };
 
 struct file_operations rdwr_fifo_fops = {
-       pipe_lseek,
-       pipe_read,
-       pipe_write,
-       NULL,           /* no readdir */
-       fifo_poll,
-       pipe_ioctl,
-       NULL,           /* mmap */
-       pipe_rdwr_open,
-       NULL,           /* flush */
-       pipe_rdwr_release,
-       NULL
+       llseek:         pipe_lseek,
+       read:           pipe_read,
+       write:          pipe_write,
+       poll:           fifo_poll,
+       ioctl:          pipe_ioctl,
+       open:           pipe_rdwr_open,
+       release:        pipe_rdwr_release,
 };
 
 struct file_operations read_pipe_fops = {
-       pipe_lseek,
-       pipe_read,
-       bad_pipe_w,
-       NULL,           /* no readdir */
-       pipe_poll,
-       pipe_ioctl,
-       NULL,           /* no mmap on pipes.. surprise */
-       pipe_read_open,
-       NULL,           /* flush */
-       pipe_read_release,
-       NULL
+       llseek:         pipe_lseek,
+       read:           pipe_read,
+       write:          bad_pipe_w,
+       poll:           pipe_poll,
+       ioctl:          pipe_ioctl,
+       open:           pipe_read_open,
+       release:        pipe_read_release,
 };
 
 struct file_operations write_pipe_fops = {
-       pipe_lseek,
-       bad_pipe_r,
-       pipe_write,
-       NULL,           /* no readdir */
-       pipe_poll,
-       pipe_ioctl,
-       NULL,           /* mmap */
-       pipe_write_open,
-       NULL,           /* flush */
-       pipe_write_release,
-       NULL
+       llseek:         pipe_lseek,
+       read:           bad_pipe_r,
+       write:          pipe_write,
+       poll:           pipe_poll,
+       ioctl:          pipe_ioctl,
+       open:           pipe_write_open,
+       release:        pipe_write_release,
 };
 
 struct file_operations rdwr_pipe_fops = {
-       pipe_lseek,
-       pipe_read,
-       pipe_write,
-       NULL,           /* no readdir */
-       pipe_poll,
-       pipe_ioctl,
-       NULL,           /* mmap */
-       pipe_rdwr_open,
-       NULL,           /* flush */
-       pipe_rdwr_release,
-       NULL
+       llseek:         pipe_lseek,
+       read:           pipe_read,
+       write:          pipe_write,
+       poll:           pipe_poll,
+       ioctl:          pipe_ioctl,
+       open:           pipe_rdwr_open,
+       release:        pipe_rdwr_release,
 };
 
 static struct inode * get_pipe_inode(void)
index 08b6859e51bc94c7e039d32b6c6fc494ee799157..693ad70caa947ed5c43cc84025277e37f036cda6 100644 (file)
@@ -205,8 +205,7 @@ static ssize_t pid_maps_read(struct file * file, char * buf,
 }
 
 static struct file_operations proc_maps_operations = {
-       NULL,           /* array_lseek */
-       pid_maps_read,
+       read:           pid_maps_read,
 };
 
 struct inode_operations proc_maps_inode_operations = {
@@ -257,8 +256,7 @@ static ssize_t proc_info_read(struct file * file, char * buf,
 }
 
 static struct file_operations proc_info_file_operations = {
-    NULL,                      /* lseek   */
-    proc_info_read,            /* read    */
+       read:           proc_info_read,
 };
 
 static struct inode_operations proc_info_inode_operations = {
@@ -347,9 +345,8 @@ static ssize_t mem_write(struct file * file, const char * buf,
 }
 
 static struct file_operations proc_mem_operations = {
-       NULL,           /* lseek - default */
-       mem_read,
-       mem_write,
+       read:           mem_read,
+       write:          mem_write,
 };
 
 static struct inode_operations proc_mem_inode_operations = {
@@ -760,10 +757,8 @@ out:
 }
 
 static struct file_operations proc_fd_operations = {
-       NULL,                   /* lseek - default */
-       proc_dir_read,          /* read - bad */
-       NULL,                   /* write - bad */
-       proc_readfd,            /* readdir */
+       read: proc_dir_read,            /* read - bad */
+       readdir: proc_readfd,           /* readdir */
 };
 
 /*
@@ -881,10 +876,8 @@ out:
 }
 
 static struct file_operations proc_base_operations = {
-       NULL,                   /* lseek - default */
-       proc_dir_read,          /* read - bad */
-       NULL,                   /* write - bad */
-       proc_base_readdir,      /* readdir */
+       read: proc_dir_read,            /* read - bad */
+       readdir: proc_base_readdir,     /* readdir */
 };
 
 static struct inode_operations proc_base_inode_operations = {
index 3017323b2aeb43a4093ec1d11ba330688057f0ad..ad42f4fbcd08f1094a9c2a7315b18ffc8a6d4032 100644 (file)
@@ -32,9 +32,9 @@ int proc_match(int len, const char *name,struct proc_dir_entry * de)
 }
 
 static struct file_operations proc_file_operations = {
-    proc_file_lseek,   /* lseek   */
-    proc_file_read,    /* read    */
-    proc_file_write,   /* write   */
+       llseek:         proc_file_lseek,
+       read:           proc_file_read,
+       write:          proc_file_write,
 };
 
 static struct inode_operations proc_file_inode_operations = {
@@ -337,10 +337,7 @@ int proc_readdir(struct file * filp,
  * the /proc directory.
  */
 static struct file_operations proc_dir_operations = {
-       NULL,                   /* lseek - default */
-       NULL,                   /* read - bad */
-       NULL,                   /* write - bad */
-       proc_readdir,           /* readdir */
+       readdir:                proc_readdir,
 };
 
 /*
index f63bcac6ed1a41a1837c8b275950fc20c2ef1fb6..01ac4fe2a55d8813e1b2eea82cad9f41d95b6432 100644 (file)
@@ -27,14 +27,8 @@ static int open_kcore(struct inode * inode, struct file * filp)
 static ssize_t read_kcore(struct file *, char *, size_t, loff_t *);
 
 static struct file_operations proc_kcore_operations = {
-       NULL,           /* lseek */
-       read_kcore,
-       NULL,           /* write */
-       NULL,           /* readdir */
-       NULL,           /* poll */
-       NULL,           /* ioctl */
-       NULL,           /* mmap */
-       open_kcore
+       read:           read_kcore,
+       open:           open_kcore,
 };
 
 struct inode_operations proc_kcore_inode_operations = {
index b9344ba55e8989d983b422aa25d0a6ffe2cd64fc..a8fe0fc3c9da4d0030f81b77805948d6dd0f5a14 100644 (file)
@@ -46,17 +46,10 @@ static unsigned int kmsg_poll(struct file *file, poll_table * wait)
 
 
 static struct file_operations proc_kmsg_operations = {
-       NULL,           /* kmsg_lseek */
-       kmsg_read,
-       NULL,           /* kmsg_write */
-       NULL,           /* kmsg_readdir */
-       kmsg_poll,      /* kmsg_poll */
-       NULL,           /* kmsg_ioctl */
-       NULL,           /* mmap */
-       kmsg_open,
-       NULL,           /* flush */
-       kmsg_release,
-       NULL            /* can't fsync */
+       read:           kmsg_read,
+       poll:           kmsg_poll,
+       open:           kmsg_open,
+       release:        kmsg_release,
 };
 
 struct inode_operations proc_kmsg_inode_operations = {
index b68395305af5bcae842cd57d64b753a241828208..d891c9e34ef1cbe03ded6e4dbb26b12d4a4bf9cd 100644 (file)
@@ -592,9 +592,8 @@ static ssize_t write_profile(struct file * file, const char * buf,
 }
 
 static struct file_operations proc_profile_operations = {
-       NULL,           /* lseek */
-       read_profile,
-       write_profile,
+       read:           read_profile,
+       write:          write_profile,
 };
 
 static struct inode_operations proc_profile_inode_operations = {
index 75780167ad72c24b6a9b0aa098f8a9eedaab250d..8bacabed22650c10e02725d5ff78e46bdfdc2efb 100644 (file)
@@ -143,10 +143,7 @@ static int proc_root_readdir(struct file * filp,
  * directory handling functions for that..
  */
 static struct file_operations proc_root_operations = {
-       NULL,                   /* lseek - default */
-       NULL,                   /* read - bad */
-       NULL,                   /* write - bad */
-       proc_root_readdir,      /* readdir */
+       readdir: proc_root_readdir,
 };
 
 /*
index 4cea74fe5de9336ca89f424b7a955a3ed7889015..94871b48e7fb06c10ed0d1e165e50876c001397b 100644 (file)
@@ -156,10 +156,12 @@ int qnx4_sync_file(struct file *file, struct dentry *dentry)
              S_ISLNK(inode->i_mode)))
                return -EINVAL;
 
+       lock_kernel();
        for (wait = 0; wait <= 1; wait++) {
                err |= sync_direct(inode, wait);
        }
        err |= qnx4_sync_inode(inode);
+       unlock_kernel();
        return (err < 0) ? -EIO : 0;
 }
 
index 692754912a235435804ff64ead97978250108481..45fdc4fe3bf7437d15e4017d6706bbf1be0d4ee2 100644 (file)
@@ -447,18 +447,8 @@ romfs_readpage(struct dentry * dentry, struct page * page)
 /* Mapping from our types to the kernel */
 
 static struct file_operations romfs_file_operations = {
-       NULL,                   /* lseek - default */
-        generic_file_read,     /* read */
-       NULL,                   /* write - bad */
-       NULL,                   /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl */
-       generic_file_mmap,      /* mmap */
-       NULL,                   /* open */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       NULL,                   /* fsync */
-       NULL,                   /* fasync */
+       read:           generic_file_read,
+       mmap:           generic_file_mmap,
 };
 
 static struct inode_operations romfs_file_inode_operations = {
@@ -483,10 +473,7 @@ static struct inode_operations romfs_file_inode_operations = {
 };
 
 static struct file_operations romfs_dir_operations = {
-       NULL,                   /* lseek - default */
-        NULL,                  /* read */
-       NULL,                   /* write - bad */
-       romfs_readdir,          /* readdir */
+       readdir:        romfs_readdir,
 };
 
 /* Merged dir/symlink op table.  readdir/lookup/readlink/follow_link
index 37bf168f6a937cb5800712fc559f643ca660624d..dd0efd7253c2771914f04582b2d2c36f178270a0 100644 (file)
@@ -32,17 +32,10 @@ static int smb_rename(struct inode *, struct dentry *,
 
 static struct file_operations smb_dir_operations =
 {
-       NULL,                   /* lseek - default */
-       smb_dir_read,           /* read - bad */
-       NULL,                   /* write - bad */
-       smb_readdir,            /* readdir */
-       NULL,                   /* poll - default */
-       smb_ioctl,              /* ioctl */
-       NULL,                   /* mmap */
-       smb_dir_open,           /* open(struct inode *, struct file *) */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       NULL                    /* fsync */
+       read:           smb_dir_read,
+       readdir:        smb_readdir,
+       ioctl:          smb_ioctl,
+       open:           smb_dir_open,
 };
 
 struct inode_operations smb_dir_inode_operations =
index f5aff87309d448f7d8b5be38e91d629275caf0bd..649ea76094e212009f26058db15e98d034cd4c9d 100644 (file)
@@ -367,19 +367,13 @@ printk("smb_file_permission: mode=%x, mask=%x\n", mode, mask);
 
 static struct file_operations smb_file_operations =
 {
-       NULL,                   /* lseek - default */
-       smb_file_read,          /* read */
-       smb_file_write,         /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* poll - default */
-       smb_ioctl,              /* ioctl */
-       smb_file_mmap,          /* mmap(struct file*, struct vm_area_struct*) */
-       smb_file_open,          /* open(struct inode*, struct file*) */
-       NULL,                   /* flush */
-       smb_file_release,       /* release(struct inode*, struct file*) */
-       smb_fsync,              /* fsync(struct file*, struct dentry*) */
-       NULL,                   /* fasync(struct file*, int) */
-       NULL                    /* lock(struct file*, int, struct file_lock*) */
+       read:           smb_file_read,
+       write:          smb_file_write,
+       ioctl:          smb_ioctl,
+       mmap:           smb_file_mmap,
+       open:           smb_file_open,
+       release:        smb_file_release,
+       fsync:          smb_fsync,
 };
 
 struct inode_operations smb_file_inode_operations =
index f17fb8b637a463e01ffa94755422db7517922e91..08517166c09c73e58f94c3c4cb143228e14a7125 100644 (file)
@@ -30,17 +30,9 @@ static ssize_t sysv_dir_read(struct file * filp, char * buf,
 static int sysv_readdir(struct file *, void *, filldir_t);
 
 static struct file_operations sysv_dir_operations = {
-       NULL,                   /* lseek - default */
-       sysv_dir_read,          /* read */
-       NULL,                   /* write - bad */
-       sysv_readdir,           /* readdir */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       file_fsync              /* default fsync */
+       read:           sysv_dir_read,
+       readdir:        sysv_readdir,
+       fsync:          file_fsync,
 };
 
 /*
index 2a0d038504b7dd096b86d976556d58188375c730..6b827cbb480605db7f7990980bb4d6ef8b2673c9 100644 (file)
@@ -45,18 +45,10 @@ sysv_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
  * the coh filesystem.
  */
 static struct file_operations sysv_file_operations = {
-       NULL,                   /* lseek - default */
-       generic_file_read,      /* read */
-       sysv_file_write,        /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl - default */
-       generic_file_mmap,      /* mmap */
-       NULL,                   /* no special open is needed */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       sysv_sync_file,         /* fsync */
-       NULL,                   /* fasync */
+       read:           generic_file_read,
+       write:          sysv_file_write,
+       mmap:           generic_file_mmap,
+       fsync:          sysv_sync_file,
 };
 
 struct inode_operations sysv_file_inode_operations = {
index b0e1138c77aa3ca236cb58b3f6dbcc928c6eb570..ab0755cef1c92f0ccd0b874cd2b675e23838f9e0 100644 (file)
@@ -187,6 +187,7 @@ int sysv_sync_file(struct file * file, struct dentry *dentry)
             S_ISLNK(inode->i_mode)))
                return -EINVAL;
 
+       lock_kernel();
        for (wait=0; wait<=1; wait++) {
                err |= sync_direct(inode, wait);
                err |= sync_indirect(inode, inode->u.sysv_i.i_data+10, 0, wait);
@@ -194,5 +195,6 @@ int sysv_sync_file(struct file * file, struct dentry *dentry)
                err |= sync_tindirect(inode, inode->u.sysv_i.i_data+12, 0, wait);
        }
        err |= sysv_sync_inode (inode);
+       unlock_kernel();
        return (err < 0) ? -EIO : 0;
 }
index 91668318674ef1bddedf95dc452a811a12738113..3843571aa14ba2fa115241b11bf8b5d078a6154e 100644 (file)
@@ -50,19 +50,9 @@ static int do_udf_readdir(struct inode *, struct file *, filldir_t, void *);
 /* readdir and lookup functions */
 
 static struct file_operations udf_dir_operations = {
-       NULL,                   /* lllseek */
-       NULL,                   /* read */
-       NULL,                   /* write */
-       udf_readdir,    /* readdir */
-       NULL,                   /* poll */
-       udf_ioctl,              /* ioctl */
-       NULL,                   /* mmap */
-       NULL,                   /* open */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       udf_sync_file,  /* fsync */
-       NULL,                   /* fasync */
-       NULL                    /* lock */
+       readdir:        udf_readdir,
+       ioctl:          udf_ioctl,
+       fsync:          udf_sync_file,
 };
 
 struct inode_operations udf_dir_inode_operations = {
index 8ea44d2a885ee1da8401deddfbede2d7feaebacc..28b83b18da920393947190dafbf5748d611717c3 100644 (file)
@@ -338,19 +338,14 @@ static int udf_open_file(struct inode * inode, struct file * filp)
 }
 
 static struct file_operations udf_file_operations = {
-       udf_file_llseek,                /* llseek */
-       generic_file_read,              /* read */
-       udf_file_write,                 /* write */
-       NULL,                                   /* readdir */
-       NULL,                                   /* poll */
-       udf_ioctl,                              /* ioctl */
-       generic_file_mmap,              /* mmap */
-       udf_open_file,                  /* open */
-       NULL,                                   /* flush */
-       udf_release_file,               /* release */
-       udf_sync_file,                  /* fsync */
-       NULL,                                   /* fasync */
-       NULL                                    /* lock */
+       llseek:         udf_file_llseek,
+       read:           generic_file_read,
+       write:          udf_file_write,
+       ioctl:          udf_ioctl,
+       mmap:           generic_file_mmap,
+       open:           udf_open_file,
+       release:        udf_release_file,
+       fsync:          udf_sync_file,
 };
 
 struct inode_operations udf_file_inode_operations = {
@@ -379,19 +374,12 @@ struct inode_operations udf_file_inode_operations = {
 };
 
 static struct file_operations udf_file_operations_adinicb = {
-       udf_file_llseek,                /* llseek */
-       generic_file_read,              /* read */
-       udf_file_write_adinicb, /* write */
-       NULL,                                   /* readdir */
-       NULL,                                   /* poll */
-       udf_ioctl,                              /* ioctl */
-       NULL,                                   /* mmap */
-       NULL,                                   /* open */
-       NULL,                                   /* flush */
-       udf_release_file,               /* release */
-       udf_sync_file_adinicb,  /* fsync */
-       NULL,                                   /* fasync */
-       NULL                                    /* lock */
+       llseek:         udf_file_llseek,
+       read:           generic_file_read,
+       write:          udf_file_write_adinicb,
+       ioctl:          udf_ioctl,
+       release:        udf_release_file,
+       fsync:          udf_sync_file_adinicb,
 };
 
 struct inode_operations udf_file_inode_operations_adinicb = {
index b5c10c91b8338d3c98cb634e83e6c3cc55ebc238..0eea4f1e231e762ed68d3c2556d4d9fce1e7e50e 100644 (file)
@@ -100,6 +100,7 @@ int udf_sync_file(struct file * file, struct dentry *dentry)
        int wait, err = 0;
        struct inode *inode = dentry->d_inode;
 
+       lock_kernel();
        if (S_ISLNK(inode->i_mode) && !(inode->i_blocks)) 
        {
                /*
@@ -116,10 +117,16 @@ int udf_sync_file(struct file * file, struct dentry *dentry)
        }
 skip:
        err |= udf_sync_inode (inode);
+       unlock_kernel();
        return err ? -EIO : 0;
 }
 
 int udf_sync_file_adinicb(struct file * file, struct dentry *dentry)
 {
-       return udf_sync_inode(dentry->d_inode) ? -EIO : 0;
+       int ret;
+
+       lock_kernel();
+       ret = udf_sync_inode(dentry->d_inode) ? -EIO : 0;
+       unlock_kernel();
+       return ret;
 }
index a828f3036ab5ec28f1525eaa0993811258f7516b..d9701af9247f257d24b05f3f06a5822fc06138e1 100644 (file)
@@ -178,18 +178,8 @@ int ufs_check_dir_entry (const char * function,    struct inode * dir,
 }
 
 static struct file_operations ufs_dir_operations = {
-       NULL,                   /* lseek */
-       NULL,                   /* read */
-       NULL,                   /* write */
-       ufs_readdir,            /* readdir */
-       NULL,                   /* select */
-       NULL,                   /* ioctl */
-       NULL,                   /* mmap */
-       NULL,                   /* open */
-       NULL,                   /* flush */
-       NULL,                   /* release */
-       file_fsync,             /* fsync */
-       NULL,                   /* fasync */
+       readdir:        ufs_readdir,
+       fsync:          file_fsync,
 };
 
 struct inode_operations ufs_dir_inode_operations = {
index fa4734d23c91322a2a661df42eaf90a38fb6057f..277586de8bfcbcf44022ec0ddf8febae53356507 100644 (file)
@@ -121,18 +121,11 @@ static int ufs_release_file (struct inode * inode, struct file * filp)
  * the ufs filesystem.
  */
 static struct file_operations ufs_file_operations = {
-       ufs_file_lseek, /* lseek */
-       generic_file_read,      /* read */
-       ufs_file_write,         /* write */
-       NULL,                   /* readdir - bad */
-       NULL,                   /* poll - default */
-       NULL,                   /* ioctl */
-       generic_file_mmap,      /* mmap */
-       NULL,                   /* no special open is needed */
-       NULL,                   /* flush */
-       ufs_release_file,       /* release */
-       NULL,                   /* fsync */
-       NULL,                   /* fasync */
+       llseek:         ufs_file_lseek,
+       read:           generic_file_read,
+       write:          ufs_file_write,
+       mmap:           generic_file_mmap,
+       release:        ufs_release_file,
 };
 
 struct inode_operations ufs_file_inode_operations = {
index af875aa7952175254699fd174310ed82b5881a2d..b3effd28511e37b751b24120d292141039b4b224 100644 (file)
@@ -802,17 +802,9 @@ out_noread:
 
 static struct file_operations umsdos_dir_operations =
 {
-       NULL,                   /* lseek - default */
-       dummy_dir_read,         /* read */
-       NULL,                   /* write - bad */
-       UMSDOS_readdir,         /* readdir */
-       NULL,                   /* poll - default */
-       UMSDOS_ioctl_dir,       /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       NULL                    /* fsync */
+       read:           dummy_dir_read,
+       readdir:        UMSDOS_readdir,
+       ioctl:          UMSDOS_ioctl_dir,
 };
 
 struct inode_operations umsdos_dir_inode_operations =
index 2b972a524a99af48d42c88043cba503dd544056f..003f9b9c4b0b4110f15456edd1355b1ecafe4a22 100644 (file)
@@ -220,17 +220,9 @@ out:
  */
 static struct file_operations umsdos_rdir_operations =
 {
-       NULL,                   /* lseek - default */
-       dummy_dir_read,         /* read */
-       NULL,                   /* write - bad */
-       UMSDOS_rreaddir,        /* readdir */
-       NULL,                   /* poll - default */
-       UMSDOS_ioctl_dir,       /* ioctl - default */
-       NULL,                   /* mmap */
-       NULL,                   /* no special open code */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       NULL                    /* fsync */
+       read:           dummy_dir_read,
+       readdir:        UMSDOS_rreaddir,
+       ioctl:          UMSDOS_ioctl_dir,
 };
 
 struct inode_operations umsdos_rdir_inode_operations =
index d6f199989563818776bf7552cc2186d6f9669fe5..67855d1639c0b4b1be015c2f5973ec92334a4e83 100644 (file)
 typedef struct { unsigned long long pte; } pte_t;
 typedef struct { unsigned long long pmd; } pmd_t;
 typedef struct { unsigned long long pgd; } pgd_t;
+#define PTE_MASK       (~(unsigned long long) (PAGE_SIZE-1))
 #else
 typedef struct { unsigned long pte; } pte_t;
 typedef struct { unsigned long pmd; } pmd_t;
 typedef struct { unsigned long pgd; } pgd_t;
+#define PTE_MASK       PAGE_MASK
 #endif
 
 typedef struct { unsigned long pgprot; } pgprot_t;
index ae59ea0a55162a96fdf27aa9b4e6f4b96d51bfef..ef491587f332849e6d3d96858ac72ad85d74f9e4 100644 (file)
@@ -154,7 +154,7 @@ extern unsigned long empty_zero_page[1024];
 
 #define _PAGE_TABLE    (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
 #define _KERNPG_TABLE  (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
-#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
+#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
 
 #define PAGE_NONE      __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
 #define PAGE_SHARED    __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
index 47788c5ff4ebb544392b543cf6656d86553e91d5..95e97de35f32b1723467fd34bea52a6a67317655 100644 (file)
@@ -138,7 +138,6 @@ struct atm_cirange {
 #include <linux/time.h> /* struct timeval */
 #include <linux/net.h>
 #include <linux/skbuff.h> /* struct sk_buff */
-#include <linux/atm.h>
 #include <linux/uio.h>
 #include <net/sock.h>
 #include <asm/atomic.h>
index 6b35df9cc42d74690badbc5ae94c6cf716d70d20..cabc0a8be1a070a3fed4b1ad937601ce364f85a8 100644 (file)
 #include <linux/types.h>
 #include <asm/bitops.h>
 #include <linux/module.h>
-#include <linux/mm.h>
 #include <linux/hdreg.h>
 #include <linux/sysctl.h>
-#include <linux/fs.h>
 #include <linux/proc_fs.h>
 #include <linux/smp_lock.h>
 #include <linux/delay.h>
index 8a68b3ad5749e53803f7c949c4922751d3267623..e040ee454d72edeb8e916d7059ad1a9db1c05edd 100644 (file)
@@ -41,10 +41,10 @@ NORET_TYPE void panic(const char * fmt, ...)
        vsprintf(buf, fmt, args);
        va_end(args);
        printk(KERN_EMERG "Kernel panic: %s\n",buf);
-       if (current == init_tasks[0])
-               printk(KERN_EMERG "In swapper task - not syncing\n");
-       else if (in_interrupt())
+       if (in_interrupt())
                printk(KERN_EMERG "In interrupt handler - not syncing\n");
+       else if (!current->pid)
+               printk(KERN_EMERG "In idle task - not syncing\n");
        else
                sys_sync();
 
index 50ba370601510b5427d4cd6c95ab36d4342c027d..3ab91f36e3c44b5f92c1d747fe7c77ccc207e969 100644 (file)
@@ -111,17 +111,8 @@ static int proc_sys_permission(struct inode *, int);
 
 struct file_operations proc_sys_file_operations =
 {
-       NULL,           /* lseek   */
-       proc_readsys,   /* read    */
-       proc_writesys,  /* write   */
-       NULL,           /* readdir */
-       NULL,           /* poll    */
-       NULL,           /* ioctl   */
-       NULL,           /* mmap    */
-       NULL,           /* no special open code    */
-       NULL,           /* no special flush code */
-       NULL,           /* no special release code */
-       NULL            /* can't fsync */
+       read:           proc_readsys,
+       write:          proc_writesys,
 };
 
 struct inode_operations proc_sys_inode_operations =
index 0920d1f0c8b8582af82cd60c0eb3b294a92300a5..c779b18ebaedba44d8bc45a72f3e51faeaa5cebb 100644 (file)
@@ -41,9 +41,8 @@ static int parse_qos(const char *buff, int len);
  *   Define allowed FILE OPERATIONS
  */
 static struct file_operations mpc_file_operations = {
-        NULL,                   /* lseek */
-        proc_mpc_read,          /* read */
-        proc_mpc_write,         /* write */
+       read:           proc_mpc_read,
+       write:          proc_mpc_write,
 };
 
 /*
index 320dc9c9d102fd843c589b19a7d2a06ac787a219..b67ae428ae512e7d06d5d20168cdb4caf139e433 100644 (file)
@@ -56,13 +56,11 @@ static ssize_t proc_spec_atm_read(struct file *file,char *buf,size_t count,
     loff_t *pos);
 
 static struct file_operations proc_dev_atm_operations = {
-       NULL,                   /* lseek */
-       proc_dev_atm_read,      /* read */
+       read:           proc_dev_atm_read,
 };
 
 static struct file_operations proc_spec_atm_operations = {
-       NULL,                   /* lseek */
-       proc_spec_atm_read,     /* read */
+       read:           proc_spec_atm_read,
 };
 
 static struct inode_operations proc_dev_atm_inode_operations = {
index c26433f8018a84afbd47ec9a7de729ba99e0a521..7f23c4976c0642e5ce387aac3b1d0ebb56616383 100644 (file)
@@ -88,18 +88,12 @@ static ssize_t irda_write(struct file *file, const char *buffer,
 static u_int irda_poll(struct file *file, poll_table *wait);
 
 static struct file_operations irda_fops = {
-       NULL,          /* seek */
-       irda_read,     /* read */
-       irda_write,    /* write */
-       NULL,          /* readdir */
-       irda_poll,     /* poll */
-       irda_ioctl,    /* ioctl */
-       NULL,          /* mmap */
-       irda_open,
-       NULL,
-       irda_close,
-       NULL,
-       NULL,          /* fasync */
+       read:           irda_read,
+       write:          irda_write,
+       poll:           irda_poll,
+       ioctl:          irda_ioctl,
+       open:           irda_open,
+       release:        irda_close,
 };
 
 /* IrTTP */
index aa5bfc8860e180508769f704e9e72d5c62d39f51..31b0bd8902ea3c878d369d5129a3555ac05cf79b 100644 (file)
@@ -166,16 +166,13 @@ static int netlink_ioctl(struct inode *inode, struct file *file,
 
 
 static struct file_operations netlink_fops = {
-       netlink_lseek,
-       netlink_read,
-       netlink_write,
-       NULL,           /* netlink_readdir */
-       netlink_poll,
-       netlink_ioctl,
-       NULL,           /* netlink_mmap */
-       netlink_open,
-       NULL,           /* flush */
-       netlink_release
+       llseek:         netlink_lseek,
+       read:           netlink_read,
+       write:          netlink_write,
+       poll:           netlink_poll,
+       ioctl:          netlink_ioctl,
+       open:           netlink_open,
+       release:        netlink_release,
 };
 
 int __init init_netlink(void)
index 0878895907100b84b79091e7ad72b9c4f5620408..0d1601cddeee451f946ad551550bb491832707ca 100644 (file)
@@ -106,18 +106,15 @@ static int sock_fasync(int fd, struct file *filp, int on);
  */
 
 static struct file_operations socket_file_ops = {
-       sock_lseek,
-       sock_read,
-       sock_write,
-       NULL,                   /* readdir */
-       sock_poll,
-       sock_ioctl,
-       sock_mmap,
-       sock_no_open,           /* special open code to disallow open via /proc */
-       NULL,                   /* flush */
-       sock_close,
-       NULL,                   /* no fsync */
-       sock_fasync
+       llseek:         sock_lseek,
+       read:           sock_read,
+       write:          sock_write,
+       poll:           sock_poll,
+       ioctl:          sock_ioctl,
+       mmap:           sock_mmap,
+       open:           sock_no_open,   /* special open code to disallow open via /proc */
+       release:        sock_close,
+       fasync:         sock_fasync
 };
 
 /*
index 91696d57e92577d116a71fdbf5614e09768f523f..e0b8feba76a1772040b9c51312ec7f56bc0db754 100644 (file)
@@ -90,17 +90,7 @@ static int wandev_get_info(char* buf, char** start, off_t offs, int len);
  */
 static struct file_operations router_fops =
 {
-       NULL,                   /* lseek   */
-       router_proc_read,       /* read    */
-       NULL,                   /* write   */
-       NULL,                   /* readdir */
-       NULL,                   /* select  */
-       NULL,                   /* ioctl   */
-       NULL,                   /* mmap    */
-       NULL,                   /* no special open code    */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       NULL                    /* can't fsync */
+       read:           router_proc_read,
 };
 
 static struct inode_operations router_inode =
@@ -131,17 +121,8 @@ static struct inode_operations router_inode =
 
 static struct file_operations wandev_fops =
 {
-       NULL,                   /* lseek   */
-       router_proc_read,       /* read    */
-       NULL,                   /* write   */
-       NULL,                   /* readdir */
-       NULL,                   /* select  */
-       wanrouter_ioctl,        /* ioctl   */
-       NULL,                   /* mmap    */
-       NULL,                   /* no special open code    */
-       NULL,                   /* flush */
-       NULL,                   /* no special release code */
-       NULL                    /* can't fsync */
+       read:           router_proc_read,
+       ioctl:          wanrouter_ioctl,
 };
 
 static struct inode_operations wandev_inode =