summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-01-21 13:49:08 +0000
committerJeff Darcy <jdarcy@redhat.com>2014-01-21 13:49:08 +0000
commit6bcbf03b5aa4448832645a29ec2bc4b2fc5f2eaf (patch)
tree750f73a40aa62c20d66a2532fef6fd158cebb9c4 /libglusterfs
parent0225d7bc712609232d592d48116ec771cd97c2cf (diff)
parent17c4fb2d04f84b5632983866e8bddfbd7d77a054 (diff)
Merge branch 'upstream'
Conflicts: api/src/glfs-fops.c api/src/glfs-handleops.c Change-Id: I6811674cc4ec4be6fa6e4cdebb4bc428194bebd8
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/Makefile.am1
-rw-r--r--libglusterfs/src/glusterfs.h1
-rw-r--r--libglusterfs/src/syncop.c117
3 files changed, 80 insertions, 39 deletions
diff --git a/libglusterfs/src/Makefile.am b/libglusterfs/src/Makefile.am
index 907399ae6..634e217ed 100644
--- a/libglusterfs/src/Makefile.am
+++ b/libglusterfs/src/Makefile.am
@@ -7,6 +7,7 @@ libglusterfs_la_CPPFLAGS = $(GF_CPPFLAGS) -D__USE_FILE_OFFSET64 \
-I$(top_srcdir)/rpc/rpc-lib/src/ -I$(CONTRIBDIR)/rbtree
libglusterfs_la_LIBADD = @LEXLIB@
+libglusterfs_la_LDFLAGS = -version-info $(LIBGLUSTERFS_LT_VERSION)
lib_LTLIBRARIES = libglusterfs.la
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 8f3a2e6fa..517e4270a 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -87,6 +87,7 @@
#define GF_XATTR_GET_REAL_FILENAME_KEY "glusterfs.get_real_filename:"
#define GF_XATTR_USER_PATHINFO_KEY "glusterfs.pathinfo"
#define QUOTA_LIMIT_KEY "trusted.glusterfs.quota.limit-set"
+#define VIRTUAL_QUOTA_XATTR_CLEANUP_KEY "glusterfs.quota-xattr-cleanup"
#define GF_READDIR_SKIP_DIRS "readdir-filter-directories"
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index a4a5596c3..219fbc842 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -983,7 +983,8 @@ syncop_lookup (xlator_t *subvol, loc_t *loc, dict_t *xdata_req,
else if (args.xdata)
dict_unref (args.xdata);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1059,7 +1060,8 @@ syncop_readdirp (xlator_t *subvol,
list_splice_init (&args.entries.list, &entries->list);
/* TODO: need to free all the 'args.entries' in 'else' case */
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1118,7 +1120,8 @@ syncop_readdir (xlator_t *subvol,
list_splice_init (&args.entries.list, &entries->list);
/* TODO: need to free all the 'args.entries' in 'else' case */
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1153,7 +1156,8 @@ syncop_opendir (xlator_t *subvol,
SYNCOP (subvol, (&args), syncop_opendir_cbk, subvol->fops->opendir,
loc, fd, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1198,7 +1202,8 @@ syncop_fsyncdir (xlator_t *subvol, fd_t *fd, int datasync)
SYNCOP (subvol, (&args), syncop_fsyncdir_cbk, subvol->fops->fsyncdir,
fd, datasync, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1232,7 +1237,8 @@ syncop_removexattr_with_xdata (xlator_t *subvol, loc_t *loc, const char *name, d
SYNCOP (subvol, (&args), syncop_removexattr_cbk, subvol->fops->removexattr,
loc, name, dict);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1260,7 +1266,8 @@ syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name)
SYNCOP (subvol, (&args), syncop_fremovexattr_cbk,
subvol->fops->fremovexattr, fd, name, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1305,7 +1312,8 @@ syncop_setxattr_with_xdata (xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t
SYNCOP (subvol, (&args), syncop_setxattr_cbk, subvol->fops->setxattr,
loc, dict, flags, extra);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1334,7 +1342,8 @@ syncop_fsetxattr (xlator_t *subvol, fd_t *fd, dict_t *dict, int32_t flags)
SYNCOP (subvol, (&args), syncop_fsetxattr_cbk, subvol->fops->fsetxattr,
fd, dict, flags, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1381,7 +1390,8 @@ syncop_listxattr (xlator_t *subvol, loc_t *loc, dict_t **dict)
else if (args.xattr)
dict_unref (args.xattr);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1398,7 +1408,8 @@ syncop_getxattr (xlator_t *subvol, loc_t *loc, dict_t **dict, const char *key)
else if (args.xattr)
dict_unref (args.xattr);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1415,7 +1426,8 @@ syncop_fgetxattr_with_xdata (xlator_t *subvol, fd_t *fd, dict_t **dict, const ch
else if (args.xattr)
dict_unref (args.xattr);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1460,7 +1472,8 @@ syncop_statfs (xlator_t *subvol, loc_t *loc, struct statvfs *buf)
if (buf)
*buf = args.statvfs_buf;
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1501,7 +1514,8 @@ syncop_setattr_with_xdata (xlator_t *subvol, loc_t *loc, struct iatt *iatt, int
if (postop)
*postop = args.iatt2;
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1526,7 +1540,8 @@ syncop_fsetattr_with_xdata (xlator_t *subvol, fd_t *fd, struct iatt *iatt, int v
if (postop)
*postop = args.iatt2;
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1561,7 +1576,8 @@ syncop_open (xlator_t *subvol, loc_t *loc, int32_t flags, fd_t *fd)
SYNCOP (subvol, (&args), syncop_open_cbk, subvol->fops->open,
loc, flags, fd, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1636,7 +1652,8 @@ syncop_readv_with_xdata (xlator_t *subvol, fd_t *fd, size_t size, off_t off,
iobref_unref (args.iobref);
out:
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1677,7 +1694,8 @@ syncop_writev_with_xdata (xlator_t *subvol, fd_t *fd, const struct iovec *vector
fd, (struct iovec *) vector, count, offset, flags, iobref,
dict);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1701,7 +1719,8 @@ int syncop_write (xlator_t *subvol, fd_t *fd, const char *buf, int size,
SYNCOP (subvol, (&args), syncop_writev_cbk, subvol->fops->writev,
fd, &vec, 1, offset, flags, iobref, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1744,10 +1763,11 @@ syncop_create (xlator_t *subvol, loc_t *loc, int32_t flags, mode_t mode,
SYNCOP (subvol, (&args), syncop_create_cbk, subvol->fops->create,
loc, flags, mode, 0, fd, xdata);
- errno = args.op_errno;
if (iatt)
*iatt = args.iatt1;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1777,7 +1797,8 @@ syncop_unlink (xlator_t *subvol, loc_t *loc)
SYNCOP (subvol, (&args), syncop_unlink_cbk, subvol->fops->unlink, loc,
0, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1818,7 +1839,8 @@ syncop_rmdir (xlator_t *subvol, loc_t *loc, int flags)
SYNCOP (subvol, (&args), syncop_rmdir_cbk, subvol->fops->rmdir, loc,
flags, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1862,7 +1884,8 @@ syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc)
SYNCOP (subvol, (&args), syncop_link_cbk, subvol->fops->link,
oldloc, newloc, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1908,7 +1931,8 @@ syncop_rename (xlator_t *subvol, loc_t *oldloc, loc_t *newloc)
SYNCOP (subvol, (&args), syncop_rename_cbk, subvol->fops->rename,
oldloc, newloc, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1952,7 +1976,8 @@ syncop_ftruncate (xlator_t *subvol, fd_t *fd, off_t offset)
SYNCOP (subvol, (&args), syncop_ftruncate_cbk, subvol->fops->ftruncate,
fd, offset, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -1976,7 +2001,8 @@ syncop_truncate (xlator_t *subvol, loc_t *loc, off_t offset)
SYNCOP (subvol, (&args), syncop_ftruncate_cbk, subvol->fops->truncate,
loc, offset, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2006,7 +2032,8 @@ syncop_fsync (xlator_t *subvol, fd_t *fd, int dataonly)
SYNCOP (subvol, (&args), syncop_fsync_cbk, subvol->fops->fsync,
fd, dataonly, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2050,7 +2077,8 @@ syncop_flush (xlator_t *subvol, fd_t *fd)
SYNCOP (subvol, (&args), syncop_flush_cbk, subvol->fops->flush,
fd, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2098,7 +2126,8 @@ syncop_fstat (xlator_t *subvol, fd_t *fd, struct iatt *stbuf)
if (stbuf)
*stbuf = args.iatt1;
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2129,7 +2158,8 @@ syncop_stat (xlator_t *subvol, loc_t *loc, struct iatt *stbuf)
if (stbuf)
*stbuf = args.iatt1;
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2163,10 +2193,11 @@ syncop_symlink (xlator_t *subvol, loc_t *loc, const char *newpath, dict_t *dict,
SYNCOP (subvol, (&args), syncop_symlink_cbk, subvol->fops->symlink,
newpath, loc, 0, dict);
- errno = args.op_errno;
if (iatt)
*iatt = args.iatt1;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2203,7 +2234,8 @@ syncop_readlink (xlator_t *subvol, loc_t *loc, char **buffer, size_t size)
*buffer = args.buffer;
else GF_FREE (args.buffer);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2237,10 +2269,11 @@ syncop_mknod (xlator_t *subvol, loc_t *loc, mode_t mode, dev_t rdev,
SYNCOP (subvol, (&args), syncop_mknod_cbk, subvol->fops->mknod,
loc, mode, rdev, 0, dict);
- errno = args.op_errno;
if (iatt)
*iatt = args.iatt1;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2276,10 +2309,11 @@ syncop_mkdir (xlator_t *subvol, loc_t *loc, mode_t mode, dict_t *dict,
SYNCOP (subvol, (&args), syncop_mkdir_cbk, subvol->fops->mkdir,
loc, mode, 0, dict);
- errno = args.op_errno;
if (iatt)
*iatt = args.iatt1;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2307,7 +2341,8 @@ syncop_access (xlator_t *subvol, loc_t *loc, int32_t mask)
SYNCOP (subvol, (&args), syncop_access_cbk, subvol->fops->access,
loc, mask, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2338,7 +2373,8 @@ syncop_fallocate(xlator_t *subvol, fd_t *fd, int32_t keep_size, off_t offset,
SYNCOP (subvol, (&args), syncop_fallocate_cbk, subvol->fops->fallocate,
fd, keep_size, offset, len, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2368,7 +2404,8 @@ syncop_discard(xlator_t *subvol, fd_t *fd, off_t offset, size_t len)
SYNCOP (subvol, (&args), syncop_discard_cbk, subvol->fops->discard,
fd, offset, len, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2397,7 +2434,8 @@ syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, off_t len)
SYNCOP (subvol, (&args), syncop_zerofill_cbk, subvol->fops->zerofill,
fd, offset, len, NULL);
- errno = args.op_errno;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}
@@ -2429,8 +2467,9 @@ syncop_lk (xlator_t *subvol, fd_t *fd, int cmd, struct gf_flock *flock)
SYNCOP (subvol, (&args), syncop_lk_cbk, subvol->fops->lk,
fd, cmd, flock, NULL);
- errno = args.op_errno;
*flock = args.flock;
+ if (args.op_ret < 0)
+ return -args.op_errno;
return args.op_ret;
}