summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src
Commit message (Collapse)AuthorAgeFilesLines
...
* libglusterfsclient: Fix typecast to fix build warningShehjar Tikoo2009-04-171-2/+2
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Remove unused variablesShehjar Tikoo2009-04-171-10/+0
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add realpath APIShehjar Tikoo2009-04-171-0/+184
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add lstat APIShehjar Tikoo2009-04-171-5/+81
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add readlink APIShehjar Tikoo2009-04-171-0/+79
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add symlink APIShehjar Tikoo2009-04-171-0/+116
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add unlink APIShehjar Tikoo2009-04-171-0/+74
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add mkfifo APIShehjar Tikoo2009-04-171-0/+49
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add mknod APIShehjar Tikoo2009-04-172-0/+96
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add utime APIShehjar Tikoo2009-04-171-0/+47
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add utimes APIShehjar Tikoo2009-04-171-0/+85
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add rename APIShehjar Tikoo2009-04-171-0/+109
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add statvfs APIShehjar Tikoo2009-04-171-0/+39
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add statfs APIShehjar Tikoo2009-04-171-0/+99
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add link APIShehjar Tikoo2009-04-171-0/+103
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add ftruncate APIShehjar Tikoo2009-04-171-0/+77
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* linglusterfsclient: Add fsync APIShehjar Tikoo2009-04-171-0/+50
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add fchown APIShehjar Tikoo2009-04-171-0/+57
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add fchmod APIShehjar Tikoo2009-04-171-0/+56
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add closedir APIShehjar Tikoo2009-04-171-0/+22
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add opendir APIShehjar Tikoo2009-04-171-0/+58
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add chown APIShehjar Tikoo2009-04-171-0/+69
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add chmod APIShehjar Tikoo2009-04-171-0/+69
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Abstract away inode attr cache updatesShehjar Tikoo2009-04-171-138/+100
| | | | | | | | | | | 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>
* libglusterfsclient: Replace dict based inode ctx with array based oneShehjar Tikoo2009-04-171-82/+103
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Fix fd_ctx leak on release cbksShehjar Tikoo2009-04-171-5/+27
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Replace dict-based fd ctx with array-based oneShehjar Tikoo2009-04-171-114/+105
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Generalize [RW] checks on dirsShehjar Tikoo2009-04-171-16/+11
| | | | | | | | | 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>
* libglusterfsclient: Check for directory on O_CREATShehjar Tikoo2009-04-171-2/+13
| | | | | | | | | 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>
* libglusterfsclient: Create and use LIBGF_REPLY_NOTIFY macroShehjar Tikoo2009-04-172-110/+27
| | | | | | | 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>
* libglusterfsclient: Fix segfault on non-NULL loc->nameShehjar Tikoo2009-04-171-3/+3
| | | | | | | | | | | | 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>
* libglusterfsclient: Use macros for argument checksShehjar Tikoo2009-04-171-37/+22
| | | | | | | | | | 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>
* libglusterfsclient: Rename XLATOR_NAME defineShehjar Tikoo2009-04-171-25/+25
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* introduce page_size in glusterfs_ctx_t to be used by all translators set it ↵Anand V. Avati2009-04-131-1/+3
| | | | | | to 128KB in main() Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* updated libglusterfsclient with IOBUF/IOBREFsAnand V. Avati2009-04-123-22/+25
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Complete support for rmdir fopShehjar Tikoo2009-04-081-4/+36
| | | | | | | glusterfs_rmdir code path wasnt implemented completely. Here is an attempt to complete it. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Create new directory inodeShehjar Tikoo2009-04-081-0/+1
| | | | | | | | Make sure we give an allocated inode in the loc so that the underlying callbacks are able to fill it with the relevant information about the directory being created. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Return ENOENT on missing ancestor componentShehjar Tikoo2009-04-081-0/+6
| | | | | | | | If any of the path's components, except the basename, are missing from the dentry cache and the corresponding lookup from the server also fails, return an ENOENT. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Return EEXIST on lookup success in glusterfs_mkdirShehjar Tikoo2009-04-081-4/+3
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Perform explicit createShehjar Tikoo2009-04-081-4/+3
| | | | | | | | | | | We must create the file based on the O_CREATE in the flags instead of depending on the return status of the lookup. This works because we've already handled O_EXCL earlier and also handled a missing file(ENOENT) in case this was actually an open and not create. Adapted from Raghu's original patch. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Handle O_CREAT on lookup failureShehjar Tikoo2009-04-081-0/+15
| | | | | | | | | | | | | | | | | On lookup failure, if O_CREAT is required, then we must: 1. explicitly lookup the parent directory. 2. create a new inode for the new file being opened. This special case is required for file creation because: 1. We cannot depend on the previous lookup to have reliably looked up the parent inode. 2. inode for the new file does not exist in the itable. Patch adapted from Raghu's original fix. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Dont depend on ENOENTShehjar Tikoo2009-04-081-2/+2
| | | | | | | | | | Dont depend on the dentry and explicit lookup function, i.e. libgf_client_path_lookup(..), to return ENOENT on not finding a dentry. Just use op_ret = -1 as a lookup failure status. Patch adapted from Raghu's original fix. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Remove spurious strcmpShehjar Tikoo2009-04-081-6/+0
| | | | | | | | | | | This strcmp existed because of assumptions that do not hold true since the change in libglusterfsclient internals recently. This is another step in fixing the seg-fault on glusterfs_create. Patch adapted from Raghu's original fix to the problem. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Resolve path on empty cachesShehjar Tikoo2009-04-081-17/+11
| | | | | | | | | | | | | | | | | The earlier case was that the explicit lookups to the server were being sent only when the parent inode was NULL. This situation breaks when the parent inode is available in the i- or d-cache but the child dirent is not. In such a case, no explicit lookups were being sent to get the missing child dirent. Now, explicit path lookup happens even if the inode for parent or basename is not found in the caches. This also fixes a seg-fault occuring during glusterfs_open, in my test case, but one that could occur almost anywhere lookup code is used. Patch adapted from Raghu's original patch. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Fix segfault in glusterfs_openShehjar Tikoo2009-04-081-3/+3
| | | | | | | | | | | | libgf_client_loc_fill gets passed a name=NULL argument. So when this function returns the filled loc argument, this loc is actually missing the inode structure that was to be filled. The segfault actually occurs a few lines later when we try to access fd->flags but fd returned by fd_create is NULL because we'd passed a NULL inode to it, i.e. the loc->inode. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* Fix an incorrect type-cast in libglusterfsclient.cVikas Gorur2009-04-061-1/+1
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient - reimplement glusterfs_fgetxattr and glusterfs_fsetxattrRaghavendra G2009-04-031-90/+137
| | | | | | | | - glusterfs_fgetxattr and glusterfs_fsetxattr earlier used lookup and setxattr fops for implementation. Change it to use fgetxattr and fsetxattr fops instead. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient - fix bug in __do_path_resolveRaghavendra G2009-04-031-22/+26
| | | | | | | | - add argument lookup_basename to __do_path_resolve which indicates whether to lookup basename(path). This is necessary for apis like glusterfs_get, which dont want basename(path) to be looked up by libgf_client_lookup_path. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient - move lookup timeout related code to ↵Raghavendra G2009-04-033-227/+181
| | | | | | | | | | libgf_client_path_lookup - this simplifies the resolution of path to inode, the apis which receive path as argument just need to call libgf_client_path_lookup for path->inode translation. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient - fix indentationRaghavendra G2009-04-033-78/+155
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>