Print this page
3742 zfs comments need cleaner, more consistent style
Submitted by:   Will Andrews <willa@spectralogic.com>
Submitted by:   Alan Somers <alans@spectralogic.com>
Reviewed by:    Matthew Ahrens <mahrens@delphix.com>
Reviewed by:    George Wilson <george.wilson@delphix.com>
Reviewed by:    Eric Schrock <eric.schrock@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zfs_znode.c
          +++ new/usr/src/uts/common/fs/zfs/zfs_znode.c
↓ open down ↓ 998 lines elided ↑ open up ↑
 999  999  
1000 1000          if (obj_type == DMU_OT_ZNODE ||
1001 1001              acl_ids->z_aclp->z_version < ZFS_ACL_VERSION_FUID) {
1002 1002                  err = zfs_aclset_common(*zpp, acl_ids->z_aclp, cr, tx);
1003 1003                  ASSERT0(err);
1004 1004          }
1005 1005          ZFS_OBJ_HOLD_EXIT(zfsvfs, obj);
1006 1006  }
1007 1007  
1008 1008  /*
1009      - * zfs_xvattr_set only updates the in-core attributes
1010      - * it is assumed the caller will be doing an sa_bulk_update
1011      - * to push the changes out
     1009 + * Update in-core attributes.  It is assumed the caller will be doing an
     1010 + * sa_bulk_update to push the changes out.
1012 1011   */
1013 1012  void
1014 1013  zfs_xvattr_set(znode_t *zp, xvattr_t *xvap, dmu_tx_t *tx)
1015 1014  {
1016 1015          xoptattr_t *xoap;
1017 1016  
1018 1017          xoap = xva_getxoptattr(xvap);
1019 1018          ASSERT(xoap);
1020 1019  
1021 1020          if (XVA_ISSET_REQ(xvap, XAT_CREATETIME)) {
↓ open down ↓ 418 lines elided ↑ open up ↑
1440 1439          ASSERT(0);
1441 1440          return (0);
1442 1441  }
1443 1442  
1444 1443  /*
1445 1444   * Increase the file length
1446 1445   *
1447 1446   *      IN:     zp      - znode of file to free data in.
1448 1447   *              end     - new end-of-file
1449 1448   *
1450      - *      RETURN: 0 if success
1451      - *              error code if failure
     1449 + *      RETURN: 0 on success, error code on failure
1452 1450   */
1453 1451  static int
1454 1452  zfs_extend(znode_t *zp, uint64_t end)
1455 1453  {
1456 1454          zfsvfs_t *zfsvfs = zp->z_zfsvfs;
1457 1455          dmu_tx_t *tx;
1458 1456          rl_t *rl;
1459 1457          uint64_t newblksz;
1460 1458          int error;
1461 1459  
↓ open down ↓ 56 lines elided ↑ open up ↑
1518 1516          return (0);
1519 1517  }
1520 1518  
1521 1519  /*
1522 1520   * Free space in a file.
1523 1521   *
1524 1522   *      IN:     zp      - znode of file to free data in.
1525 1523   *              off     - start of section to free.
1526 1524   *              len     - length of section to free.
1527 1525   *
1528      - *      RETURN: 0 if success
1529      - *              error code if failure
     1526 + *      RETURN: 0 on success, error code on failure
1530 1527   */
1531 1528  static int
1532 1529  zfs_free_range(znode_t *zp, uint64_t off, uint64_t len)
1533 1530  {
1534 1531          zfsvfs_t *zfsvfs = zp->z_zfsvfs;
1535 1532          rl_t *rl;
1536 1533          int error;
1537 1534  
1538 1535          /*
1539 1536           * Lock the range being freed.
↓ open down ↓ 17 lines elided ↑ open up ↑
1557 1554  
1558 1555          return (error);
1559 1556  }
1560 1557  
1561 1558  /*
1562 1559   * Truncate a file
1563 1560   *
1564 1561   *      IN:     zp      - znode of file to free data in.
1565 1562   *              end     - new end-of-file.
1566 1563   *
1567      - *      RETURN: 0 if success
1568      - *              error code if failure
     1564 + *      RETURN: 0 on success, error code on failure
1569 1565   */
1570 1566  static int
1571 1567  zfs_trunc(znode_t *zp, uint64_t end)
1572 1568  {
1573 1569          zfsvfs_t *zfsvfs = zp->z_zfsvfs;
1574 1570          vnode_t *vp = ZTOV(zp);
1575 1571          dmu_tx_t *tx;
1576 1572          rl_t *rl;
1577 1573          int error;
1578 1574          sa_bulk_attr_t bulk[2];
↓ open down ↓ 77 lines elided ↑ open up ↑
1656 1652  
1657 1653  /*
1658 1654   * Free space in a file
1659 1655   *
1660 1656   *      IN:     zp      - znode of file to free data in.
1661 1657   *              off     - start of range
1662 1658   *              len     - end of range (0 => EOF)
1663 1659   *              flag    - current file open mode flags.
1664 1660   *              log     - TRUE if this action should be logged
1665 1661   *
1666      - *      RETURN: 0 if success
1667      - *              error code if failure
     1662 + *      RETURN: 0 on success, error code on failure
1668 1663   */
1669 1664  int
1670 1665  zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
1671 1666  {
1672 1667          vnode_t *vp = ZTOV(zp);
1673 1668          dmu_tx_t *tx;
1674 1669          zfsvfs_t *zfsvfs = zp->z_zfsvfs;
1675 1670          zilog_t *zilog = zfsvfs->z_log;
1676 1671          uint64_t mode;
1677 1672          uint64_t mtime[2], ctime[2];
↓ open down ↓ 471 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX