summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
Commit message (Collapse)AuthorAgeFilesLines
...
* libglusterfsclient: Add VMP-based statShehjar Tikoo2009-04-212-6/+33
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Fix stat cache bugShehjar Tikoo2009-04-211-5/+12
| | | | | | | | | | | | | The way stat cache gets updated was not consistent across all syscalls. Consequently, I was running into a bug that returned a 0 st_ino. The fix actually resides in the hunk that changes the lines in libgf_client_lookup but similar changes were also required in other users of stat cache. This commit fixes the bug and also cleans up the way stat cache is updated. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add VMP-based setxattrShehjar Tikoo2009-04-212-9/+35
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add VMP-based creatShehjar Tikoo2009-04-212-4/+26
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add VMP-based openShehjar Tikoo2009-04-212-7/+41
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add VMP-based getxattrShehjar Tikoo2009-04-212-8/+35
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add VMP-based getShehjar Tikoo2009-04-212-6/+30
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Add virtual mount point supportShehjar Tikoo2009-04-213-0/+178
| | | | | | | | | | | | | | | | | | | | | One part of the glusterfsclient library requires users to use a handle to address a particular glusterfs context. This can become cumbersome for applications that need to use multiple such context. For such applications, we make it easy by letting them define virtual mount points(VMPs), which are just paths that identify a particular glusterfs context. This is done through a new glusterfs_mount(..) interface. Subsequenly, any path based operations, that pre-pend a VMP before the files and directories inside the glusterfsd export, get internally routed to the correct glusterfs context. This helps users do away with the need to maintain their own path-to-glusterfs_handle_t mapping. The old handle-based interface still exists for whoever wishes to use it. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Must return size from readvShehjar Tikoo2009-04-211-1/+0
| | | | | | | | The line being removed made libgf_client_readv return a 0 on successfull return when the return should really be the size of data read. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* libglusterfsclient: Expose glusterfs_realpathShehjar Tikoo2009-04-211-0/+3
| | | | Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* 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>