Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Add VOP_FALLOCATE and VOP_FDISCARD to every vnode ops ta...



details:   https://anonhg.NetBSD.org/src/rev/daaefebed0b6
branches:  trunk
changeset: 797668:daaefebed0b6
user:      dholland <dholland%NetBSD.org@localhost>
date:      Fri Jul 25 08:20:51 2014 +0000

description:
Add VOP_FALLOCATE and VOP_FDISCARD to every vnode ops table I can
find.

The filesystem ones all call genfs_eopnotsupp - right now I am only
implementing the plumbing and we can implement fallocate and/or
fdiscard for files later.

The device ones call spec_fallocate (which is also genfs_eopnotsupp)
and spec_fdiscard, which dispatches to the device-level op.

The fifo ones all call vn_fifo_bypass, which also ends up being
EOPNOTSUPP.

diffstat:

 sys/coda/coda_vnops.c              |   6 ++++--
 sys/fs/adosfs/advnops.c            |   6 ++++--
 sys/fs/cd9660/cd9660_vnops.c       |  10 ++++++++--
 sys/fs/efs/efs_vnops.c             |  10 ++++++++--
 sys/fs/filecorefs/filecore_vnops.c |   6 ++++--
 sys/fs/hfs/hfs_vnops.c             |  10 ++++++++--
 sys/fs/msdosfs/msdosfs_vnops.c     |   6 ++++--
 sys/fs/nilfs/nilfs_vnops.c         |   6 ++++--
 sys/fs/ntfs/ntfs_vnops.c           |   6 ++++--
 sys/fs/ptyfs/ptyfs_vnops.c         |   6 ++++--
 sys/fs/puffs/puffs_vnops.c         |  10 ++++++++--
 sys/fs/smbfs/smbfs_vnops.c         |   6 ++++--
 sys/fs/sysvbfs/sysvbfs.c           |   6 ++++--
 sys/fs/tmpfs/tmpfs_fifoops.c       |   6 ++++--
 sys/fs/tmpfs/tmpfs_specops.c       |   6 ++++--
 sys/fs/tmpfs/tmpfs_vnops.c         |   6 ++++--
 sys/fs/udf/udf_vnops.c             |   6 ++++--
 sys/fs/union/union_vnops.c         |   6 ++++--
 sys/fs/unionfs/unionfs_vnops.c     |   2 ++
 sys/fs/v7fs/v7fs_extern.c          |  10 ++++++++--
 sys/miscfs/deadfs/dead_vnops.c     |   6 ++++--
 sys/miscfs/fdesc/fdesc_vnops.c     |   6 ++++--
 sys/miscfs/fifofs/fifo_vnops.c     |   6 ++++--
 sys/miscfs/kernfs/kernfs_vnops.c   |   6 ++++--
 sys/miscfs/procfs/procfs_vnops.c   |   6 ++++--
 sys/miscfs/specfs/spec_vnops.c     |   6 ++++--
 sys/nfs/nfs_vnops.c                |  10 ++++++++--
 sys/ufs/chfs/chfs_vnops.c          |   8 +++++++-
 sys/ufs/ext2fs/ext2fs_vnops.c      |  10 ++++++++--
 sys/ufs/ffs/ffs_vnops.c            |  10 ++++++++--
 sys/ufs/lfs/lfs_vnops.c            |  10 ++++++++--
 sys/ufs/mfs/mfs_vnops.c            |   6 ++++--
 32 files changed, 165 insertions(+), 61 deletions(-)

diffs (truncated from 1020 to 300 lines):

diff -r 9ffba4daca1f -r daaefebed0b6 sys/coda/coda_vnops.c
--- a/sys/coda/coda_vnops.c     Fri Jul 25 08:19:19 2014 +0000
+++ b/sys/coda/coda_vnops.c     Fri Jul 25 08:20:51 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: coda_vnops.c,v 1.96 2014/03/20 06:48:54 skrll Exp $    */
+/*     $NetBSD: coda_vnops.c,v 1.97 2014/07/25 08:20:51 dholland Exp $ */
 
 /*
  *
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.96 2014/03/20 06:48:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.97 2014/07/25 08:20:51 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -109,6 +109,8 @@
     { &vop_setattr_desc, coda_setattr },       /* setattr */
     { &vop_read_desc, coda_read },             /* read */
     { &vop_write_desc, coda_write },           /* write */
+    { &vop_fallocate_desc, genfs_eopnotsupp }, /* fallocate */
+    { &vop_fdiscard_desc, genfs_eopnotsupp },  /* fdiscard */
     { &vop_fcntl_desc, genfs_fcntl },          /* fcntl */
     { &vop_ioctl_desc, coda_ioctl },           /* ioctl */
     { &vop_mmap_desc, genfs_mmap },            /* mmap */
diff -r 9ffba4daca1f -r daaefebed0b6 sys/fs/adosfs/advnops.c
--- a/sys/fs/adosfs/advnops.c   Fri Jul 25 08:19:19 2014 +0000
+++ b/sys/fs/adosfs/advnops.c   Fri Jul 25 08:20:51 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: advnops.c,v 1.43 2014/01/23 10:13:56 hannken Exp $     */
+/*     $NetBSD: advnops.c,v 1.44 2014/07/25 08:20:51 dholland Exp $    */
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: advnops.c,v 1.43 2014/01/23 10:13:56 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: advnops.c,v 1.44 2014/07/25 08:20:51 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -105,6 +105,8 @@
        { &vop_setattr_desc, adosfs_setattr },          /* setattr */
        { &vop_read_desc, adosfs_read },                /* read */
        { &vop_write_desc, adosfs_write },              /* write */
+       { &vop_fallocate_desc, genfs_eopnotsupp },      /* fallocate */
+       { &vop_fdiscard_desc, genfs_eopnotsupp },       /* fdiscard */
        { &vop_fcntl_desc, adosfs_fcntl },              /* fcntl */
        { &vop_ioctl_desc, adosfs_ioctl },              /* ioctl */
        { &vop_poll_desc, adosfs_poll },                /* poll */
diff -r 9ffba4daca1f -r daaefebed0b6 sys/fs/cd9660/cd9660_vnops.c
--- a/sys/fs/cd9660/cd9660_vnops.c      Fri Jul 25 08:19:19 2014 +0000
+++ b/sys/fs/cd9660/cd9660_vnops.c      Fri Jul 25 08:20:51 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd9660_vnops.c,v 1.48 2014/06/14 07:39:29 hannken Exp $        */
+/*     $NetBSD: cd9660_vnops.c,v 1.49 2014/07/25 08:20:51 dholland Exp $       */
 
 /*-
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.48 2014/06/14 07:39:29 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.49 2014/07/25 08:20:51 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -859,6 +859,8 @@
        { &vop_setattr_desc, cd9660_setattr },          /* setattr */
        { &vop_read_desc, cd9660_read },                /* read */
        { &vop_write_desc, cd9660_write },              /* write */
+       { &vop_fallocate_desc, genfs_eopnotsupp },      /* fallocate */
+       { &vop_fdiscard_desc, genfs_eopnotsupp },       /* fdiscard */
        { &vop_fcntl_desc, genfs_fcntl },               /* fcntl */
        { &vop_ioctl_desc, cd9660_ioctl },              /* ioctl */
        { &vop_poll_desc, cd9660_poll },                /* poll */
@@ -909,6 +911,8 @@
        { &vop_setattr_desc, cd9660_setattr },          /* setattr */
        { &vop_read_desc, spec_read },                  /* read */
        { &vop_write_desc, spec_write },                /* write */
+       { &vop_fallocate_desc, spec_fallocate },        /* fallocate */
+       { &vop_fdiscard_desc, spec_fdiscard },          /* fdiscard */
        { &vop_fcntl_desc, genfs_fcntl },               /* fcntl */
        { &vop_ioctl_desc, spec_ioctl },                /* ioctl */
        { &vop_poll_desc, spec_poll },                  /* poll */
@@ -957,6 +961,8 @@
        { &vop_setattr_desc, cd9660_setattr },          /* setattr */
        { &vop_read_desc, vn_fifo_bypass },             /* read */
        { &vop_write_desc, vn_fifo_bypass },            /* write */
+       { &vop_fallocate_desc, vn_fifo_bypass },        /* fallocate */
+       { &vop_fdiscard_desc, vn_fifo_bypass },         /* fdiscard */
        { &vop_fcntl_desc, genfs_fcntl },               /* fcntl */
        { &vop_ioctl_desc, vn_fifo_bypass },            /* ioctl */
        { &vop_poll_desc, vn_fifo_bypass },             /* poll */
diff -r 9ffba4daca1f -r daaefebed0b6 sys/fs/efs/efs_vnops.c
--- a/sys/fs/efs/efs_vnops.c    Fri Jul 25 08:19:19 2014 +0000
+++ b/sys/fs/efs/efs_vnops.c    Fri Jul 25 08:20:51 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: efs_vnops.c,v 1.31 2014/02/07 15:29:21 hannken Exp $   */
+/*     $NetBSD: efs_vnops.c,v 1.32 2014/07/25 08:20:51 dholland Exp $  */
 
 /*
  * Copyright (c) 2006 Stephen M. Rumble <rumble%ephemeral.org@localhost>
@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: efs_vnops.c,v 1.31 2014/02/07 15:29:21 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: efs_vnops.c,v 1.32 2014/07/25 08:20:51 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -809,6 +809,8 @@
        { &vop_setattr_desc,    genfs_eopnotsupp},      /* setattr */
        { &vop_read_desc,       efs_read        },      /* read */
        { &vop_write_desc,      genfs_eopnotsupp},      /* write */
+       { &vop_fallocate_desc,  genfs_eopnotsupp},      /* fallocate */
+       { &vop_fdiscard_desc,   genfs_eopnotsupp},      /* fdiscard */
        { &vop_ioctl_desc,      genfs_enoioctl  },      /* ioctl */
        { &vop_fcntl_desc,      genfs_fcntl     },      /* fcntl */
        { &vop_poll_desc,       genfs_poll      },      /* poll */
@@ -865,6 +867,8 @@
        { &vop_setattr_desc,    genfs_eopnotsupp},      /* setattr */
        { &vop_read_desc,       spec_read       },      /* read */
        { &vop_write_desc,      spec_write      },      /* write */
+       { &vop_fallocate_desc,  spec_fallocate  },      /* fallocate */
+       { &vop_fdiscard_desc,   spec_fdiscard   },      /* fdiscard */
        { &vop_ioctl_desc,      spec_ioctl      },      /* ioctl */
        { &vop_fcntl_desc,      genfs_fcntl     },      /* fcntl */
        { &vop_poll_desc,       spec_poll       },      /* poll */
@@ -921,6 +925,8 @@
        { &vop_setattr_desc,    genfs_eopnotsupp},      /* setattr */
        { &vop_read_desc,       vn_fifo_bypass  },      /* read */
        { &vop_write_desc,      vn_fifo_bypass  },      /* write */
+       { &vop_fallocate_desc,  vn_fifo_bypass  },      /* fallocate */
+       { &vop_fdiscard_desc,   vn_fifo_bypass  },      /* fdiscard */
        { &vop_ioctl_desc,      vn_fifo_bypass  },      /* ioctl */
        { &vop_fcntl_desc,      genfs_fcntl     },      /* fcntl */
        { &vop_poll_desc,       vn_fifo_bypass  },      /* poll */
diff -r 9ffba4daca1f -r daaefebed0b6 sys/fs/filecorefs/filecore_vnops.c
--- a/sys/fs/filecorefs/filecore_vnops.c        Fri Jul 25 08:19:19 2014 +0000
+++ b/sys/fs/filecorefs/filecore_vnops.c        Fri Jul 25 08:20:51 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: filecore_vnops.c,v 1.41 2014/01/23 10:13:56 hannken Exp $      */
+/*     $NetBSD: filecore_vnops.c,v 1.42 2014/07/25 08:20:51 dholland Exp $     */
 
 /*-
  * Copyright (c) 1994 The Regents of the University of California.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: filecore_vnops.c,v 1.41 2014/01/23 10:13:56 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filecore_vnops.c,v 1.42 2014/07/25 08:20:51 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -565,6 +565,8 @@
        { &vop_setattr_desc, filecore_setattr },        /* setattr */
        { &vop_read_desc, filecore_read },              /* read */
        { &vop_write_desc, filecore_write },            /* write */
+       { &vop_fallocate_desc, genfs_eopnotsupp },      /* fallocate */
+       { &vop_fdiscard_desc, genfs_eopnotsupp },       /* fdiscard */
        { &vop_fcntl_desc, filecore_fcntl },            /* fcntl */
        { &vop_ioctl_desc, filecore_ioctl },            /* ioctl */
        { &vop_poll_desc, filecore_poll },              /* poll */
diff -r 9ffba4daca1f -r daaefebed0b6 sys/fs/hfs/hfs_vnops.c
--- a/sys/fs/hfs/hfs_vnops.c    Fri Jul 25 08:19:19 2014 +0000
+++ b/sys/fs/hfs/hfs_vnops.c    Fri Jul 25 08:20:51 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hfs_vnops.c,v 1.29 2014/02/07 15:29:21 hannken Exp $   */
+/*     $NetBSD: hfs_vnops.c,v 1.30 2014/07/25 08:20:51 dholland Exp $  */
 
 /*-
  * Copyright (c) 2005, 2007 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hfs_vnops.c,v 1.29 2014/02/07 15:29:21 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hfs_vnops.c,v 1.30 2014/07/25 08:20:51 dholland Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -165,6 +165,8 @@
        { &vop_setattr_desc, hfs_vop_setattr },         /* setattr */
        { &vop_read_desc, hfs_vop_read },               /* read */
        { &vop_write_desc, genfs_eopnotsupp },          /* write */
+       { &vop_fallocate_desc, genfs_eopnotsupp },      /* fallocate */
+       { &vop_fdiscard_desc, genfs_eopnotsupp },       /* fdiscard */
        { &vop_ioctl_desc, genfs_eopnotsupp },          /* ioctl */
        { &vop_fcntl_desc, genfs_fcntl },               /* fcntl */
        { &vop_poll_desc, genfs_eopnotsupp },           /* poll */
@@ -219,6 +221,8 @@
        { &vop_setattr_desc, hfs_vop_setattr },         /* setattr */
        { &vop_read_desc, spec_read },                  /* read */
        { &vop_write_desc, spec_write },                /* write */
+       { &vop_fallocate_desc, spec_fallocate },        /* fallocate */
+       { &vop_fdiscard_desc, spec_fdiscard },          /* fdiscard */
        { &vop_ioctl_desc, spec_ioctl },                /* ioctl */
        { &vop_fcntl_desc, genfs_fcntl },               /* fcntl */
        { &vop_poll_desc, spec_poll },                  /* poll */
@@ -275,6 +279,8 @@
        { &vop_setattr_desc, hfs_vop_setattr },         /* setattr */
        { &vop_read_desc, vn_fifo_bypass },             /* read */
        { &vop_write_desc, vn_fifo_bypass },            /* write */
+       { &vop_fallocate_desc, vn_fifo_bypass },        /* fallocate */
+       { &vop_fdiscard_desc, vn_fifo_bypass },         /* fdiscard */
        { &vop_ioctl_desc, vn_fifo_bypass },            /* ioctl */
        { &vop_fcntl_desc, genfs_fcntl },               /* fcntl */
        { &vop_poll_desc, vn_fifo_bypass },             /* poll */
diff -r 9ffba4daca1f -r daaefebed0b6 sys/fs/msdosfs/msdosfs_vnops.c
--- a/sys/fs/msdosfs/msdosfs_vnops.c    Fri Jul 25 08:19:19 2014 +0000
+++ b/sys/fs/msdosfs/msdosfs_vnops.c    Fri Jul 25 08:20:51 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_vnops.c,v 1.90 2014/07/08 09:21:52 hannken Exp $       */
+/*     $NetBSD: msdosfs_vnops.c,v 1.91 2014/07/25 08:20:51 dholland Exp $      */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.90 2014/07/08 09:21:52 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.91 2014/07/25 08:20:51 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1878,6 +1878,8 @@
        { &vop_setattr_desc, msdosfs_setattr },         /* setattr */
        { &vop_read_desc, msdosfs_read },               /* read */
        { &vop_write_desc, msdosfs_write },             /* write */
+       { &vop_fallocate_desc, genfs_eopnotsupp },      /* fallocate */
+       { &vop_fdiscard_desc, genfs_eopnotsupp },       /* fdiscard */
        { &vop_fcntl_desc, genfs_fcntl },               /* fcntl */
        { &vop_ioctl_desc, msdosfs_ioctl },             /* ioctl */
        { &vop_poll_desc, msdosfs_poll },               /* poll */
diff -r 9ffba4daca1f -r daaefebed0b6 sys/fs/nilfs/nilfs_vnops.c
--- a/sys/fs/nilfs/nilfs_vnops.c        Fri Jul 25 08:19:19 2014 +0000
+++ b/sys/fs/nilfs/nilfs_vnops.c        Fri Jul 25 08:20:51 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nilfs_vnops.c,v 1.27 2014/02/07 15:29:21 hannken Exp $ */
+/* $NetBSD: nilfs_vnops.c,v 1.28 2014/07/25 08:20:51 dholland Exp $ */
 
 /*
  * Copyright (c) 2008, 2009 Reinoud Zandijk
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.27 2014/02/07 15:29:21 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.28 2014/07/25 08:20:51 dholland Exp $");
 #endif /* not lint */
 
 
@@ -1572,6 +1572,8 @@
        { &vop_setattr_desc, nilfs_setattr },   /* setattr */   /* TODO chflags */
        { &vop_read_desc, nilfs_read },         /* read */
        { &vop_write_desc, nilfs_write },       /* write */     /* WRITE */
+       { &vop_fallocate_desc, genfs_eopnotsupp }, /* fallocate */
+       { &vop_fdiscard_desc, genfs_eopnotsupp }, /* fdiscard */
        { &vop_fcntl_desc, genfs_fcntl },       /* fcntl */     /* TODO? */
        { &vop_ioctl_desc, genfs_enoioctl },    /* ioctl */     /* TODO? */
        { &vop_poll_desc, genfs_poll },         /* poll */      /* TODO/OK? */
diff -r 9ffba4daca1f -r daaefebed0b6 sys/fs/ntfs/ntfs_vnops.c
--- a/sys/fs/ntfs/ntfs_vnops.c  Fri Jul 25 08:19:19 2014 +0000
+++ b/sys/fs/ntfs/ntfs_vnops.c  Fri Jul 25 08:20:51 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntfs_vnops.c,v 1.56 2014/02/07 15:29:21 hannken Exp $  */
+/*     $NetBSD: ntfs_vnops.c,v 1.57 2014/07/25 08:20:52 dholland Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ntfs_vnops.c,v 1.56 2014/02/07 15:29:21 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_vnops.c,v 1.57 2014/07/25 08:20:52 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -818,6 +818,8 @@
        { &vop_setattr_desc, genfs_eopnotsupp },        /* setattr */
        { &vop_read_desc, (vop_t *) ntfs_read },        /* read */
        { &vop_write_desc, (vop_t *) ntfs_write },      /* write */
+       { &vop_fallocate_desc, genfs_eopnotsupp },      /* fallocate */
+       { &vop_fdiscard_desc, genfs_eopnotsupp },       /* fdiscard */
        { &vop_fcntl_desc, genfs_fcntl },               /* fcntl */
        { &vop_ioctl_desc, genfs_enoioctl },            /* ioctl */
        { &vop_poll_desc, genfs_poll },                 /* poll */
diff -r 9ffba4daca1f -r daaefebed0b6 sys/fs/ptyfs/ptyfs_vnops.c
--- a/sys/fs/ptyfs/ptyfs_vnops.c        Fri Jul 25 08:19:19 2014 +0000
+++ b/sys/fs/ptyfs/ptyfs_vnops.c        Fri Jul 25 08:20:51 2014 +0000



Home | Main Index | Thread Index | Old Index