* Currently we support the following OSes:
* - AIX (Extended Attributes)
* - Darwin (Extended Attributes)
+ * - FreeBSD (Extended Attributes)
* - IRIX (Extended Attributes)
* - Linux (Extended Attributes)
* - NetBSD (Extended Attributes)
- * - FreeBSD (Extended Attributes)
* - OpenBSD (Extended Attributes)
* (As it seems either they never implemented xattr or they are removed
* the support as it stated it was in version 3.1 but the current syscall
* might eventually support xattr on OpenBSD when they implemented them using
* the same interface as FreeBSD and NetBSD.
* - Solaris (Extended Attributes and Extensible Attributes)
+ * - Tru64 (Extended Attributes)
*
* Written by Marco van Wieringen, November MMVIII
*
}
xattr_list[xattr_list_len] = '\0';
- xattr_value_list = New(alist(10, not_owned_by_alist));
-
/*
* Walk the list of extended attributes names and retrieve the data.
* We already count the bytes needed for serializing the stream later on.
}
}
+ if (xattr_value_list == NULL) {
+ xattr_value_list = New(alist(10, not_owned_by_alist));
+ }
+
xattr_value_list->append(current_xattr);
current_xattr = NULL;
xattr_count++;
goto bail_out;
}
- xattr_drop_internal_table(xattr_value_list);
-
/*
* Send the datastream to the SD.
*/
- return send_xattr_stream(jcr, os_default_xattr_streams[0]);
+ retval = send_xattr_stream(jcr, os_default_xattr_streams[0]);
} else {
- xattr_drop_internal_table(xattr_value_list);
-
- return bxattr_exit_ok;
+ retval = bxattr_exit_ok;
}
bail_out:
POOLMEM *xattrbuf = get_memory(ATTR_MAX_VALUELEN);
berrno be;
- xattr_value_list = New(alist(10, not_owned_by_alist));
-
for (cnt = 0; xattr_naming_spaces[cnt].name != NULL; cnt++) {
memset(cursor, 0, sizeof(attrlist_cursor_t));
while (1) {
goto bail_out;
}
+ if (xattr_value_list == NULL) {
+ xattr_value_list = New(alist(10, not_owned_by_alist));
+ }
+
xattr_value_list->append(current_xattr);
current_xattr = NULL;
xattr_count++;
goto bail_out;
}
- xattr_drop_internal_table(xattr_value_list);
-
/*
* Send the datastream to the SD.
*/
- return send_xattr_stream(jcr, os_default_xattr_streams[0]);
+ retval = send_xattr_stream(jcr, os_default_xattr_streams[0]);
} else {
- xattr_drop_internal_table(xattr_value_list);
-
- return bxattr_exit_ok;
+ retval = bxattr_exit_ok;
}
bail_out:
}
xattr_list[xattr_list_len] = '\0';
- xattr_value_list = New(alist(10, not_owned_by_alist));
-
/*
* Walk the list of extended attributes names and retrieve the data.
* We already count the bytes needed for serializing the stream later on.
}
}
+ if (xattr_value_list == NULL) {
+ xattr_value_list = New(alist(10, not_owned_by_alist));
+ }
+
xattr_value_list->append(current_xattr);
current_xattr = NULL;
xattr_count++;
goto bail_out;
}
- xattr_drop_internal_table(xattr_value_list);
-
/*
* Send the datastream to the SD.
*/
- return send_xattr_stream(jcr, os_default_xattr_streams[0]);
+ retval = send_xattr_stream(jcr, os_default_xattr_streams[0]);
} else {
- xattr_drop_internal_table(xattr_value_list);
-
- return bxattr_exit_ok;
+ retval = bxattr_exit_ok;
}
bail_out:
bxattr_exit_code retval = bxattr_exit_error;
berrno be;
- xattr_value_list = New(alist(10, not_owned_by_alist));
-
/*
* Loop over all available xattr namespaces.
*/
break;
}
+ if (xattr_value_list == NULL) {
+ xattr_value_list = New(alist(10, not_owned_by_alist));
+ }
+
xattr_value_list->append(current_xattr);
current_xattr = NULL;
xattr_count++;
goto bail_out;
}
- xattr_drop_internal_table(xattr_value_list);
-
/*
* Send the datastream to the SD.
*/
- return send_xattr_stream(jcr, os_default_xattr_streams[0]);
+ retval = send_xattr_stream(jcr, os_default_xattr_streams[0]);
} else {
- xattr_drop_internal_table(xattr_value_list);
-
- return bxattr_exit_ok;
+ retval = bxattr_exit_ok;
}
bail_out:
break;
}
- xattr_value_list = New(alist(10, not_owned_by_alist));
-
- /**
+ /*
* Walk the list of extended attributes names and retrieve the data.
* We already count the bytes needed for serializing the stream later on.
*/
goto bail_out;
}
+ if (xattr_value_list == NULL) {
+ xattr_value_list = New(alist(10, not_owned_by_alist));
+ }
+
xattr_value_list->append(current_xattr);
current_xattr = NULL;
xattr_count++;