* Use is subject to license terms.
*/
/*
- * Copyright (c) 2012, Intel Corporation.
+ * Copyright (c) 2012, 2013, Intel Corporation.
* Use is subject to license terms.
*/
/*
* Author: Mike Pershin <tappro@whamcloud.com>
*/
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
#define DEBUG_SUBSYSTEM S_OSD
#include <lustre_ver.h>
#include <libcfs/libcfs.h>
-#include <lustre_fsfilt.h>
#include <obd_support.h>
#include <lustre_net.h>
#include <obd.h>
return rc;
}
+ /* Ensure xattr doesn't exist in ZAP */
+ if (obj->oo_xattr != ZFS_NO_OBJECT) {
+ udmu_objset_t *uos = &osd_obj2dev(obj)->od_objset;
+ uint64_t xa_data_obj;
+ rc = -zap_lookup(uos->os, obj->oo_xattr,
+ name, 8, 1, &xa_data_obj);
+ if (rc == 0) {
+ rc = __osd_object_free(uos, xa_data_obj, oh->ot_tx);
+ if (rc == 0)
+ zap_remove(uos->os, obj->oo_xattr,
+ name, oh->ot_tx);
+ }
+ }
+
rc = -nvlist_add_byte_array(obj->oo_sa_xattr, name,
(uchar_t *)buf->lb_buf, buf->lb_len);
if (rc)