static xattr_link_cache_entry_t *find_xattr_link_cache_entry(JCR *jcr, ino_t inum)
{
xattr_link_cache_entry_t *ptr;
- xattr_private_data_t *xpd = (xattr_private_data_t *)jcr->xattr_private_data;
- foreach_alist(ptr, xpd->xattr_link_cache) {
+ foreach_alist(ptr, jcr->xpd->xattr_link_cache) {
if (ptr && ptr->inum == inum) {
return ptr;
}
static void add_xattr_link_cache_entry(JCR *jcr, ino_t inum, char *target)
{
xattr_link_cache_entry_t *ptr;
- xattr_private_data_t *xpd = (xattr_private_data_t *)jcr->xattr_private_data;
ptr = (xattr_link_cache_entry_t *)malloc(sizeof(xattr_link_cache_entry_t));
memset((caddr_t)ptr, 0, sizeof(xattr_link_cache_entry_t));
ptr->inum = inum;
bstrncpy(ptr->target, target, sizeof(ptr->target));
- xpd->xattr_link_cache->append(ptr);
+ jcr->xpd->xattr_link_cache->append(ptr);
}
#if defined(HAVE_SYS_NVPAIR_H) && defined(_PC_SATTR_ENABLED)
char *acl_text = NULL;
char attribs[MAXSTRING];
char buffer[BUFSIZ];
- xattr_private_data_t *xpd = (xattr_private_data_t *)jcr->xattr_private_data;
bxattr_exit_code retval = bxattr_exit_error;
berrno be;
* Encode the stat struct into an ASCII representation and jump out of the function.
*/
encode_stat(attribs, &st, 0, stream);
- xpd->toplevel_hidden_dir_xattr_data_len = bsnprintf(xpd->toplevel_hidden_dir_xattr_data,
- sizeof(xpd->toplevel_hidden_dir_xattr_data),
- "%s%c%s%c%s%c",
- target_attrname, 0, attribs, 0,
- (acl_text) ? acl_text : "", 0);
+ jcr->xpd->toplevel_hidden_dir_xattr_data_len = bsnprintf(jcr->xpd->toplevel_hidden_dir_xattr_data,
+ sizeof(jcr->xpd->toplevel_hidden_dir_xattr_data),
+ "%s%c%s%c%s%c",
+ target_attrname, 0, attribs, 0,
+ (acl_text) ? acl_text : "", 0);
goto bail_out;
} else {
/*
}
/*
- * See if this is the first real xattr being saved. If it is save the toplevel_hidden_dir attributes first.
+ * See if this is the first real xattr being saved.
+ * If it is save the toplevel_hidden_dir attributes first.
*/
- if (xpd->nr_xattr_saved == 0) {
- pm_memcpy(jcr->xattr_data, xpd->toplevel_hidden_dir_xattr_data, xpd->toplevel_hidden_dir_xattr_data_len);
- jcr->xattr_data_len = xpd->toplevel_hidden_dir_xattr_data_len;
+ if (jcr->xpd->nr_xattr_saved == 0) {
+ pm_memcpy(jcr->xattr_data, jcr->xpd->toplevel_hidden_dir_xattr_data,
+ jcr->xpd->toplevel_hidden_dir_xattr_data_len);
+ jcr->xattr_data_len = jcr->xpd->toplevel_hidden_dir_xattr_data_len;
retval = send_xattr_stream(jcr, STREAM_XATTR_SOLARIS);
}
if (retval) {
retval = send_xattr_stream(jcr, stream);
- xpd->nr_xattr_saved++;
+ jcr->xpd->nr_xattr_saved++;
}
/*
static bxattr_exit_code solaris_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt)
{
char cwd[PATH_MAX];
- xattr_private_data_t *xpd;
bxattr_exit_code retval = bxattr_exit_ok;
/*
* If not just pretend things went ok.
*/
if (pathconf(jcr->last_fname, _PC_XATTR_EXISTS) > 0) {
- xpd = (xattr_private_data_t *)malloc(sizeof(xattr_private_data_t));
- memset((caddr_t)xpd, 0, sizeof(xattr_private_data_t));
- xpd->xattr_link_cache = New(alist(10, not_owned_by_alist));
- jcr->xattr_private_data = (void *)xpd;
+ jcr->xpd = (xattr_private_data_t *)malloc(sizeof(xattr_private_data_t));
+ memset((caddr_t)jcr->xpd, 0, sizeof(xattr_private_data_t));
+ jcr->xpd->xattr_link_cache = New(alist(10, not_owned_by_alist));
/*
* As we change the cwd in the save function save the current cwd
getcwd(cwd, sizeof(cwd));
retval = solaris_save_xattrs(jcr, NULL, NULL);
chdir(cwd);
- delete xpd->xattr_link_cache;
- xpd->xattr_link_cache = NULL;
- free(xpd);
- jcr->xattr_private_data = NULL;
+ delete jcr->xpd->xattr_link_cache;
+ jcr->xpd->xattr_link_cache = NULL;
+ free(jcr->xpd);
+ jcr->xpd = NULL;
}
return retval;
}