summaryrefslogtreecommitdiffstats
path: root/api
Commit message (Collapse)AuthorAgeFilesLines
* gfapi: dict_unref() xattr_req in fop finish instead of dict_destroy()Anand Avati2013-03-072-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | The current way of calling dict_destroy() at the end of an API fop assumes that xattr_req is not stored/ref'd by any translators in the stack. However when translators like DHT store xattr_req in dht_local_t with a dict_ref() and perform dict_unref() in the unwind path, things get subject to a race. The race is between the woken up thread (by syncop_wake) i.e, the gfapi invoking thread and the thread where the FOP was unwound. As the C stack of STACK_UNWIND unwinds back, dht_local_unref() gets invoked within the DHT_STACK_UNWIND macro. This thread attempts dict_unref, which would be "safe" if it wins the race against the gfapi invoking thread. However if the gfapi invoking thread wins the race, it will perform dict_destroy() first and therefore make dict_unref() within dht_local_unref perform a double free. This is the embarrassing on-screen bug which showed up in a roomful of people during the gluster dev summit demo of qemu/libgfapi integration. Change-Id: I284c93de87cdc128d5801f42c84aa87f753090d4 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4644 Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Better mechanism to handle memory accountingVijay Bellur2013-02-171-0/+2
| | | | | | | | | | | | | | Memory accounting will now be enabled if: 1) Any glusterfs process is spawned with argument --mem-accounting. 2) DEBUG is defined. Change-Id: I3345e114127a57ce61916be0e2c4e0049a4c3432 BUG: 834465 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/4523 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* Use proper libtool option -avoid-version instead of bogus -avoidversionAnand Avati2013-02-071-1/+1
| | | | | | | | | | Change-Id: I1c9541058c7d07786539a3266ca125a6a15287d8 BUG: 859835 Signed-off-by: Anand Avati <avati@redhat.com> Original-author: Kacper Kowalik (Xarthisius) <xarthisius.kk@gmail.com> Signed-off-by: Kacper Kowalik (Xarthisius) <xarthisius.kk@gmail.com> Reviewed-on: http://review.gluster.org/3967 Tested-by: Gluster Build System <jenkins@build.gluster.com>
* glusterd,glusterfsd,libgfapi: Client op-versionKaushal M2013-02-061-1/+40
| | | | | | | | | | | | | | | This patch introduces op-version support for glusterfs clients. Now, a client sends its supported op-versions during the volfile fetch request and glusterd will return the volfile only if the client can support the current op-version of the cluster. Change-Id: Iab1f1f1706802962bcf27058657c44e8a344d2f6 BUG: 907311 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/4247 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gfapi: Mark fs->init status done in glfs_init_done for the case of ↵Mohammed Junaid2013-02-031-4/+15
| | | | | | | | | | | | | | | | glfs_init_async. This seen when we call glfs_init_async. The glfs_init_done function, calls the call-back function without assigning 1 to fs->init. The problem occurs when we call glfs_read or a similar api next time which checks if fs->init is 1 and will enter into an infinite wait if it is zero. Change-Id: I34a3d1652c80e737f5b05082a3fbb6e5978b14cd BUG: 839950 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/4445 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* core: fixes for gcc's '-pedantic' flag buildAvra Sengupta2013-01-211-6/+3
| | | | | | | | | | | | | * warnings on 'void *' arguments * warnings on empty initializations * warnings on empty array (array[0]) Change-Id: Iae440f54cbd59580eb69f3ecaed5a9926c0edf95 BUG: 875913 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/4219 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* core: remove all the 'inner' functions in codebaseAmar Tumballi2012-12-191-22/+2
| | | | | | | | | | | | | | | | * move 'dict_keys_join()' from api/glfs_fops.c to libglusterfs/dict.c - also added an argument which is treated as a filter function if required, currently useful for fuse. * now 'make CFLAGS="-std=gnu99 -pedantic" 2>&1 | grep nested' gives no output. Change-Id: I4e18496fbd93ae1d3942026ef4931889cba015e8 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 875913 Reviewed-on: http://review.gluster.org/4187 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* api: update Python wrapperJeff Darcy2012-12-191-24/+395
| | | | | | | | | | | | | | This brings us back to functional parity with the C example, and also makes things more "Pythonic" (e.g. methods on Volume/File objects instead of bare functions). Change-Id: I46edfee46d91881e275de2f63e15d9f0a6448e80 BUG: 839950 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4286 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Peter Portante <pportant@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* libgfapi: "tcp" is documented as the valid transport type instead of "socket".Avra Sengupta2012-11-283-5/+5
| | | | | | | | | Change-Id: I066e9be7755a535f385c102cdd1822adeda7f319 BUG: 860203 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/4226 Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* api/examples: updated examples to use new callsAnand Avati2012-11-051-0/+87
| | | | | | | | | | Change-Id: I865d0c52de268b27bbdb8786d3f4af5ef3ce3d9a BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4023 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gfapi: added more API callsAnand Avati2012-10-083-2/+1416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - stat - lstat - access - readlink - mknod - mkdir - rmdir - symlink - rename - link - opendir - closedir - seekdir - telldir - readdir_r - statvfs - chmod - fchmod - chown - lchown - fchown - utimens - lutimens - futimens - getxattr - lgetxattr - fgetxattr - setxattr - lsetxattr - fsetxattr - listxattr - llistxattr - flistxattr - removexattr - lremovexattr - fremovexattr Change-Id: Ic2467293ddfbcefaa9b41c82cec61a5602636833 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4022 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* glfs-resolve: fix resolution of "/"Anand Avati2012-10-031-2/+27
| | | | | | | | | Change-Id: I78d63b39dde14a9a32ea197cf0dedeb5695b35c9 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4021 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* build: split CPPFLAGS from CFLAGSJeff Darcy2012-10-031-3/+4
| | | | | | | | | | | | | | | | | Automake provides a separate variable for preprocessor flags (*_CPPFLAGS). They are already uses in a few places, so make it consistent and use it everywhere. Note that cflags obtained from pkg-config often are cppflags, which is why LIBXML2_CFLAGS moves with into AM_CPPFLAGS, for example. Change-Id: I15feed1d18b2ca497371271c4b5876d5ec6289dd BUG: 862082 Original-author: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4029 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* build: remove useless explicit -fPIC -shared fromJeff Darcy2012-10-031-3/+1
| | | | | | | | | | | | | | | | | | | | CFLAGS libtool will automatically add "-fPIC" to the compiler command line as needed, so there is no need to specify it separately. "-shared" is normally a linker flag and has an odd effect when used with libtool --mode=compile, namely that it inhibits production of static objects. For that however, using AC_DISABLE_STATIC is a lot simpler. Change-Id: Ic4cba0fad18ffd985cf07f8d6951a976ae59a48f BUG: 862082 Original-author: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4027 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* build: remove -nostartfiles flagJeff Darcy2012-10-021-1/+1
| | | | | | | | | | | | | | | The "-nostartfiles" is a discouraged option and is documented to potentially result in undesired behavior. Since I see no reason why it should be in glusterfs, remove it. Change-Id: I56f2b08874516ebad91447b2583ca2fb776bb7ab BUG: 862082 Original-author: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4018 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* build: add missing backslash in api/src/Jeff Darcy2012-10-021-1/+1
| | | | | | | | | | | | | Seems like an accidental omission of the backslash. Change-Id: If78efd9d985a08829ecd6307fd8209d05d0e1fbf BUG: 862082 Original-author: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4010 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* build: consolidate common compilation flags into one variableJeff Darcy2012-10-011-3/+2
| | | | | | | | | | | | | | | Some -D flags are present in all files, so collect them. This adds -D${GF_HOST_OS} to some compiler command lines, but this should not be a problem. Change-Id: I1aeb346143d4984c9cc4f2750c465ce09af1e6ca BUG: 862082 Original-author: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4013 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* build: add missing GF_CFLAGS in api/src/Jeff Darcy2012-10-011-1/+0
| | | | | | | | | | | | | | | | GF_CFLAGS seems missing in two spots. In one of those, adding it to libgfapi_la_CFLAGS would make it equal to AM_CFLAGS, so remove libgfapi_la_CFLAGS there. Change-Id: I50c22f16210ecd40371d4abb0e418c7a4f94c12f BUG: 862082 Original-author: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4009 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gfapi: fix the failure in glfs_open()Amar Tumballi2012-09-251-1/+1
| | | | | | | | | | | | | * the issue is happening because the resolve_symlink() logic was reversed Change-Id: I10eca14d82e3ebf5a0195d5db1330f9e1a3e2dc4 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 839950 Reviewed-on: http://review.gluster.org/3978 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gfapi: add symlink (auto resolution) support in resolverAnand Avati2012-09-173-4/+96
| | | | | | | | | | | | - new internal API glfs_lresolve() for usage with APIs like glfs_lXXXX() (e.g. glfs_lstat()) Change-Id: I61c60af6bda3072f189684ad8ac9815d59f455fc BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3866 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* syncop: handle 'dataonly' flag in syncop_fsync()Amar Tumballi2012-08-202-6/+2
| | | | | | | | | | | | * and also in syncop_readv(), don't look at _cbk args if op_ret is < 0. Change-Id: I3ab2982bc6d186e75b6adb74c8981e4ff7058bbe Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 839950 Reviewed-on: http://review.gluster.org/3828 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* core: reduce the usage of global variablesAmar Tumballi2012-08-031-6/+9
| | | | | | | | | | | | | | | | | | | | | | | * move all the 'logging' related global variables into ctx * make gf_fop_list a 'const' global array, hence no init(), no edits. * make sure ctx is allocated without any dependancy on memory-accounting infrastructure, so it can be the first one to get allocated * globals_init() should happen with ctx as argument not yet fixed below in this patchset: * anything with 'THIS' related globals * anything related to compat_errno related globals as its one time init'd and not changed later on. * statedump related globals Change-Id: Iab8fc30d4bfdbded6741d66ff1ed670fdc7b7ad2 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 764890 Reviewed-on: http://review.gluster.com/3767 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glfsxmp extensionAnand Avati2012-08-022-5/+32
| | | | | | | | | Change-Id: I3859621637025e464bc83d748bae7dff9808643f BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3735 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* gfapi: let glfs_init() return on non-RPC errorsAnand Avati2012-08-021-0/+4
| | | | | | | | | Change-Id: Ic3a15044434926127b8de273b1033b8ad452290c BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3732 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* gfapi: set errno in glfs_init()Anand Avati2012-08-022-0/+3
| | | | | | | | | | | save errno from glfs_init_done and set it in glfs_init_wait() Change-Id: I1a2f43a7e7b0f07f279c175df987ff94d642b629 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3771 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* gfapi: missed setting port optionAnand Avati2012-08-021-0/+1
| | | | | | | | | | Change-Id: I72790de10cefaae3d3307b6fbb9899907b019ccc BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3733 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Bharata B Rao <bharata.rao@gmail.com>
* Warnings: Fix set, unused variable warningsPranith Kumar K2012-07-291-3/+0
| | | | | | | | | Change-Id: If7ee85aa0d93f9018a76e7f60fcb7dcaf849dbdc BUG: 839950 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3742 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* gfapi: unglobalize oldvol{file,len}Anand Avati2012-07-273-12/+35
| | | | | | | | | | | Multiple initialization of volumes works fine now. Change-Id: Ibc16957b39325817bc6f9ab90ebac9cefdafabf8 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3734 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* Example of using libglfs from Python.Jeff Darcy2012-07-181-0/+29
| | | | | | | | | Change-Id: I081582c457428d55db8ec1ed6d90f1e439f51f0d BUG: 839950 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.com/3675 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glfsxmp: libgfapi based exampleAnand Avati2012-07-185-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an example application which uses libgfapi. It is a complete autotools based build system which demonstrates the required changes in configure.ac, Makefile.am etc to successfuly detect for and build an application against libgfapi. There are two approaches to building a libgfapi based application: 1. In the presence of pkg-config in your build system. This is the recommended approach which is also used in this example. For this approach to work, you need to build glusterfs by passing --pkgconfigdir=/usr/lib64/pkgconfig (or the appropriate directory) in your distro. This already happens if you build RPMs with the glusterfs.spec provided in glusterfs.git. You will also need to install glusterfs-api RPM. 2. In the absence of pkg-config in your build system. Make sure your LDFLAGS includes -L/path/to/lib where libgfapi.so is installed and -I/path/to/include/glusterfs where the 'api' directory Change-Id: Ic4eab2df002d7e8d20593a03e643859423048848 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3666 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* gfapi: API/library for accessing gluster volumesAnand Avati2012-07-1810-0/+2860
Change-Id: Ie4cbcf91b58218bebf23cf951c313aceeb29f311 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3664 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Bharata B Rao <bharata.rao@gmail.com>