278 Commits

Author SHA1 Message Date
Shehjar Tikoo
f887fd6f7c libglusterfsclient: Abstract away inode attr cache updates
This commit creates a separate function that allows users of
the inode attribute cache to update the cache when required.
Major users are lookup, stat and fstat functions.

The function libgf_update_iattr_cache(..) allows updating the lookup
and stat caches separately using flags.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-17 13:42:59 +05:30
Shehjar Tikoo
4c98eaf4c4 libglusterfsclient: Replace dict based inode ctx with array based one
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-17 13:42:55 +05:30
Shehjar Tikoo
c71110fb15 libglusterfsclient: Fix fd_ctx leak on release cbks
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-17 13:42:51 +05:30
Shehjar Tikoo
adb677be13 libglusterfsclient: Replace dict-based fd ctx with array-based one
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-17 13:42:47 +05:30
Shehjar Tikoo
00968db306 libglusterfsclient: Generalize [RW] checks on dirs
This patch moves the read-write permission check on directory
inode into libgf_client_opendir, so that when I am next adding support
for the opendir syscall, I dont have to perform similar checks again,
outside this function.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-17 13:42:43 +05:30
Shehjar Tikoo
1873d0bdb5 libglusterfsclient: Check for directory on O_CREAT
If we have received an O_CREAT for a name where that basename is a
directory, and if we have successfully looked up the inode for this directory,
then we can check for S_ISDIR in libglusterfsclient and prevent sending a message
to the server through libgf_client_creat. See also the comment inline.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-17 13:42:38 +05:30
Shehjar Tikoo
79215d4f24 libglusterfsclient: Create and use LIBGF_REPLY_NOTIFY macro
All reply notifications can now be abstracted away through
this macro and all cbk functions should now call this.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-17 13:42:35 +05:30
Shehjar Tikoo
ba4833355a libglusterfsclient: Fix segfault on non-NULL loc->name
The gf_log message actually assumes that loc->name will have a valid
non-NULL name in it, whereas if the loc_t being passed to it was
actually created on a function stack, i.e. a local function variable
and was then passed down the code path to do_path_resolve without ever
initing it or zeroing the structure, its possible that the name member
has a non-NULL but corrupted address. This leads to a segfault.
Whereas, we know loc->path will always have the full path.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-17 13:18:16 +05:30
Shehjar Tikoo
c1b3deff11 libglusterfsclient: Use macros for argument checks
Having those if {} blocks to check for argument
validity hurts the eye so this patch replaces those checks
with macros. One macro already exists in libglusterfs. The second
macro is introduced by this commit for libglusterfsclient-specific
check for paths.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-17 13:18:12 +05:30
Shehjar Tikoo
b3e3fc79d4 libglusterfsclient: Rename XLATOR_NAME define
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-17 13:17:53 +05:30
Basavanagowda Kanur
41011cdb4c protocol/client - NULL check for loc->inode added in statfs(), before trying to retrieve remote inode number from loc->inode's context.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-17 10:29:17 +05:30
Harshavardhana
4c4021bea2 RPM spec file updates for RHEL,CentOS,Fedora,SLES and OpenSUSE for upcoming 2.0.0 stable release
* Updates to ahere to RPM standards hugely driven by Fedora dist-f11.
* RPM spec file portable across RHEL, Fedora, CentOS, SLES, OpenSUSE.
* RPM spec build options made compact and removed unnecessary.
* %changelog old entries removed as they were giving many warnings
  during rpmlint.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-17 10:29:10 +05:30
Anand V. Avati
7ae141bb05 add NULL check in iobuf_arena_destroy 2009-04-16 17:32:05 +05:30
Raghavendra G
6bc3f3c19b logging enhances to commit d77279ef04ca75ab9715864274567d1ce0ce66a6
- logging made more relevent.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-16 17:11:10 +05:30
Vikas Gorur
8a00ad080c Use original pid when calling the FOP in afr transaction.
Save the original pid while locking and restore it
after the FOP is done. This ensures posix-locks can
release locks (fcntl) properly.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-16 17:10:28 +05:30
Raghavendra G
34f8f0b3e1 write-behind aggregate-size related changes
This patch brings in following changes:
   1. make aggregate-size as non-configurable and make it to be equal to
      maximum iobuf size.
   2. best effort to write data in chunks of length as close to aggregate-size
      as possible but not greater than aggregate-size, since aggregate-size is
      made equal to Maximum size of iobuf.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-16 17:10:01 +05:30
Raghavendra G
ffb863c3a8 write-behind: adhere to coding guidelines.
- make sure lines are not greater than 80 characters in length

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-16 17:09:50 +05:30
Basavanagowda Kanur
e77eb62f25 cluster/distribute bug fix - try to create linkfile in dht_lookup_everywhere_cbk(), only if hashed subvolume can be determined, else error out with ENOENT.
-- with local fixes (avati)

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-16 17:09:20 +05:30
Harshavardhana
d170334473 Fixed the build problems observed
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-16 14:54:21 +05:30
Basavanagowda Kanur
e6c22c0587 eliminate this_ino_get(), this_ino_set(). handle inode_ctx_{get,set}() at the fop level itself.
they used to log ambiguously
and was of no use. logging is now more precise and will help in debugging,
in case of errors.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-16 14:42:11 +05:30
Vikas Gorur
f7902b7072 Changed xattr format of afr changelog to support adding and removing of subvolumes while keeping existing data.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-16 14:41:41 +05:30
Raghavendra G
d77279ef04 server-helpers: Add check for NULL connection arguement being passed in helpers.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-14 15:31:35 +05:30
Anand V. Avati
3baa437e99 remove unused variable @ret in ib_verbs_options_init
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-14 15:30:15 +05:30
Anand V. Avati
54c40bbfb4 use MAP_FAILED macro to free mem_base in arena_destroy
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-14 15:00:38 +05:30
Anand V. Avati
1ce5acccf5 FREE arena->iobufs in iobuf_arena_destory
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-14 14:52:52 +05:30
Basavanagowda Kanur
8b32e03f87 cluster/unify link() should be sent to only one subvolume.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-14 14:52:38 +05:30
Amar Tumballi
7a4bc3fbb3 minor bug fix in posix_create() when 'o-direct enable' option is given.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-14 14:52:02 +05:30
Amar Tumballi
33e81bc949 bug fixes in dht-disk-usage feature.
fixes bugs seen with dht's disk usage.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-14 14:51:53 +05:30
Vikas Gorur
d8bc2834d0 Send statbuf from the same subvolume, even across revalidates.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 20:11:13 +05:30
Anand V. Avati
8e0d48cbb2 use ctx->page_size in all translators and transports instead of having their own configurations
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 20:10:49 +05:30
Anand V. Avati
451620e0ec introduce page_size in glusterfs_ctx_t to be used by all translators set it to 128KB in main()
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 20:10:49 +05:30
Anand V. Avati
3093ff0b12 client_readv_cbk - when op_ret is 0, iobuf comes NULL from transport, handles this case
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 15:45:42 +05:30
Anand V. Avati
a0bb8a02cd bug fix in iobuf_select_arena - call __iobuf_pool_add_arena (unlocked version)
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 14:55:32 +05:30
Anand V. Avati
3fb7252c5e bug fix - arena destruction now calls munmap and not FREE
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 14:55:29 +05:30
Anand V. Avati
dc9cdbdc1c add purge list support to make iobuf_pool_purge() in expensive, and actually call it in iobuf_put :-)
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 14:55:25 +05:30
Anand V. Avati
b9a210a419 bug fix in iobuf_select_arena - never created a new arena
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 14:55:22 +05:30
Anand V. Avati
688db6452b add @filled list in iobuf_pool to keep away filled list from getting searched in iobuf_select_arena
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 14:55:19 +05:30
Anand V. Avati
4f0d487c96 change arena size to 8MB
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 14:55:15 +05:30
Anand V. Avati
00dff3bddc use MAP_FAILED macro to check for mmap failure instead of (void *) -1
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 14:55:09 +05:30
Anand V. Avati
014cdf3856 fixed sizeof parameter in CALLOC of a new arena
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 14:54:58 +05:30
Basavanagowda Kanur
5dd850ae84 switch scheduler to validate the subvolume specified for a pattern, against the given subvolumes of cluster/unify.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 12:28:16 +05:30
Basavanagowda Kanur
ec06475f22 changes to database read interface, to make use of a given buffer instead of allocating internally.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 10:26:37 +05:30
Basavanagowda Kanur
945f438d39 log formatting fixes. use GF_PRI_SIZET for size_t.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-13 10:24:26 +05:30
Amar Tumballi
3f1e93c298 minor initialization bug fix in quota's build_loc
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-12 19:18:12 +05:30
Amar Tumballi
ecead44b5c in dht, initialize the free available space properly, so the first few creates are not confused.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-12 19:18:03 +05:30
Shehjar Tikoo
e00bdb4a32 Coding Style: Add a few points
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-12 12:41:42 +05:30
Amar Tumballi
4a62b5af1c feature to disable volumefile's checksum
in server volume define, "option verify-volfile-checksum no" to disable
the checksum feature.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-12 11:59:56 +05:30
Anand V. Avati
be99096064 reset errno to 0 before calling first fuse_lowlevel_new() to reliably detect for unsupported params
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-12 11:59:34 +05:30
Shehjar Tikoo
fa9eb588fb io-threads: Remove unnecessary call to pthread_attr_setstacksize
We do not need to explicitly set the stack size to its default
value.

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-12 11:59:24 +05:30
Anand V. Avati
4f81149489 prefix ULL to large constants (to fix bdb build warning)
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
2009-04-12 11:58:25 +05:30