Print this page
8115 parallel zfs mount

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/udfs/udf_vfsops.c
          +++ new/usr/src/uts/common/fs/udfs/udf_vfsops.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   * Copyright (c) 2011 Bayard G. Bell. All rights reserved.
       25 + * Copyright (c) 2017 by Delphix. All rights reserved.
  25   26   */
  26   27  
  27   28  #include <sys/types.h>
  28   29  #include <sys/t_lock.h>
  29   30  #include <sys/param.h>
  30   31  #include <sys/time.h>
  31   32  #include <sys/systm.h>
  32   33  #include <sys/sysmacros.h>
  33   34  #include <sys/resource.h>
  34   35  #include <sys/signal.h>
↓ open down ↓ 79 lines elided ↑ open up ↑
 114  115  static int32_t udf_mountroot(struct vfs *vfsp, enum whymountroot);
 115  116  
 116  117  static int udfinit(int, char *);
 117  118  
 118  119  static mntopts_t udfs_mntopts;
 119  120  
 120  121  static vfsdef_t vfw = {
 121  122          VFSDEF_VERSION,
 122  123          "udfs",
 123  124          udfinit,
 124      -        VSW_HASPROTO|VSW_CANREMOUNT|VSW_STATS|VSW_CANLOFI,
      125 +        VSW_HASPROTO|VSW_CANREMOUNT|VSW_STATS|VSW_CANLOFI|VSW_MOUNTDEV,
 125  126          &udfs_mntopts
 126  127  };
 127  128  
 128  129  static mntopts_t udfs_mntopts = {
 129  130          0,
 130  131          NULL
 131  132  };
 132  133  
 133  134  /*
 134  135   * Module linkage information for the kernel.
↓ open down ↓ 35 lines elided ↑ open up ↑
 170  171   * XXX - this appears only to be used by the VM code to handle the case where
 171  172   * UNIX is running off the mini-root.  That probably wants to be done
 172  173   * differently.
 173  174   */
 174  175  struct vnode *rootvp;
 175  176  #ifndef __lint
 176  177  _NOTE(SCHEME_PROTECTS_DATA("safe sharing", rootvp))
 177  178  #endif
 178  179  static int32_t
 179  180  udf_mount(struct vfs *vfsp, struct vnode *mvp,
 180      -        struct mounta *uap, struct cred *cr)
      181 +    struct mounta *uap, struct cred *cr)
 181  182  {
 182  183          dev_t dev;
 183  184          struct vnode *lvp = NULL;
 184  185          struct vnode *svp = NULL;
 185  186          struct pathname dpn;
 186  187          int32_t error;
 187  188          enum whymountroot why;
 188  189          int oflag, aflag;
 189  190  
 190  191          ud_printf("udf_mount\n");
↓ open down ↓ 291 lines elided ↑ open up ↑
 482  483          ud_printf("udf_sync\n");
 483  484  
 484  485          ud_update(flag);
 485  486          return (0);
 486  487  }
 487  488  
 488  489  
 489  490  
 490  491  /* ARGSUSED */
 491  492  static int32_t
 492      -udf_vget(struct vfs *vfsp,
 493      -        struct vnode **vpp, struct fid *fidp)
      493 +udf_vget(struct vfs *vfsp, struct vnode **vpp, struct fid *fidp)
 494  494  {
 495  495          int32_t error = 0;
 496  496          struct udf_fid *udfid;
 497  497          struct udf_vfs *udf_vfsp;
 498  498          struct ud_inode *ip;
 499  499  
 500  500          ud_printf("udf_vget\n");
 501  501  
 502  502          udf_vfsp = (struct udf_vfs *)vfsp->vfs_data;
 503  503          if (udf_vfsp == NULL) {
↓ open down ↓ 101 lines elided ↑ open up ↑
 605  605          }
 606  606          vfs_unlock(vfsp);
 607  607          return (0);
 608  608  }
 609  609  
 610  610  
 611  611  /* ------------------------- local routines ------------------------- */
 612  612  
 613  613  
 614  614  static int32_t
 615      -ud_mountfs(struct vfs *vfsp,
 616      -        enum whymountroot why, dev_t dev, char *name,
 617      -        struct cred *cr, int32_t isroot)
      615 +ud_mountfs(struct vfs *vfsp, enum whymountroot why, dev_t dev, char *name,
      616 +    struct cred *cr, int32_t isroot)
 618  617  {
 619  618          struct vnode *devvp = NULL;
 620  619          int32_t error = 0;
 621  620          int32_t needclose = 0;
 622  621          struct udf_vfs *udf_vfsp = NULL;
 623  622          struct log_vol_int_desc *lvid;
 624  623          struct ud_inode *rip = NULL;
 625  624          struct vnode *rvp = NULL;
 626  625          int32_t i, lbsize;
 627  626          uint32_t avd_loc;
↓ open down ↓ 919 lines elided ↑ open up ↑
1547 1546                  ud_vfs_remove(udf_vfsp);
1548 1547          if (udf_vfsp->udf_fsmnt) {
1549 1548                  kmem_free(udf_vfsp->udf_fsmnt,
1550 1549                      strlen(udf_vfsp->udf_fsmnt) + 1);
1551 1550          }
1552 1551          kmem_free(udf_vfsp, sizeof (*udf_vfsp));
1553 1552  }
1554 1553  
1555 1554  void
1556 1555  ud_convert_to_superblock(struct udf_vfs *udf_vfsp,
1557      -        struct log_vol_int_desc *lvid)
     1556 +    struct log_vol_int_desc *lvid)
1558 1557  {
1559 1558          int32_t i, c;
1560 1559          uint32_t *temp;
1561 1560          struct ud_part *ud_part;
1562 1561          struct lvid_iu *iu;
1563 1562  
1564 1563          udf_vfsp->udf_maxuniq = SWAP_64(lvid->lvid_uniqid);
1565 1564          temp = lvid->lvid_fst;
1566 1565          c = SWAP_32(lvid->lvid_npart);
1567 1566          ud_part = udf_vfsp->udf_parts;
↓ open down ↓ 77 lines elided ↑ open up ↑
1645 1644   * int32_t ud_sub_blks[] = {2, 0, 152, 150};
1646 1645   */
1647 1646  int32_t ud_sub_blks[] = {152, 150, 2, 0};
1648 1647  int32_t ud_sub_count = 4;
1649 1648  
1650 1649  /*
1651 1650   * Validate the VAT ICB
1652 1651   */
1653 1652  static int32_t
1654 1653  ud_val_get_vat(struct udf_vfs *udf_vfsp, dev_t dev,
1655      -        daddr_t blkno, struct ud_map *udm)
     1654 +    daddr_t blkno, struct ud_map *udm)
1656 1655  {
1657 1656          struct buf *secbp;
1658 1657          struct file_entry *fe;
1659 1658          int32_t end_loc, i, j, ad_type;
1660 1659          struct short_ad *sad;
1661 1660          struct long_ad *lad;
1662 1661          uint32_t count, blk;
1663 1662          struct ud_part *ud_part;
1664 1663          int err = 0;
1665 1664  
↓ open down ↓ 103 lines elided ↑ open up ↑
1769 1768  end:
1770 1769          if (err)
1771 1770                  ud_free_map(udm);
1772 1771          secbp->b_flags |= B_AGE | B_STALE;
1773 1772          brelse(secbp);
1774 1773          return (err);
1775 1774  }
1776 1775  
1777 1776  int32_t
1778 1777  ud_read_sparing_tbls(struct udf_vfs *udf_vfsp,
1779      -        dev_t dev, struct ud_map *map, struct pmap_typ2 *typ2)
     1778 +    dev_t dev, struct ud_map *map, struct pmap_typ2 *typ2)
1780 1779  {
1781 1780          int32_t index, valid = 0;
1782 1781          uint32_t sz;
1783 1782          struct buf *bp;
1784 1783          struct stbl *stbl;
1785 1784  
1786 1785          map->udm_plen = SWAP_16(typ2->map2_pl);
1787 1786          map->udm_nspm = typ2->map2_nst;
1788 1787          map->udm_spsz = SWAP_32(typ2->map2_sest);
1789 1788          sz = (map->udm_spsz + udf_vfsp->udf_lbmask) & ~udf_vfsp->udf_lbmask;
↓ open down ↓ 159 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX