Commit 2cd03395 authored by Giuseppe Lo Presti's avatar Giuseppe Lo Presti
Browse files

Use the generic ceph/posix wrapper for getting xattrs

parent d3487132
......@@ -15,13 +15,13 @@
#include <string.h>
#include <errno.h>
#include <time.h>
#include <sys/xattr.h>
#include "rfio.h"
#include "u64subr.h"
#include "log.h"
#include "serrno.h"
#include "getconfent.h"
#include "Castor_limits.h"
#include "ceph/ceph_posix.h"
#include "movers/moverclose.h"
struct internal_context {
......@@ -164,15 +164,13 @@ int rfio_handle_close(void *ctx,
/* This is a write */
/* File still exists - this is a candidate for migration regardless of its size (zero-length are ignored in the stager) */
/* first we try to read a file xattr for checksum */
if ((xattr_len = getxattr(internal_context->pfn, "user.castor.checksum.value", csumvalue, CA_MAXCKSUMLEN)) == -1) {
(*logfunc)(LOG_ERR, "rfio_handle_close: fgetxattr failed for user.castor.checksum.value, error=%d\n", errno);
(*logfunc)(LOG_ERR, "rfio_handle_close: skipping checksums for castor NS\n");
if ((xattr_len = ceph_posix_getxattr(internal_context->pfn, "user.castor.checksum.value", csumvalue, CA_MAXCKSUMLEN)) == -1) {
(*logfunc)(LOG_ERR, "rfio_handle_close: getxattr failed for user.castor.checksum.value, skipping checksum. Error=%d\n", errno);
} else {
csumvalue[xattr_len] = '\0';
(*logfunc)(LOG_DEBUG,"rfio_handle_close: csumvalue for the file on the disk=0x%s\n", csumvalue);
if ((xattr_len = getxattr(internal_context->pfn, "user.castor.checksum.type", csumtype, CA_MAXCKSUMNAMELEN)) == -1) {
(*logfunc)(LOG_ERR, "rfio_handle_close: fgetxattr failed for user.castor.checksum.type, error=%d\n", errno);
(*logfunc)(LOG_ERR, "rfio_handle_close: skipping checksums for castor NS\n");
if ((xattr_len = ceph_posix_getxattr(internal_context->pfn, "user.castor.checksum.type", csumtype, CA_MAXCKSUMNAMELEN)) == -1) {
(*logfunc)(LOG_ERR, "rfio_handle_close: getxattr failed for user.castor.checksum.type, skipping checksum. Error=%d\n", errno);
} else {
csumtype[xattr_len] = '\0';
(*logfunc)(LOG_DEBUG, "rfio_handle_close: csumtype is %s\n", csumtype);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment