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_vfsops.c
          +++ new/usr/src/uts/common/fs/zfs/zfs_vfsops.c
↓ open down ↓ 1340 lines elided ↑ open up ↑
1341 1341          }
1342 1342  
1343 1343          *slashp = '\0';
1344 1344          error = dsl_dsobj_to_dsname(bpath, objnum, outpath);
1345 1345          *slashp = '/';
1346 1346  
1347 1347          return (error);
1348 1348  }
1349 1349  
1350 1350  /*
1351      - * zfs_check_global_label:
1352      - *      Check that the hex label string is appropriate for the dataset
1353      - *      being mounted into the global_zone proper.
     1351 + * Check that the hex label string is appropriate for the dataset being
     1352 + * mounted into the global_zone proper.
1354 1353   *
1355      - *      Return an error if the hex label string is not default or
1356      - *      admin_low/admin_high.  For admin_low labels, the corresponding
1357      - *      dataset must be readonly.
     1354 + * Return an error if the hex label string is not default or
     1355 + * admin_low/admin_high.  For admin_low labels, the corresponding
     1356 + * dataset must be readonly.
1358 1357   */
1359 1358  int
1360 1359  zfs_check_global_label(const char *dsname, const char *hexsl)
1361 1360  {
1362 1361          if (strcasecmp(hexsl, ZFS_MLSLABEL_DEFAULT) == 0)
1363 1362                  return (0);
1364 1363          if (strcasecmp(hexsl, ADMIN_HIGH) == 0)
1365 1364                  return (0);
1366 1365          if (strcasecmp(hexsl, ADMIN_LOW) == 0) {
1367 1366                  /* must be readonly */
↓ open down ↓ 1 lines elided ↑ open up ↑
1369 1368  
1370 1369                  if (dsl_prop_get_integer(dsname,
1371 1370                      zfs_prop_to_name(ZFS_PROP_READONLY), &rdonly, NULL))
1372 1371                          return (SET_ERROR(EACCES));
1373 1372                  return (rdonly ? 0 : EACCES);
1374 1373          }
1375 1374          return (SET_ERROR(EACCES));
1376 1375  }
1377 1376  
1378 1377  /*
1379      - * zfs_mount_label_policy:
1380      - *      Determine whether the mount is allowed according to MAC check.
1381      - *      by comparing (where appropriate) label of the dataset against
1382      - *      the label of the zone being mounted into.  If the dataset has
1383      - *      no label, create one.
     1378 + * Determine whether the mount is allowed according to MAC check.
     1379 + * by comparing (where appropriate) label of the dataset against
     1380 + * the label of the zone being mounted into.  If the dataset has
     1381 + * no label, create one.
1384 1382   *
1385      - *      Returns:
1386      - *               0 :    access allowed
1387      - *              >0 :    error code, such as EACCES
     1383 + * Returns 0 if access allowed, error otherwise (e.g. EACCES)
1388 1384   */
1389 1385  static int
1390 1386  zfs_mount_label_policy(vfs_t *vfsp, char *osname)
1391 1387  {
1392 1388          int             error, retv;
1393 1389          zone_t          *mntzone = NULL;
1394 1390          ts_label_t      *mnt_tsl;
1395 1391          bslabel_t       *mnt_sl;
1396 1392          bslabel_t       ds_sl;
1397 1393          char            ds_hexsl[MAXNAMELEN];
↓ open down ↓ 954 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX