Print this page
3741 zfs needs better comments
Submitted by:   Will Andrews <willa@spectralogic.com>
Submitted by:   Justin Gibbs <justing@spectralogic.com>
Submitted by:   Alan Somers <alans@spectralogic.com>
Reviewed by:    Matthew Ahrens <mahrens@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zfs_ctldir.c
          +++ new/usr/src/uts/common/fs/zfs/zfs_ctldir.c
↓ open down ↓ 497 lines elided ↑ open up ↑
 498  498          { VOPNAME_ACCESS,       { .vop_access = zfsctl_common_access }  },
 499  499          { VOPNAME_READDIR,      { .vop_readdir = gfs_vop_readdir }      },
 500  500          { VOPNAME_LOOKUP,       { .vop_lookup = zfsctl_root_lookup }    },
 501  501          { VOPNAME_SEEK,         { .vop_seek = fs_seek }                 },
 502  502          { VOPNAME_INACTIVE,     { .vop_inactive = gfs_vop_inactive }    },
 503  503          { VOPNAME_PATHCONF,     { .vop_pathconf = zfsctl_pathconf }     },
 504  504          { VOPNAME_FID,          { .vop_fid = zfsctl_common_fid  }       },
 505  505          { NULL }
 506  506  };
 507  507  
      508 +/*
      509 + * Gets the full dataset name that corresponds to the given snapshot name
      510 + * Example:
      511 + *      zfsctl_snapshot_zname("snap1") -> "mypool/myfs@snap1"
      512 + */
 508  513  static int
 509  514  zfsctl_snapshot_zname(vnode_t *vp, const char *name, int len, char *zname)
 510  515  {
 511  516          objset_t *os = ((zfsvfs_t *)((vp)->v_vfsp->vfs_data))->z_os;
 512  517  
 513  518          if (snapshot_namecheck(name, NULL, NULL) != 0)
 514  519                  return (SET_ERROR(EILSEQ));
 515  520          dmu_objset_name(os, zname);
 516  521          if (strlen(zname) + 1 + strlen(name) >= len)
 517  522                  return (SET_ERROR(ENAMETOOLONG));
↓ open down ↓ 837 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX