summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-03-16 04:03:55 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-03-17 17:15:07 +0530
commit3099d29e8e65554af31927c8f767b9b6103ca58e (patch)
tree0f9aef0dd519a591f3129871281ef248082f19d4
parent7d61f9d69309ccb0f9aa787caacfef77bc4e32d2 (diff)
Add system call abstraction layer
- syscall.c provides platform-independent system calls - previous code for this from compat.c removed - posix xlator uses new functions from syscall.c - solaris_flistxattr added to compat.c Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r--libglusterfs/src/Makefile.am4
-rw-r--r--libglusterfs/src/compat.c55
-rw-r--r--libglusterfs/src/compat.h21
-rw-r--r--libglusterfs/src/syscall.c432
-rw-r--r--libglusterfs/src/syscall.h148
-rw-r--r--xlators/storage/posix/src/posix.c48
6 files changed, 663 insertions, 45 deletions
diff --git a/libglusterfs/src/Makefile.am b/libglusterfs/src/Makefile.am
index 16e6717de9e..982c4d69de9 100644
--- a/libglusterfs/src/Makefile.am
+++ b/libglusterfs/src/Makefile.am
@@ -6,9 +6,9 @@ libglusterfs_la_LIBADD = @LEXLIB@
lib_LTLIBRARIES = libglusterfs.la
-libglusterfs_la_SOURCES = dict.c spec.lex.c y.tab.c xlator.c logging.c hashfn.c defaults.c scheduler.c common-utils.c transport.c timer.c inode.c call-stub.c compat.c authenticate.c fd.c compat-errno.c event.c mem-pool.c gf-dirent.c
+libglusterfs_la_SOURCES = dict.c spec.lex.c y.tab.c xlator.c logging.c hashfn.c defaults.c scheduler.c common-utils.c transport.c timer.c inode.c call-stub.c compat.c authenticate.c fd.c compat-errno.c event.c mem-pool.c gf-dirent.c syscall.c
-noinst_HEADERS = common-utils.h defaults.h dict.h glusterfs.h hashfn.h logging.h protocol.h scheduler.h xlator.h transport.h stack.h timer.h list.h inode.h call-stub.h compat.h authenticate.h fd.h revision.h compat-errno.h event.h mem-pool.h byte-order.h gf-dirent.h locking.h
+noinst_HEADERS = common-utils.h defaults.h dict.h glusterfs.h hashfn.h logging.h protocol.h scheduler.h xlator.h transport.h stack.h timer.h list.h inode.h call-stub.h compat.h authenticate.h fd.h revision.h compat-errno.h event.h mem-pool.h byte-order.h gf-dirent.h locking.h syscall.h
EXTRA_DIST = spec.l spec.y
diff --git a/libglusterfs/src/compat.c b/libglusterfs/src/compat.c
index f0bd9119c7c..bad62b563d5 100644
--- a/libglusterfs/src/compat.c
+++ b/libglusterfs/src/compat.c
@@ -264,6 +264,61 @@ solaris_listxattr(const char *path,
return len;
}
+
+int
+solaris_flistxattr(int fd,
+ char *list,
+ size_t size)
+{
+ int attrdirfd = -1;
+ ssize_t len = 0;
+ DIR *dirptr = NULL;
+ struct dirent *dent = NULL;
+ int newfd = -1;
+
+ attrdirfd = openat (fd, ".", O_RDONLY, 0);
+ if (attrdirfd >= 0) {
+ newfd = dup(attrdirfd);
+ dirptr = fdopendir(newfd);
+ if (dirptr) {
+ while ((dent = readdir(dirptr))) {
+ size_t listlen = strlen(dent->d_name);
+ if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..")) {
+ /* we don't want "." and ".." here */
+ continue;
+ }
+ if (size == 0) {
+ /* return the current size of the list of extended attribute names*/
+ len += listlen + 1;
+ } else {
+ /* check size and copy entrie + nul into list. */
+ if ((len + listlen + 1) > size) {
+ errno = ERANGE;
+ len = -1;
+ break;
+ } else {
+ strncpy(list + len, dent->d_name, listlen);
+ len += listlen;
+ list[len] = '\0';
+ ++len;
+ }
+ }
+ }
+
+ if (closedir(dirptr) == -1) {
+ close (attrdirfd);
+ return -1;
+ }
+ } else {
+ close (attrdirfd);
+ return -1;
+ }
+ close (attrdirfd);
+ }
+ return len;
+}
+
+
int
solaris_removexattr(const char *path,
const char* key)
diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h
index 67f8138b1df..42d2fa1419e 100644
--- a/libglusterfs/src/compat.h
+++ b/libglusterfs/src/compat.h
@@ -107,14 +107,6 @@ enum {
# endif
# endif
-#define lremovexattr(path,key) extattr_delete_link(path, EXTATTR_NAMESPACE_USER, key)
-#define llistxattr(path,key,size) extattr_list_link(path, EXTATTR_NAMESPACE_USER, key, size)
-#define lgetxattr(path, key, value, size) extattr_get_link(path, EXTATTR_NAMESPACE_USER, key, value, size)
-#define lsetxattr(path,key,value,size,flags) extattr_set_link(path, EXTATTR_NAMESPACE_USER, key, value, size)
-#define fgetxattr(fd,key,value,size) extattr_get_fd(fd, EXTATTR_NAMESPACE_USER, key, value, size)
-#define fsetxattr(fd,key,value,size,flag) extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, key, value, size)
-
-
#define F_GETLK64 F_GETLK
#define F_SETLK64 F_SETLK
#define F_SETLKW64 F_SETLKW
@@ -168,13 +160,6 @@ enum {
# endif
# endif
-#define llistxattr(path,key,size) listxattr(path,key,size,XATTR_NOFOLLOW)
-#define lgetxattr(path,key,value,size) getxattr(path,key,value,size,0,XATTR_NOFOLLOW)
-#define lsetxattr(path,key,value,size,flags) setxattr(path,key,value,size,0,flags|XATTR_NOFOLLOW)
-#define lremovexattr(path,key) removexattr(path,key,XATTR_NOFOLLOW)
-#define fgetxattr(path,key,value,size) fgetxattr(path,key,value,size,0,0)
-#define fsetxattr(path,key,value,size,flag) fsetxattr(path,key,value,size,0,flag)
-
#define F_GETLK64 F_GETLK
#define F_SETLK64 F_SETLK
#define F_SETLKW64 F_SETLKW
@@ -231,12 +216,6 @@ enum {
#define s6_addr32 _S6_un._S6_u32
#endif
-#define lremovexattr(path,key) solaris_removexattr(path,key)
-#define llistxattr(path,key,size) solaris_listxattr(path,key,size)
-#define lgetxattr(path,key,value,size) solaris_getxattr(path,key,value,size)
-#define lsetxattr(path,key,value,size,flags) solaris_setxattr(path,key,value,size,flags)
-#define fgetxattr(fd,key,value,size) solaris_fgetxattr(fd,key,value,size)
-#define fsetxattr(fd,key,value,size,flags) solaris_fsetxattr(fd,key,value,size,flags)
#define lutimes(filename,times) utimes(filename,times)
int asprintf(char **string_ptr, const char *format, ...);
diff --git a/libglusterfs/src/syscall.c b/libglusterfs/src/syscall.c
new file mode 100644
index 00000000000..f8e8c939a77
--- /dev/null
+++ b/libglusterfs/src/syscall.c
@@ -0,0 +1,432 @@
+/*
+ Copyright (c) 2009 Z RESEARCH, Inc. <http://www.zresearch.com>
+ This file is part of GlusterFS.
+
+ GlusterFS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License,
+ or (at your option) any later version.
+
+ GlusterFS is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _CONFIG_H
+#define _CONFIG_H
+#include "config.h"
+#endif
+
+#include "compat.h"
+#include "syscall.h"
+
+#include <sys/types.h>
+#include <utime.h>
+#include <sys/time.h>
+
+int
+sys_lstat (const char *path, struct stat *buf)
+{
+ return lstat (path, buf);
+}
+
+
+int
+sys_stat (const char *path, struct stat *buf)
+{
+ return stat (path, buf);
+}
+
+
+int
+sys_fstat (int fd, struct stat *buf)
+{
+ return fstat (fd, buf);
+}
+
+
+DIR *
+sys_opendir (const char *name)
+{
+ return opendir (name);
+}
+
+
+struct dirent *
+sys_readdir (DIR *dir)
+{
+ return readdir (dir);
+}
+
+
+ssize_t
+sys_readlink (const char *path, char *buf, size_t bufsiz)
+{
+ return readlink (path, buf, bufsiz);
+}
+
+
+int
+sys_closedir (DIR *dir)
+{
+ return closedir (dir);
+}
+
+
+int
+sys_mknod (const char *pathname, mode_t mode, dev_t dev)
+{
+ return mknod (pathname, mode, dev);
+}
+
+
+int
+sys_mkdir (const char *pathname, mode_t mode)
+{
+ return mkdir (pathname, mode);
+}
+
+
+int
+sys_unlink (const char *pathname)
+{
+ return unlink (pathname);
+}
+
+
+int
+sys_rmdir (const char *pathname)
+{
+ return rmdir (pathname);
+}
+
+
+int
+sys_symlink (const char *oldpath, const char *newpath)
+{
+ return symlink (oldpath, newpath);
+}
+
+
+int
+sys_rename (const char *oldpath, const char *newpath)
+{
+ return rename (oldpath, newpath);
+}
+
+
+int
+sys_link (const char *oldpath, const char *newpath)
+{
+ return link (oldpath, newpath);
+}
+
+
+int
+sys_chmod (const char *path, mode_t mode)
+{
+ return chmod (path, mode);
+}
+
+
+int
+sys_fchmod (int fd, mode_t mode)
+{
+ return fchmod (fd, mode);
+}
+
+
+int
+sys_chown (const char *path, uid_t owner, gid_t group)
+{
+ return chown (path, owner, group);
+}
+
+
+int
+sys_fchown (int fd, uid_t owner, gid_t group)
+{
+ return fchown (fd, owner, group);
+}
+
+
+int
+sys_lchown (const char *path, uid_t owner, gid_t group)
+{
+ return lchown (path, owner, group);
+}
+
+
+int
+sys_truncate (const char *path, off_t length)
+{
+ return truncate (path, length);
+}
+
+
+int
+sys_ftruncate (int fd, off_t length)
+{
+ return ftruncate (fd, length);
+}
+
+
+int
+sys_utimes (const char *filename, const struct timeval times[2])
+{
+ return utimes (filename, times);
+}
+
+
+int
+sys_creat (const char *pathname, mode_t mode)
+{
+ return creat (pathname, mode);
+}
+
+
+ssize_t
+sys_readv (int fd, const struct iovec *iov, int iovcnt)
+{
+ return readv (fd, iov, iovcnt);
+}
+
+
+ssize_t
+sys_writev (int fd, const struct iovec *iov, int iovcnt)
+{
+ return writev (fd, iov, iovcnt);
+}
+
+
+ssize_t
+sys_read (int fd, void *buf, size_t count)
+{
+ return read (fd, buf, count);
+}
+
+
+ssize_t
+sys_write (int fd, const void *buf, size_t count)
+{
+ return write (fd, buf, count);
+}
+
+
+off_t
+sys_lseek (int fd, off_t offset, int whence)
+{
+ return lseek (fd, offset, whence);
+}
+
+
+int
+sys_statvfs (const char *path, struct statvfs *buf)
+{
+ return statvfs (path, buf);
+}
+
+
+int
+sys_close (int fd)
+{
+ return close (fd);
+}
+
+
+int
+sys_fsync (int fd)
+{
+ return fsync (fd);
+}
+
+
+int
+sys_fdatasync (int fd)
+{
+#ifdef HAVE_FDATASYNC
+ return fdatasync (fd);
+#else
+ return 0;
+#endif
+}
+
+
+int
+sys_lsetxattr (const char *path, const char *name, const void *value,
+ size_t size, int flags)
+{
+
+#ifdef GF_LINUX_HOST_OS
+ return lsetxattr (path, name, value, size, flags);
+#endif
+
+#ifdef GF_BSD_HOST_OS
+ return extattr_set_link (path, EXTATTR_NAMESPACE_USER,
+ name, value, size);
+#endif
+
+#ifdef GF_SOLARIS_HOST_OS
+ return solaris_setxattr (path, name, value, size, flags);
+#endif
+
+#ifdef GF_DARWIN_HOST_OS
+ return setxattr (path, name, value, size, 0,
+ flags|XATTR_NOFOLLOW);
+#endif
+
+}
+
+
+ssize_t
+sys_llistxattr (const char *path, char *list, size_t size)
+{
+
+#ifdef GF_LINUX_HOST_OS
+ return llistxattr (path, list, size);
+#endif
+
+#ifdef GF_BSD_HOST_OS
+ return extattr_list_link (path, EXTATTR_NAMESPACE_USER, list, size);
+#endif
+
+#ifdef GF_SOLARIS_HOST_OS
+ return solaris_listxattr (path, list, size);
+#endif
+
+#ifdef GF_DARWIN_HOST_OS
+ return listxattr (path, list, size, XATTR_NOFOLLOW);
+#endif
+
+}
+
+
+ssize_t
+sys_lgetxattr (const char *path, const char *name, void *value, size_t size)
+{
+
+#ifdef GF_LINUX_HOST_OS
+ return lgetxattr (path, name, value, size);
+#endif
+
+#ifdef GF_BSD_HOST_OS
+ return extattr_get_link (path, EXTATTR_NAMESPACE_USER, name, value,
+ size);
+#endif
+
+#ifdef GF_SOLARIS_HOST_OS
+ return solaris_getxattr (path, name, value, size);
+#endif
+
+#ifdef GF_DARWIN_HOST_OS
+ return getxattr (path, name, value, size, 0, XATTR_NOFOLLOW);
+#endif
+
+}
+
+
+ssize_t
+sys_fgetxattr (int filedes, const char *name, void *value, size_t size)
+{
+
+#ifdef GF_LINUX_HOST_OS
+ return fgetxattr (filedes, name, value, size);
+#endif
+
+#ifdef GF_BSD_HOST_OS
+ return extattr_get_fd (filedes, EXTATTR_NAMESPACE_USER, name,
+ value, size);
+#endif
+
+#ifdef GF_SOLARIS_HOST_OS
+ return solaris_fgetxattr (filedes, name, value, size);
+#endif
+
+#ifdef GF_DARWIN_HOST_OS
+ return fgetxattr (filedes, name, value, size, 0, 0);
+#endif
+
+}
+
+
+int
+sys_fsetxattr (int filedes, const char *name, const void *value,
+ size_t size, int flags)
+{
+
+#ifdef GF_LINUX_HOST_OS
+ return fsetxattr (filedes, name, value, size, flags);
+#endif
+
+#ifdef GF_BSD_HOST_OS
+ return extattr_set_fd (filedes, EXTATTR_NAMESPACE_USER, name,
+ value, size);
+#endif
+
+#ifdef GF_SOLARIS_HOST_OS
+ solaris_fsetxattr (filedes, name, value, size, flags);
+#endif
+
+#ifdef GF_DARWIN_HOST_OS
+ return fsetxattr (filedes, name, value, size, 0, flags);
+#endif
+
+}
+
+
+ssize_t
+sys_flistxattr (int filedes, char *list, size_t size)
+{
+
+#ifdef GF_LINUX_HOST_OS
+ return flistxattr (filedes, list, size);
+#endif
+
+#ifdef GF_BSD_HOST_OS
+ return extattr_list_fd (filedes, EXTATTR_NAMESPACE_USER, list, size);
+#endif
+
+#ifdef GF_SOLARIS_HOST_OS
+ return solaris_flistxattr (filedes, list, size);
+#endif
+
+#ifdef GF_DARWIN_HOST_OS
+ return flistxattr (filedes, list, size, XATTR_NOFOLLOW);
+#endif
+
+}
+
+
+int
+sys_lremovexattr (const char *path, const char *name)
+{
+
+#ifdef GF_LINUX_HOST_OS
+ return lremovexattr (path, name);
+#endif
+
+#ifdef GF_BSD_HOST_OS
+ return extattr_delete_link (path, EXTATTR_NAMESPACE_USER, name);
+#endif
+
+#ifdef GF_SOLARIS_HOST_OS
+ return solaris_removexattr (path, name);
+#endif
+
+#ifdef GF_DARWIN_HOST_OS
+ return removexattr (path, name, XATTR_NOFOLLOW);
+#endif
+
+}
+
+
+int
+sys_access (const char *pathname, int mode)
+{
+ return access (pathname, mode);
+}
diff --git a/libglusterfs/src/syscall.h b/libglusterfs/src/syscall.h
new file mode 100644
index 00000000000..d9cbb8fd41a
--- /dev/null
+++ b/libglusterfs/src/syscall.h
@@ -0,0 +1,148 @@
+/*
+ Copyright (c) 2009 Z RESEARCH, Inc. <http://www.zresearch.com>
+ This file is part of GlusterFS.
+
+ GlusterFS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License,
+ or (at your option) any later version.
+
+ GlusterFS is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __SYSCALL_H__
+#define __SYSCALL_H__
+
+int
+sys_lstat (const char *path, struct stat *buf);
+
+int
+sys_stat (const char *path, struct stat *buf);
+
+int
+sys_fstat (int fd, struct stat *buf);
+
+DIR *
+sys_opendir (const char *name);
+
+struct dirent *
+sys_readdir (DIR *dir);
+
+ssize_t
+sys_readlink (const char *path, char *buf, size_t bufsiz);
+
+int
+sys_closedir (DIR *dir);
+
+int
+sys_mknod (const char *pathname, mode_t mode, dev_t dev);
+
+int
+sys_mkdir (const char *pathname, mode_t mode);
+
+int
+sys_unlink (const char *pathname);
+
+int
+sys_rmdir (const char *pathname);
+
+int
+sys_symlink (const char *oldpath, const char *newpath);
+
+int
+sys_rename (const char *oldpath, const char *newpath);
+
+int
+sys_link (const char *oldpath, const char *newpath);
+
+int
+sys_chmod (const char *path, mode_t mode);
+
+int
+sys_fchmod (int fd, mode_t mode);
+
+int
+sys_chown (const char *path, uid_t owner, gid_t group);
+
+int
+sys_fchown (int fd, uid_t owner, gid_t group);
+
+int
+sys_lchown (const char *path, uid_t owner, gid_t group);
+
+int
+sys_truncate (const char *path, off_t length);
+
+int
+sys_ftruncate (int fd, off_t length);
+
+int
+sys_utimes (const char *filename, const struct timeval times[2]);
+
+int
+sys_creat (const char *pathname, mode_t mode);
+
+ssize_t
+sys_readv (int fd, const struct iovec *iov, int iovcnt);
+
+ssize_t
+sys_writev (int fd, const struct iovec *iov, int iovcnt);
+
+ssize_t
+sys_read (int fd, void *buf, size_t count);
+
+ssize_t
+sys_write (int fd, const void *buf, size_t count);
+
+off_t
+sys_lseek (int fd, off_t offset, int whence);
+
+int
+sys_statvfs (const char *path, struct statvfs *buf);
+
+int
+sys_close (int fd);
+
+int
+sys_fsync (int fd);
+
+int
+sys_fdatasync (int fd);
+
+int
+sys_lsetxattr (const char *path, const char *name, const void *value,
+ size_t size, int flags);
+
+ssize_t
+sys_llistxattr (const char *path, char *list, size_t size);
+
+ssize_t
+sys_lgetxattr (const char *path, const char *name, void *value, size_t size);
+
+ssize_t
+sys_fgetxattr (int filedes, const char *name, void *value, size_t size);
+
+int
+sys_fsetxattr (int filedes, const char *name, const void *value,
+ size_t size, int flags);
+
+ssize_t
+sys_flistxattr (int filedes, char *list, size_t size);
+
+int
+sys_lremovexattr (const char *path, const char *name);
+
+int
+sys_access (const char *pathname, int mode);
+
+int
+sys_ftruncate (int fd, off_t length);
+
+#endif /* __SYSCALL_H__ */
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 657be1edc12..2848dbdc5f3 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -44,6 +44,7 @@
#include "compat-errno.h"
#include "compat.h"
#include "byte-order.h"
+#include "syscall.h"
#undef HAVE_SET_FSID
#ifdef HAVE_SET_FSID
@@ -163,12 +164,13 @@ _posix_xattr_get_set (dict_t *xattr_req,
ret = dict_set_uint32 (filler->xattr, key, 0);
}
} else {
- xattr_size = lgetxattr (filler->real_path, key, NULL, 0);
+ xattr_size = sys_lgetxattr (filler->real_path, key, NULL, 0);
if (xattr_size > 0) {
value = calloc (1, xattr_size + 1);
- lgetxattr (filler->real_path, key, value, xattr_size);
+ sys_lgetxattr (filler->real_path, key, value,
+ xattr_size);
value[xattr_size] = '\0';
ret = dict_set_bin (filler->xattr, key,
@@ -2044,8 +2046,9 @@ handle_pair (xlator_t *this, char *real_path,
if (ZR_FILE_CONTENT_REQUEST(trav->key)) {
ret = set_file_contents (this, real_path, trav, flags);
} else {
- sys_ret = lsetxattr (real_path, trav->key, trav->value->data,
- trav->value->len, flags);
+ sys_ret = sys_lsetxattr (real_path, trav->key,
+ trav->value->data,
+ trav->value->len, flags);
if (sys_ret < 0) {
if (errno == ENOTSUP) {
@@ -2243,7 +2246,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
goto out;
}
- size = llistxattr (real_path, NULL, 0);
+ size = sys_llistxattr (real_path, NULL, 0);
if (size == -1) {
op_errno = errno;
if ((errno == ENOTSUP) || (errno == ENOSYS)) {
@@ -2270,7 +2273,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
goto out;
}
- size = llistxattr (real_path, list, size);
+ size = sys_llistxattr (real_path, list, size);
remaining_size = size;
list_offset = 0;
@@ -2279,7 +2282,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
break;
strcpy (key, list + list_offset);
- op_ret = lgetxattr (real_path, key, NULL, 0);
+ op_ret = sys_lgetxattr (real_path, key, NULL, 0);
if (op_ret == -1)
break;
@@ -2290,7 +2293,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
goto out;
}
- op_ret = lgetxattr (real_path, key, value, op_ret);
+ op_ret = sys_lgetxattr (real_path, key, value, op_ret);
if (op_ret == -1)
break;
@@ -2364,7 +2367,7 @@ posix_fgetxattr (call_frame_t *frame, xlator_t *this,
goto out;
}
- size = flistxattr (_fd, NULL, 0);
+ size = sys_flistxattr (_fd, NULL, 0);
if (size == -1) {
op_errno = errno;
if ((errno == ENOTSUP) || (errno == ENOSYS)) {
@@ -2391,7 +2394,7 @@ posix_fgetxattr (call_frame_t *frame, xlator_t *this,
goto out;
}
- size = flistxattr (_fd, list, size);
+ size = sys_flistxattr (_fd, list, size);
remaining_size = size;
list_offset = 0;
@@ -2400,7 +2403,7 @@ posix_fgetxattr (call_frame_t *frame, xlator_t *this,
break;
strcpy (key, list + list_offset);
- op_ret = fgetxattr (_fd, key, NULL, 0);
+ op_ret = sys_fgetxattr (_fd, key, NULL, 0);
if (op_ret == -1)
break;
@@ -2411,7 +2414,7 @@ posix_fgetxattr (call_frame_t *frame, xlator_t *this,
goto out;
}
- op_ret = fgetxattr (_fd, key, value, op_ret);
+ op_ret = sys_fgetxattr (_fd, key, value, op_ret);
if (op_ret == -1)
break;
@@ -2448,8 +2451,8 @@ fhandle_pair (xlator_t *this, int fd,
int sys_ret = -1;
int ret = 0;
- sys_ret = fsetxattr (fd, trav->key, trav->value->data,
- trav->value->len, flags);
+ sys_ret = sys_fsetxattr (fd, trav->key, trav->value->data,
+ trav->value->len, flags);
if (sys_ret < 0) {
if (errno == ENOTSUP) {
@@ -2554,7 +2557,7 @@ posix_removexattr (call_frame_t *frame, xlator_t *this,
SET_FS_ID (frame->root->uid, frame->root->gid);
- op_ret = lremovexattr (real_path, name);
+ op_ret = sys_lremovexattr (real_path, name);
if (op_ret == -1) {
op_errno = errno;
@@ -2674,8 +2677,8 @@ posix_xattrop (call_frame_t *frame, xlator_t *this,
count = trav->value->len / sizeof (int32_t);
array = CALLOC (count, sizeof (int32_t));
- size = lgetxattr (real_path, trav->key, (char *)array,
- trav->value->len);
+ size = sys_lgetxattr (real_path, trav->key, (char *)array,
+ trav->value->len);
op_errno = errno;
if ((size == -1) && (op_errno != ENODATA) &&
@@ -2709,8 +2712,8 @@ posix_xattrop (call_frame_t *frame, xlator_t *this,
goto out;
}
- size = lsetxattr (real_path, trav->key, array,
- trav->value->len, 0);
+ size = sys_lsetxattr (real_path, trav->key, array,
+ trav->value->len, 0);
op_errno = errno;
if (size == -1) {
@@ -2786,7 +2789,8 @@ posix_fxattrop (call_frame_t *frame, xlator_t *this,
count = trav->value->len / sizeof (int32_t);
array = CALLOC (count, sizeof (int32_t));
- size = fgetxattr (_fd, trav->key, (char *)array, trav->value->len);
+ size = sys_fgetxattr (_fd, trav->key, (char *)array,
+ trav->value->len);
op_errno = errno;
if ((size == -1) && ((op_errno != ENODATA) &&
@@ -2818,8 +2822,8 @@ posix_fxattrop (call_frame_t *frame, xlator_t *this,
goto out;
}
- size = fsetxattr (_fd, trav->key, (char *)array,
- trav->value->len, 0);
+ size = sys_fsetxattr (_fd, trav->key, (char *)array,
+ trav->value->len, 0);
op_errno = errno;
if (size == -1) {