summaryrefslogtreecommitdiffstats
path: root/libglusterfs
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* logging: do the 'right' check for loglevelAmar Tumballi2012-08-071-6/+6
| | | | | | | | | | | | logging functions should not print anything if loglevel in argument list is lower than what is set for the process. Change-Id: Id61779ffe6b76724243aa222c6889dd51a8f2f9b Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 846201 Reviewed-on: http://review.gluster.com/3786 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* core: moved back the pthread_key_t specific variables as globalAmar Tumballi2012-08-064-31/+31
| | | | | | | | | | | | | in a patch to move all the global variables inside 'ctx', moved all the pthread_key_t specific globals, which needed to be global, not inside some structures. Change-Id: I5e7107a8a64f5b80e90fd469fb084f62b2312705 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 764890 Reviewed-on: http://review.gluster.com/3783 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-0315-335/+267
| | | | | | | | | | | | | | | | | | | | | | | * 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>
* protocol/server: use pthread_mutex_trylock while dumping statedumpsRaghavendra Bhat2012-08-021-4/+8
| | | | | | | | | Change-Id: Iec6f539ee7d36c25aca3960abc6d2611707617c8 BUG: 843821 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3774 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* mem-pool: remove 'if' by asserting condition directly.Jules.Wang2012-08-011-22/+11
| | | | | | | | | | | | | | | | | | | before: if (!condition) { GF_ASSERT (0); } after: GF_ASSERT (condition); BUG: 764890 Change-Id: I9894fcc609579f5efd3f98dbff41ca1487ce6dd2 Signed-off-by: Jules Wang <lancelotds@163.com> Reviewed-on: http://review.gluster.com/3762 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* supportability: print all missing framesAmar Tumballi2012-08-012-8/+8
| | | | | | | | | | | | | | | | | | | earlier, the statedump and backtrace were printing frames only if it matched type GF_FOPs or GF_MGMTs (GF_MGMT is not in use now). This made all the frames from glusterd, or any other frames which got created outside the scope of 'fops' not getting printed. now, made two classifications, one as FOPs (which gets logged with the proper name), and another set is !FOPs (ie, else part), which gets logged with only the op number. Change-Id: Ifa18cdb75f7afefe6bb489d319b589cda8e64c1d Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 845114 Reviewed-on: http://review.gluster.com/3768 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* core: remove libglusterfs/src/scheduler.[ch]Amar Tumballi2012-08-013-116/+1
| | | | | | | | | | | | * as its not part of the build * confuses with some TAGS and 'git greps' Change-Id: I1f97307a8ce486ba56a4a3ad0151276b0a72e096 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 764890 Reviewed-on: http://review.gluster.com/3769 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* event-history: implement gf_log_eh for saving eventsRaghavendra Bhat2012-08-012-6/+47
| | | | | | | | | | | Change-Id: I2ddf4e7849bda91bb99423e27082c2bae6800a70 BUG: 795419 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3532 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* libglusterfs/statedump: add start and end markers in the statedump fileRaghavendra Bhat2012-07-301-2/+37
| | | | | | | | | | | | | Also do not overwrite the statedump file if statedump is taken on the same process again. Instead add the timestamp to the filename Change-Id: I451a0decf2dad5c398631cab1fc2a69811c69af8 BUG: 843408 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3738 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* acl: enable handling of FMODE_EXEC flagAmar Tumballi2012-07-271-1/+7
| | | | | | | | | | | | | | | | | | | | | | on linux systems, with open(), we can get below flag as per 'linux/fs.h'. /* File is opened for execution with sys_execve / sys_uselib */ Instead of adding '#include <linux/fs.h>, its better to copy this absolute number into other variable because then we have to deal with declaring fmode_t etc etc.. With the fix, we can handle the file with '0711' permissions in the same way as backend linux filesystems. Change-Id: Ib1097fc0d2502af89c92d561eb4123cba15713f5 Signed-off-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: http://review.gluster.com/3739 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* libglusterfs: fix creation of spurious root inodesRaghavendra Bhat2012-07-241-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose lookup is sent on a newly created inode (gfid is root gfid), and in the call back inode_link is done, where if there is an inode already present in the inode table for that gfid, then we start using the present inode and the newly created inode supposedly gets destroyed when refcount comes down to zero through inode_unref calls. But inodes with root gfid are not unrefed. Now since in inode_link, the gfid has already been copied to the new inode and later the actual inode is found from the inode table, the new inode does not gets unrefed if its gfid is root gfid. Thus those spurious inodes with root gfid will be present throughout the lifetime of the filesystem. To fix this first search the inode table for an inode, with the gfid, present in the stat structure received as an argument. If the inode is not found, then copy the gfid to the newly created inode. Now whenever unref is called on on the new inode it gets unrefed and thus eventually gets destroyed Change-Id: I0f25f0a8dca3245abda1c322c216f063b52cf842 BUG: 841188 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3716 Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: Refactored brickinfo APIsKrishnan Parthasarathi2012-07-191-3/+0
| | | | | | | | | | | | | | | | | This patch modifies the existing brickinfo function signatures and/or names to do one thing right and call them by 'appropriate' names. - Decoupled brickinfo_get and is_brickpath_available - Removed dead comment about realpath(3) in canonicalize_path - Renamed glusterd_brickinfo_from_brick to glusterd_brickinfo_new_from_brick to make the name of the function reflect that an allocation is happening Change-Id: I29daba6d431ca799d43c927b9dfbaeda327e83e8 BUG: 764890 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.com/3668 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* libglusterfs/options: enable validator macros for type 'double'Anand Avati2012-07-192-25/+48
| | | | | | | | | | | | | Values like 'entry-timeout' and 'attribute-timeout' in FUSE are of C type double. Enable support in the options framework for using this type. Change-Id: If1a619595a5925937e88540710860df27347acd0 BUG: 841417 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3697 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* fuse-bridge: expose negative entry caching of FUSEAnand Avati2012-07-191-0/+2
| | | | | | | | | | | | | | | | Fuse kernel module supports caching negative entries, enabled by specifying a timeout while returning ENOENT to lookup. This patch enables the functionality to be enabled with the command line. Also fixed a typo bug in mount.glusterfs.in. Change-Id: I47eab2834cca9a05887266358afbf504bbb4c489 BUG: 841417 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3696 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
* libglusterfs: remove debug log messages from gidcacheBrian Foster2012-07-181-4/+0
| | | | | | | | | | | | The debug log messages for every cache lookup/add pollute the debug output. BUG: 800892 Change-Id: I6b75fd5b7005b8c007106347de8827a0d6c2fd03 Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.com/3692 Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* glusterfs_ctx_t: un-globalize the filesystem contextAnand Avati2012-07-1713-84/+65
| | | | | | | | | | | | | | | | | | | | | | | | So far there has been a global glusterfs_ctx_t object which represents the running instance of the filesystem (client or server). It contains the various graphs, connection to the management daemon over which new graphs are obtained, calls stacks issued on this filesystem, and a bunch of such things. With the introduction of libgfapi, it is no more true that there will be only one filesystem context in a process. Applications can be written to use libgfapi and obtain serveral instances of different filesystems/volumes in the same process. This involves messy untangling of assumptions inside libglusterfs that there would only be one global glusterfs_ctx_t and offload that assumption to glusterfsd/ and cli/ (where it is true). Change-Id: Ifd7d1259428c26076140a5764a2dc7361694139c BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3678 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* common-utils: implement generate_glusterfs_ctx_id()Anand Avati2012-07-172-0/+35
| | | | | | | | | | | | | This patch creates a common and shared version of the often copy/ pasted generate_uuid() function, which is used to create an ID string to uniquely identify an instance of a glusterfs process/glusterfs_ctx_t. Change-Id: Ie4e697ae28b6e954c5c261c69e37738f289d77e4 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3677 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* libglusterfs,mount/fuse: implement gidcache mechanism in fuse-bridgeBrian Foster2012-07-174-2/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | This change genericizes the cache mechanism implemented in commit 8efd2845 into libglusterfs/src/gidcache.[ch] and adds fuse-bridge as a client. The cache mechanism is fundamentally equivalent, with some minor changes: - Change cache key from uid_t to uint64_t. - Modify the cache add logic to locate and use an entry with a matching ID, should it already exist. This addresses a bug in the existing mechanism where an expired entry supercedes a newly added entry in lookup, causing repeated adds and flushing of a cache bucket. The fuse group cache is disabled by default. It can be enabled via the 'gid-timeout' fuse-bridge translator option and accompanying mount option (i.e., '-o gid-timeout=1' for a 1s entry timeout). BUG: 800892 Change-Id: I0b34a2263ca48dbb154790a4a44fc70b733e9114 Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.com/3676 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* common-utils: implement iov_copyAnand Avati2012-07-161-1/+38
| | | | | | | | | | | Change-Id: I7ab97279dafc1211b417e1c03332572887453c66 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3663 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Shishir Gowda <sgowda@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* syncop: accomodate non-syncenv callsAnand Avati2012-07-132-9/+63
| | | | | | | | | | | | | | | | Use mutex/cond and support syncop_XXXXXX() calls in non-syncenv environments. syncenv environments continue to use swapcontext based soft context switches. In non-syncenv environments this blocks the caller thread on the mutex. The intended use case is in libgfapi where it is expected to block the caller thread while performing synchronous calls. Change-Id: Id6470c99bdc2fe4b7610372139f7fa99b2da400b BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3662 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* remove useless if-before-free (and free-like) functionsJim Meyering2012-07-1316-123/+59
| | | | | | | | | | | | See comments in http://bugzilla.redhat.com/839925 for the code to perform this change. Signed-off-by: Jim Meyering <meyering@redhat.com> BUG: 839925 Change-Id: I10e4ecff16c3749fe17c2831c516737e08a3205a Reviewed-on: http://review.gluster.com/3661 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* libglusterfs: syncop for flush ()Rajesh Amaravathi2012-07-132-0/+32
| | | | | | | | | | Change-Id: I17f925345782313c75102c4767121ba8e283028e BUG: 764813 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.com/3667 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>