Illumos 4914 - zfs on-disk bookmark structure should be named *_phys_t

4914 zfs on-disk bookmark structure should be named *_phys_t

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>

References:
  https://www.illumos.org/issues/4914
  https://github.com/illumos/illumos-gate/commit/7802d7b

Porting notes:

There were a number of zfsonlinux-specific uses of zbookmark_t which
needed to be updated.  This should reduce the likelihood of further
problems like issue #2094 from occurring.

Ported by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2558
This commit is contained in:
Matthew Ahrens
2014-06-25 10:37:59 -08:00
committed by Brian Behlendorf
parent 1fa8f795d5
commit 5dbd68a352
27 changed files with 137 additions and 132 deletions
+10 -10
View File
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2013, 2014 by Delphix. All rights reserved.
*/
/*
@@ -35,7 +35,7 @@
* deleted from the log when the scrub completes.
*
* The log is stored using a ZAP object whose key is a string form of the
* zbookmark tuple (objset, object, level, blkid), and whose contents is an
* zbookmark_phys tuple (objset, object, level, blkid), and whose contents is an
* optional 'objset:object' human-readable string describing the data. When an
* error is first logged, this string will be empty, indicating that no name is
* known. This prevents us from having to issue a potentially large amount of
@@ -59,7 +59,7 @@
* Convert a bookmark to a string.
*/
static void
bookmark_to_name(zbookmark_t *zb, char *buf, size_t len)
bookmark_to_name(zbookmark_phys_t *zb, char *buf, size_t len)
{
(void) snprintf(buf, len, "%llx:%llx:%llx:%llx",
(u_longlong_t)zb->zb_objset, (u_longlong_t)zb->zb_object,
@@ -71,7 +71,7 @@ bookmark_to_name(zbookmark_t *zb, char *buf, size_t len)
*/
#ifdef _KERNEL
static void
name_to_bookmark(char *buf, zbookmark_t *zb)
name_to_bookmark(char *buf, zbookmark_phys_t *zb)
{
zb->zb_objset = strtonum(buf, &buf);
ASSERT(*buf == ':');
@@ -92,7 +92,7 @@ name_to_bookmark(char *buf, zbookmark_t *zb)
void
spa_log_error(spa_t *spa, zio_t *zio)
{
zbookmark_t *zb = &zio->io_logical->io_bookmark;
zbookmark_phys_t *zb = &zio->io_logical->io_bookmark;
spa_error_entry_t search;
spa_error_entry_t *new;
avl_tree_t *tree;
@@ -165,7 +165,7 @@ process_error_log(spa_t *spa, uint64_t obj, void *addr, size_t *count)
{
zap_cursor_t zc;
zap_attribute_t za;
zbookmark_t zb;
zbookmark_phys_t zb;
if (obj == 0)
return (0);
@@ -182,8 +182,8 @@ process_error_log(spa_t *spa, uint64_t obj, void *addr, size_t *count)
name_to_bookmark(za.za_name, &zb);
if (copyout(&zb, (char *)addr +
(*count - 1) * sizeof (zbookmark_t),
sizeof (zbookmark_t)) != 0) {
(*count - 1) * sizeof (zbookmark_phys_t),
sizeof (zbookmark_phys_t)) != 0) {
zap_cursor_fini(&zc);
return (SET_ERROR(EFAULT));
}
@@ -207,8 +207,8 @@ process_error_list(avl_tree_t *list, void *addr, size_t *count)
return (SET_ERROR(ENOMEM));
if (copyout(&se->se_bookmark, (char *)addr +
(*count - 1) * sizeof (zbookmark_t),
sizeof (zbookmark_t)) != 0)
(*count - 1) * sizeof (zbookmark_phys_t),
sizeof (zbookmark_phys_t)) != 0)
return (SET_ERROR(EFAULT));
*count -= 1;