summaryrefslogtreecommitdiffstats
path: root/libglusterfs
Commit message (Collapse)AuthorAgeFilesLines
* features/locks: implement fgetxattr and fsetxattrRaghavendra G2012-11-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | implement xattrs for GF_XATTR_LOCKINFO_KEY, which will be used for posix-locks migration from old to new graph after a switch. fgetxattr (fd, GF_XATTR_LOCKINFO_KEY) will return a dict. This dict has a serialized dict stored for key GF_XATTR_LOCKINFO_KEY. This serialized dict in turn has fdnum value of locks acquired on this fd with modified pathinfo (containing hostname and base directory components) as key. fsetxattr (newfd, GF_XATTR_LOCKINFO_KEY, dict) has following semantics. dict can be the result of a previous fgetxattr with GF_XATTR_LOCKINFO_KEY. In that case, a dict_get on dict constructed using serialized buffer is done on modified pathinfo as key. If a value is got, that value is treated as fdnum and for every lock l on newfd->inode we do, if (l->fdnum == fdnum) { l->fdnum = fd_fdnum (newfd); l->transport = <connection identifier of connection on which fsetxattr came>; } Signed-off-by: Raghavendra G <raghavendra@gluster.com> Change-Id: I73a8f43aa0b6077bc19f8de52205ba748f2d8bbe BUG: 808400 Reviewed-on: http://review.gluster.org/4120 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* cluster/stripe: handle GF_XATTR_LOCKINFO_KEY in f(get)(set)xattrRaghavendra2012-11-271-0/+2
| | | | | | | | | Change-Id: I4463006a7f54c05e757d877c56e1330fd91aec45 BUG: 808400 Signed-off-by: Raghavendra <raghavendra@gluster.com> Reviewed-on: http://review.gluster.org/4125 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* libglusterfs/mem-pool: implement gf_memdupRaghavendra2012-11-271-0/+15
| | | | | | | | | Change-Id: I1d7a1e7418f424fe08c041d562098b947c01580f BUG: 808400 Signed-off-by: Raghavendra <raghavendra@gluster.com> Reviewed-on: http://review.gluster.org/4124 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* libglusterfs: Implement float percentagePranith Kumar K2012-11-234-25/+27
| | | | | | | | | Change-Id: Ia7ea63471f0bbd74686873f5f6f183475880f1a0 BUG: 839595 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.org/4162 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Use more portable mkstemp() instead fo mkostemp()Emmanuel Dreyfus2012-11-221-1/+1
| | | | | | | | | | | | | | mkostemp() with O_CREAT|O_EXCL|O_RDWR|O_TRUNC|O_APPEND is mkstemp() and mkstemp() is available on more systems than mkostemp() NULL-commit to cause jankins ro rebuild BUG: 764655 Change-Id: I6ee0f635d3699bd70b0963b24af07bd7d5c2dc58 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/4152 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* libglusterfs: implement gf_strndupRaghavendra G2012-11-211-0/+19
| | | | | | | | | Change-Id: Ifb7bf22e8cf4ad1faccf7999c36919693912093f BUG: 808400 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.org/4135 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* NFS is picking up geo-rep's already open (read-only) file descriptorKaleb S. KEITHLEY2012-11-142-28/+31
| | | | | | | | | | | | | Add anonymous member to fd_t and use it instead of over-loading pid for geo-rep and self heal Change-Id: I4d6b29a044a8ed4b8f69ff6e3f35ee227739b2af Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> BUG: 874272 Reviewed-on: http://review.gluster.org/4185 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* xlator/fuse: integrate fuse with event-historyRaghavendra Bhat2012-11-121-1/+1
| | | | | | | | | | | | | | | | | use event-history framework for saving and dumping (on necessity) important xlator specific information. Tests: Included the regression testcase. Change-Id: I6c0532e9ffe0b624286cdc4d2637b1bd2c0579e0 BUG: 858215 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Signed-off-by: root <root@thinkpad.(none)> Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/3925 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* core: add STACK_WIND_TAIL for more efficient default_xxx.Jeff Darcy2012-10-252-92/+120
| | | | | | | | | Change-Id: Ic38e2183d1320bb17c014aca33779471c8db5d5f BUG: 867132 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4092 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* In some cases AI_ADDRCONFIG confuses NetBSD 6.0Emmanuel Dreyfus2012-10-201-0/+2
| | | | | | | | | BUG: 764655 Change-Id: I29198c94c6788f9e01f57e11798f3d3d7cd9c8de Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/4105 Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Anand Avati <avati@redhat.com>
* glusterfs: add gf_mkostemp api and use it instead of mkostemp of libcRaghavendra Bhat2012-10-172-0/+4
| | | | | | | | | Change-Id: Icc12b99e2233d22037e2c4bb2b6966e45668b7dd BUG: 764890 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/4091 Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Anand Avati <avati@redhat.com>
* syncop: save and restore THIS from the time of context switchAnand Avati2012-10-161-0/+4
| | | | | | | | | | | | | | | | | | The current yield() code assumes that the point of yielding is always in the translator where the synctask was created. This can be a problem for nested syncops and/or where syncop is issued by a different translator. So, save the THIS pointer just before swapcontext() and restore it right after resuming. Change-Id: I86aad2329ccbc3ac1f04fbec3835136ff3fa79fb BUG: 862838 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4085 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* glusterfs: code cleanupRaghavendra Bhat2012-10-151-13/+11
| | | | | | | | | Change-Id: I99bbb720d8b42c8b3899bb1353c6b73f7fcd50f1 BUG: 764890 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/4042 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* features/quota: Accept float numbers for quota limit.Varun Shastry2012-10-121-3/+3
| | | | | | | | | | | | Quota limit can be given a floating value like 2.5GB or 0.5TB, which was not possible before. Change-Id: I2c89fd521e8b70be51252677c7986abcfa9d11a2 BUG: 819394 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/4068 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: Moved peer rsp handling functions to glusterd-utilsKrishnan Parthasarathi2012-10-111-14/+20
| | | | | | | | | | | - Moved inner functions used in conjunction with synctask, 'out'. Change-Id: I7fbfd9881ea58645c4295a9fa7163ddd15a45d2f BUG: 862834 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/4066 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* syncop: fix symlink paramAnand Avati2012-10-032-2/+3
| | | | | | | | | | | | make syncop_symlink() accept 'const char *linkname' instead of 'char *linkname' Change-Id: I7751d552e4a4cc6e8b8e587b9e520213f4e11b45 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4020 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* syncop: Implement some missing operationsAnand Avati2012-10-032-2/+105
| | | | | | | | | | | | | - syncop_mkdir() - syncop_rmdir() - syncop_rename() Change-Id: I177db0f9af7c99fc6645d59521c8fb82f73812ca BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4019 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* core: make sure there are processors for just-queued tasksJeff Darcy2012-10-031-0/+5
| | | | | | | | | Change-Id: I6196ad02fab6c24ac473cda0f78f9e946f0329ce BUG: 862838 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4031 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-1/+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>
* dict: add new API 'dict_add()'Amar Tumballi2012-10-022-14/+42
| | | | | | | | | | | | * this new API is used only when we are sure that there is no replacing keys, ie. in dict_unserialize(). Change-Id: I383dffc65056ebdaf0ab19727f7dc14ec7017fc1 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 850917 Reviewed-on: http://review.gluster.org/3844 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>
* common-utils: valid_host_name() should allow (sub)domains starting/ending ↵Niels de Vos2012-10-021-23/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with a digit Some (sub)domains start or end with a digit. If this is the case, it will not be possible to 'gluster peer probe' hosts in that (sub)domain. This is overly restrictive, and RFC 1912 contains a note that describes the common use of start/end digits in (sub)domains: > > Allowable characters in a label for a host name are only ASCII > letters, digits, and the `-' character. Labels may not be all > numbers, but may have a leading digit (e.g., 3com.com). Labels must > end and begin only with a letter or digit. See [RFC 1035] and [RFC > 1123]. (Labels were initially restricted in [RFC 1035] to start with > a letter, and some older hosts still reportedly have problems with > the relaxation in [RFC 1123].) Note there are some Internet > hostnames which violate this rule (411.org, 1776.com). > This change will also allow (sub)domains to consist out of digits only, like the example of 411.org above. It is still not allowed to start or and a (sub)domain with a `-' (dash) character. Change-Id: I7236edfe80fd08f28247536bef5287f63b564a63 BUG: 862297 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/4017 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* build: consolidate common compilation flags into one variableJeff Darcy2012-10-011-3/+3
| | | | | | | | | | | | | | | 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>
* Fix problems of mismatch type.linbaiye2012-10-012-5/+6
| | | | | | | | | | | | Checking if an uint32_t is less than zero is unnecessary, so we change the parameter and return value to int. Change-Id: I5c08eaf8fd4c33768a366b22f0f5db9575056a1e BUG: 789278 Signed-off-by: linbaiye <linbaiye@gmail.com> Reviewed-on: http://review.gluster.org/3965 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* dict: no need to memdup() the XDR buffer for dict_unserializeAmar Tumballi2012-10-011-7/+1
| | | | | | | | | | | | | * current memdup() of full buffer is not required as 'dict_unserialize()' does its own memdup() of the value. Change-Id: Iba866b68b753d060ee35bb300ee687e7d293ac82 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 850917 Reviewed-on: http://review.gluster.org/3845 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* Fix parallel build issuesKacper Kowalik (Xarthisius)2012-09-261-0/+1
| | | | | | | | | | | | | Prevent creating symbolic links in not yet created sbindir. Since lex creates two files, make them depend on each other to prevent race condition. Change-Id: I72b633b24de33407006d70571b0a40adaa99dc2b BUG: 859843 Signed-off-by: Kacper Kowalik (Xarthisius) <xarthisius.kk@gmail.com> Reviewed-on: http://review.gluster.org/3968 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* core: enable process to return the appropriate error codeAnand Avati2012-09-212-0/+4
| | | | | | | | | | | | Setup a pipe() in glusterfs_ctx_t to communicate with the fork'ed child the exit status and return it to the shell. Change-Id: Ibbaa581d45acb24d5141e43ae848cae29312d95f BUG: 762935 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3836 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* libglusterfs/graph: pass correct translator pairs during reconfigureRaghavendra G2012-09-212-8/+18
| | | | | | | | | | | | | | | | | when we autoload xlators like acl, worm or mac-compatibility, they will be loaded on top of old graph. However, corresponding ones won't be present in new graph, since newgraph doesn't contain autoloaded translators. While passing xlator pairs to reconfigure, this fact should be accounted and correct xlator pairs should be passed instead of blindly passing oldgraph->first and newgraph->first. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Change-Id: I8f4fe37b7e26dc2dcae78c1fe0d4a04f8ab84ed0 BUG: 857874 Reviewed-on: http://review.gluster.org/3949 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* runner: introduce a new variant runner_run_nowait()Anand Avati2012-09-202-0/+25
| | | | | | | | | | | | | which makes the child blindly _exit(0) (thereby relieving the caller quickly) and the grandchild continues to actually do execvp(). Change-Id: I4dac0f39aaaa5b2ae5dbeb96e221b8257f8d3a22 BUG: 762935 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3962 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Csaba Henk <csaba@redhat.com>
* syncop: Implement access fopPranith Kumar K2012-09-192-0/+28
| | | | | | | | | Change-Id: I959144451790d7e47ae48564923d324451a9db23 BUG: 858602 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.org/3958 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* CLI: Displaying time as N/A when unix time is 0Varun Shastry2012-09-171-2/+2
| | | | | | | | | | | | | | | | | | | Problem: 'volume top open' command was displaying '1970-01-01 00:00:00.000000' when no file has opened yet. Fix: Made the fix in gf_time_fmt() to make it more generic according to patchset 1 review comment. Change-Id: I748ed203bd0d9fbaac94b5b51ed708b34fccd434 BUG: 852000 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/3924 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* protocol/server: dump the ltable and fd table related inodes onlyRaghavendra Bhat2012-09-172-10/+11
| | | | | | | | | | | | | Do not dump the entire inode table in the statedump. Instead dump those inodes only which are present in fdtable or ltable. Change-Id: If848f9a6198927b4cc0abd47339461f3ea41d6df BUG: 844688 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/3848 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* All: License message changeVarun Shastry2012-09-132-13/+12
| | | | | | | | | | | | License message changed for server-side, dual license GPLV2 and LGPLv3+. Change-Id: Ia9e53061b9d2df3b3ef3bc9778dceff77db46a09 BUG: 852318 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/3940 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* fuse-bridge: Pass unknown option down to fuseLubomir Rintel2012-09-121-0/+2
| | | | | | | | | | | | | | | | | | In Linux, certain "filesystem-specific" options (passed in string form in last argument to mount(2)), such as "rootcontext" or "context" are in fact common to all filesystems, including fuse. We should pass them down to the actual mount(2) call untouched. This is achieved by adding "fuse-mountopts" option to mount/fuse translator and adjusting the mount helper to propagate it with unrecognized options as they are encountered. BUG: 852754 Change-Id: I309203090c02025334561be235864d8d04e4159b Signed-off-by: Lubomir Rintel <lubo.rintel@gooddata.com> Reviewed-on: http://review.gluster.org/3871 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* event: peel out poll and epoll specific code into separate filesAnand Avati2012-09-124-836/+920
| | | | | | | | | | | code re-org, no change in logic. Change-Id: Ib1cb3d3f4cf8989a916df7476479c26570d07a84 BUG: 821087 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3932 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* mount/fuse: add mount-option "enable-ino32" for the native clientNiels de Vos2012-09-061-0/+1
| | | | | | | | | | | | | | By default the GlusterFS-native client uses 64-bit inodes. Some 32-bit applications can not handle these correctly. Introduce a client-side mount option "enable-ino32" which causes the FUSE-client to squash the 64-bit inodes into a 32-bit value. Change-Id: I3296d16528bfb50457b9675f6b8701234ed82ff0 BUG: 850352 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/3885 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* libglusterfs: Implementation of syncop_fsyncdirPranith Kumar K2012-09-062-0/+29
| | | | | | | | | | Change-Id: I832b9c0bfbe804fbca98dc9e8fbe7d3174fecc82 BUG: 854326 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.org/3902 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* storage/posix: Add or_array/and_array op for xattropPranith Kumar K2012-09-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: For set/reset of outcast (ALL changelog bits set per transaction type i.e. data/mdata/entry) from afr the capability of OR/AND in xattrop is needed in posix. Otherwise marking outcast will only be possible in self-heals where appropriate locks are held so that no other transaction is in progress, so exact number can be computed with which when XATTROP_ADD happens all bits will be set for that changelog. Fix: Implemented new xattrop-op OR_ARRAY, AND_ARRAY. Made checks in __add_array to work well with __or_array. Tests: From Afr code made an OR_ARRAY with ALL bits set and it reflected on the changelog xattrs. changelog incrementing did not have any effects on the all-set changelog. From Afr code made an AND_ARRAY with 0 and it reflected in the changelog xattrs. Change-Id: Ie89c78a43d05789e3a8fa03d2422b52083ae80b9 BUG: 847671 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.org/3909 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* core/statedump: parse the file and set the path of the statedump filesRaghavendra Bhat2012-09-062-15/+119
| | | | | | | | | | | | | | | | | | | | * As of now "gluster volume set statedump-path" option sets the path of the statedump files for brick processes only. If SIGUSR1 is sent directly to all the gluster processes instead of using gluster cli command, then some of the statedumps will still be in /tmp (such as nfs server, glustershd). * This patch makes glusterfs processes search for the file /tmp/glusterdump.options and consider the options given in it. There if path key is set, then all the processes use that path when SIGUSR1 is sent or cli statedump command is executed. (Note that after taking statedump, if /tmp/glusterdump.options file is removed, then the default way is resumed). Change-Id: I2e8fbfb4823318512e03b234e90d3a3888724ddc BUG: 851175 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/3907 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* libglusterfs/dict: make 'dict_t' a opaque objectAmar Tumballi2012-09-066-47/+111
| | | | | | | | | | | | | | | * ie, don't dereference dict_t pointer, instead use APIs everywhere * other than dict_t only 'data_t' should be the valid export from dict.h * added 'dict_foreach_fnmatch()' API * changed dict_lookup() to use data_t, instead of data_pair_t Change-Id: I400bb0dd55519a7c5d2a107e67c8e7a7207228dc Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 850917 Reviewed-on: http://review.gluster.org/3829 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* Add missing contrib/libgen files to distributionEmmanuel Dreyfus2012-08-302-8/+2
| | | | | | | | | | BUG: 764655 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Change-Id: I3f49eb4a1a186cb2d178539ada6a05c8c1aa8265 Reviewed-on: http://review.gluster.org/3882 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* All: License message changeVarun Shastry2012-08-282-32/+13
| | | | | | | | | | | | | | | | | | The license message is changed to Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com> This file is part of GlusterFS. This file is licensed to you under your choice of the GNU Lesser General Public License, version 3 or any later version (LGPLv3 or later), or the GNU General Public License, version 2 (GPLv2), in all cases as published by the Free Software Foundation. Change-Id: I07d2b63ed5fbbbd1884f1e74f2dd56013d15b0f4 BUG: 852318 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/3858 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Add support for --enable-debug configure optionDeepak C Shetty2012-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently default build adds -g -O2 to CFLAGS unconditionally and there is no way to control them from configure. This patch adds support for --enable-debug option to the configure cmdline. If yes, then only -g is added. If no, then -g -O2 is added. Build defaults to --enable-debug=no. Also fixes couple of Makefile.am's which had -g hardcoded. v2: Adds -O0 for debug=yes case. v3: Added bugID while submitting patch Change-Id: I7505619be6fc683de463a0bd44ba5500b0bedfe1 BUG: 851092 Signed-off-by: Deepak C Shetty <deepakcs@linux.vnet.ibm.com> Reviewed-on: http://review.gluster.org/3822 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: Deepak Shetty <dpkshetty@gmail.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* epoll: whitespace cleanup and remove unused variableAnand Avati2012-08-221-19/+18
| | | | | | | | Change-Id: Idd7269f8b3a6dfaf931b378128eff93088b3be73 BUG: 821087 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3841 Tested-by: Gluster Build System <jenkins@build.gluster.com>
* fuse: make background queue length configurableAmar Tumballi2012-08-221-1/+2
| | | | | | | | | | | | | | | | * also make 'congestion_threshold' an option * make 'congestion_threshold' as 75% of background queue length if not explicitely specified * in glusterfsd.c, moved all the fuse option dictionary setting code to separate function Change-Id: Ie1680eefaed9377720770a09222282321bd4132e Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 845214 Reviewed-on: http://review.gluster.org/3830 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* syncop: Added scaling down logicPranith Kumar K2012-08-202-5/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | RCA: Whenever the self-heald tests are done with more than 16 replicates The number of sync procs goes to > 2. These threads never die. Fix: Added scaling down logic in syncops so that the threads terminate themselves whenever the extra thread is idle for ~10 minutes. Minimum number of threads is still 2. Tests: Added logs for launching and terminating procs, made timeout to 6 seconds and ran volume-heal in a while loop. After logs say max number of procs are launched, attached process to gdb and verified that the number of syncop threads are 16. Stopped volume-heal and observed the logs for terminating the procs. Attached gdb to process again to check that the syncop threads are just 2. Did this 5 times. Things worked fine. Which procs were terminated was random. No proc structure was erroneously re-used. Procs never exceeded 16 and were never < 2. Change-Id: I61dd9c25cc478ac8cbda190bee841a995b93c55c BUG: 814074 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.org/3195 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* NetBSD build fixEmmanuel Dreyfus2012-08-201-1/+1
| | | | | | | | | BUG: 764655 Change-Id: I65009625dfa627e0ca3b7ff2784b778d26ec04b1 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/3837 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* syncop: handle 'dataonly' flag in syncop_fsync()Amar Tumballi2012-08-202-4/+9
| | | | | | | | | | | | * 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>
* cluster/dht: Optimize readdirp calls in DHTshishir gowda2012-08-132-0/+3
| | | | | | | | | | | | | | | | | Bring in option which is supported by posix xlator to filter out directory's entries from being returned. DHT would now request non-first subvols to filter out directory entries. dht xlator-option readdir-optimize will enable this optimization Change-Id: I35224bc81c9657f54f952efac02790276c35ded5 BUG: 838199 Signed-off-by: shishir gowda <sgowda@redhat.com> Reviewed-on: http://review.gluster.com/3772 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* NetBSD swapcontext() portability fixEmmanuel Dreyfus2012-08-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Further analysis of the problem reveals some wrong conclusions I made before. NetBSD's swapcontext() preempts no thread. It alters the pthread private pointer, leading to multiple threads with the same pthread pointer. That led me to the wrong conclusion that thread were preempted. I guess this can be called a bug: NetBSD swapcontext() is incompatible with libpthread. Fortunately, there is a workaround, swapcontext() can be told to let the pthread private pointer untouched. This change just does that, fixing the crashes without sacrifying performances. There is just one problem: not all NetBSD ports have the capability to do that: at least ports using sh3, sparc, sparc64 and powerpc are left broken by this change. This problem will be addressed by upcoming fixes in NetBSD. BUG: 764655 Change-Id: I4191cb984176fce7064730ab55bd62c9156846cd Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.com/3794 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>