summaryrefslogtreecommitdiffstats
path: root/xlators/performance/stat-prefetch/src/stat-prefetch.c
Commit message (Collapse)AuthorAgeFilesLines
* performance/stat-prefetch: add "caller" arguement to sp_process_inode_ctx.Raghavendra G2009-12-061-23/+39
| | | | | | | | | | | - since sp_process_inode_ctx is called by many fops, if the context is not set "caller" argument can be logged in log msgs to identify caller. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 257 (Backport stat-prefetch to 2.0) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=257
* performance/stat-prefetch: refactor sp_lookup_cbk to use sp_update_inode_ctx.Raghavendra G2009-12-061-25/+9
| | | | | | | | Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 257 (Backport stat-prefetch to 2.0) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=257
* performance/stat-prefetch: dont check for inode context in fops like create, ↵Raghavendra G2009-12-061-317/+293
| | | | | | | | | | | | | mkdir. - context will not be set as a fresh inode is passed in each of these calls. instead create a new context. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 257 (Backport stat-prefetch to 2.0) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=257
* performance/stat-prefetch: get inode context from local->loc.inode instead ↵Raghavendra G2009-12-021-3/+9
| | | | | | | | | | | | of inode passed as arguement in sp_lookup_cbk. - @inode in sp_lookup_cbk may be NULL in case of failure of lookup. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 426 (stat on mount point hangs.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=426
* Add support in rbthash to make use of user provided mempool.Vijay Bellur2009-12-021-14/+64
| | | | | | | | Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221
* performance/stat-prefetch: make lookup to wait for the completion of another ↵Raghavendra G2009-12-021-12/+104
| | | | | | | | | | | | | | | | lookup on same path if one is in progress. - If current lookup (2) does not wait for completion of the lookup (1) which is in progress, there can be a race condition where (2) completes ahead of (1) and resuming all the waiting operations in the queue. When (1) returns, the original operation (eg., stat, chmod etc) might've already unwound and hence the frame would've been destroyed. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 257 (Backport stat-prefetch to 2.0) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=257
* performance/stat-prefetch: fix errors in handling memory allocation failures ↵Raghavendra G2009-12-021-3/+3
| | | | | | | | | | | | | | in sp_inode_ctx_process. - the variables that are used for making decisions are assigned before memory allocations and these variables were not reset to correct values in case of memory allocation failures. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 257 (Backport stat-prefetch to 2.0) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=257
* performance/stat-prefetch: fix access to inode table.Raghavendra G2009-12-021-13/+23
| | | | | | | | | | | - Access the inode table from one of fd->inode->table, inode->table or parent->table instead of from root xlators itable. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 369 (Samba does not work with booster.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=369
* stat-prefetch: fix unsafe reference to @local in sp_lookup_cbk.Raghavendra G2009-12-011-2/+7
| | | | | | | | Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 242 (If any of the writes fail, write-behind should not wait till the fd is closed for reporting errors) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=242
* performance/stat-prefetch: Add refcounting to cache objectsRaghavendra G2009-11-261-22/+109
| | | | | | | | Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 405 (Segmentation fault in stat-prefetch.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=405
* performance/stat-prefetch: remove lock member in sp_fd_ctx_t.Raghavendra G2009-11-261-27/+13
| | | | | | | | | | | - since the lifetime of fd context can be no longer than the fd, we can use lock in fd. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 405 (Segmentation fault in stat-prefetch.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=405
* performance/stat-prefetch: don't free the cache in readdir if the offset is ↵Raghavendra G2009-11-261-5/+2
| | | | | | | | | | | | | | | | | | | | | | not the expected one. - cache creation is expensive operation. Also, cache will be freed in releasedir. Hence, just remove all entries from cache without freeing the cache. However this is not entirely true, since sp_cache_remove_entry frees the old table and reinitializes a new table if all entries are being removed. When rbtree based hash table provides an interface to remove all the entries, sp_cache_remove_entry should be modified not to destroy the table. - this patch also fixes a race condition wherein the cache being used in lookup getting freed in readdir if the offset is not equal to expected offset. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 405 (Segmentation fault in stat-prefetch.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=405
* performance/stat-prefetch: don't cache dentries corresponding to directory.Raghavendra G2009-11-191-0/+4
| | | | | | | | | | | | | - distribute picks up the inode number from hashed subvolume. But readdir is done from different subvolumes based on the offset. Hence there is a possibility of inode number and device number for directories being inconsistent between two stat calls. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 371 (rm -rf fails on stat-prefetch.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=371
* performance/stat-prefetch: don't use pre-allocated dirent structure in ↵Raghavendra G2009-11-191-9/+22
| | | | | | | | | | | | | | sp_get_cache_entry. - since we don't know the size of dentry before calling sp_get_cache_entry, we must dynamically allocate the dentry in sp_cache_get_entry and copy the contents from cache. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 371 (rm -rf fails on stat-prefetch.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=371
* performance/stat-prefetch: allocate and init local only if cache-miss ↵Raghavendra G2009-11-131-4/+5
| | | | | | | | | | happens in lookup. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: In sp_readdir_cbk op_ret is not handled correctly.vinayak hegde2009-11-051-0/+4
| | | | | | | | Signed-off-by: Vinayak Hegde <vinayak@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 360 (All fop fails when stat-prefetch is loaded on afr.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=360
* performance/stat-prefetch: In lookup_cbk do not set error no to EINVAL, when ↵vinayak hegde2009-11-051-3/+0
| | | | | | | | | | inode_ctx_get returns -1. Signed-off-by: Vinayak Hegde <vinayak@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 360 (All fop fails when stat-prefetch is loaded on afr.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=360
* performance/stat-prefetch: checking for cache and creation if not present is ↵Raghavendra G2009-10-071-23/+64
| | | | | | | | | made atomic. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: lookup the path in xattrop if it is not already ↵Raghavendra G2009-10-071-10/+71
| | | | | | | | | looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: implement sp_entrylk.Raghavendra G2009-10-071-0/+85
| | | | | | | | | - sp_entrylk has to send lookup on the path if it is not already looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: implement sp_inodelk.Raghavendra G2009-10-071-1/+83
| | | | | | | | | - sp_inodelk has to send lookup on the path if it is not already looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: do lookup on path in removexattr if it is not ↵Raghavendra G2009-10-071-10/+71
| | | | | | | | | already looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: implement sp_getxattr.Raghavendra G2009-10-071-0/+89
| | | | | | | | | - sp_getxattr needs to send a lookup on the path if it is not already looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: lookup path in setxattr if it is not already ↵Raghavendra G2009-10-071-10/+73
| | | | | | | | | looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: lookup path in opendir if it is not already ↵Raghavendra G2009-10-071-11/+73
| | | | | | | | | looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: lookup path in create if it is not already looked up.Raghavendra G2009-10-071-24/+88
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: remove stat corresponding to oldloc->path from ↵Raghavendra G2009-10-071-0/+10
| | | | | | | | | | | cache in sp_link. - ctime of oldloc->path will be changed on completion of link fop. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: lookup oldloc->path in link if it has not already ↵Raghavendra G2009-10-071-13/+82
| | | | | | | | | been looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: lookup oldpath and newpath in rename if they've ↵Raghavendra G2009-10-071-19/+184
| | | | | | | | | not already been looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: do lookup of path in symlink if it is not already ↵Raghavendra G2009-10-071-13/+74
| | | | | | | | | looked-up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: do lookup in rmdir if the path has not already ↵Raghavendra G2009-10-071-14/+71
| | | | | | | | | been looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: lookup the path in mkdir if it is not already ↵Raghavendra G2009-10-071-13/+75
| | | | | | | | | looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: do lookup in unlink if the path has not already ↵Raghavendra G2009-10-071-12/+71
| | | | | | | | | been looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: do lookup in readlink if the path is not already ↵Raghavendra G2009-10-071-10/+71
| | | | | | | | | looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: do lookup in mknod if the path is not already ↵Raghavendra G2009-10-071-13/+75
| | | | | | | | | looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: implement sp_access.Raghavendra G2009-10-071-0/+79
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: do lookup in utimens if the path is not already ↵Raghavendra G2009-10-071-10/+71
| | | | | | | | | looked up Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: do lookup in truncate if the path is not already ↵Raghavendra G2009-10-071-10/+72
| | | | | | | | | looked-up Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: lookup the path in chown if it is not already ↵Raghavendra G2009-10-071-10/+71
| | | | | | | | | looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: lookup the path in chmod if it is not already ↵Raghavendra G2009-10-071-10/+70
| | | | | | | | | looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: lookup the path in stat if the it is not already ↵Raghavendra G2009-10-071-0/+79
| | | | | | | | | looked-up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: do lookup on the path in checksum if it is not ↵Raghavendra G2009-10-071-10/+69
| | | | | | | | | already looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: lookup the path in open if it is not already ↵Raghavendra G2009-10-071-11/+75
| | | | | | | | | looked up. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: implement procedure sp_process_inode_ctx.Raghavendra G2009-10-071-0/+93
| | | | | | | | | | | | | - this procedure processes inode_ctx to make decisions like whether the current procedure can continue (i.e., inode is already looked up), or the procedure has to initiate/wait for lookup on the path. It also sets up the frame->local and adds the stub corresponding to current fop if needed. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: use op_errno instead of errno to store error code.Raghavendra G2009-10-071-147/+253
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: Add support code to implement lookup-behind.Raghavendra G2009-10-071-22/+188
| | | | | | | | | | | | | - change sp_lookup and sp_lookup_cbk to support sending lookups when needed. lookups might need to be sent in fops like open, chmod, chown etc which operate on a path, since the actual lookup sent to stat-prefetch by its parent xlators is not propagated down the xlator tree if the path is cached. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: remove lookup-behind in sp_lookup.Raghavendra G2009-10-071-56/+4
| | | | | | | | | | | | - lookup-behind should be done on-demand basis, in fops like open instead of in sp_lookup itself. This would reduce network traffic between client and server related to lookup, if the only use of lookup was to fetch stat structure. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* Changed occurrences of Z Research to Gluster.Vijay Bellur2009-10-071-1/+1
| | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
* performance/stat-prefetch: Add accounting of cache hits and misses.Raghavendra G2009-10-071-0/+15
| | | | | | | Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
* performance/stat-prefetch: optimizations to sp_lookup.Raghavendra G2009-10-071-1/+12
| | | | | | | | | | | - if stat cache cannot be found for a path in its parent inode and the path is a directory, we can get the cache from the inode corresponding to path and look for "." in that cache. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284