summaryrefslogtreecommitdiffstats
path: root/api/src/glfs.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'upstream'Jeff Darcy2014-04-221-15/+18
|\ | | | | | | | | | | | | | | | | | | Conflicts: glusterfs.spec.in xlators/mgmt/glusterd/src/Makefile.am xlators/mgmt/glusterd/src/glusterd-utils.c xlators/mgmt/glusterd/src/glusterd.h Change-Id: I27bdcf42b003cfc42d6ad981bd2bf8180176806d
| * gfapi: glfs_set_volfile_server() now entertains multiple callsHarshavardhana2014-04-011-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous API: glfs_set_volfile_server (..., const char *host, ...) - single call New API's: glfs_set_volfile_server (..., const char *host1, ...) glfs_set_volfile_server (..., const char *host2, ...) Multiple calls to this function with different volfile servers, port or transport-type would create a list of volfile servers which would be polled during `volfile_fetch_attempts()` glfs_unset_volfile_server (..., const char *host, ...) to remove a server from the list (this is provided for future usage) Change-Id: I313efbd3efbd0214e2a71465f33195788df406cc BUG: 986429 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/7317 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* | Merge branch 'upstream'Jeff Darcy2014-03-241-0/+30
|\|
| * api: add glfs_get_volfileJeff Darcy2014-03-051-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the API-header description: > Sometimes it's useful e.g. for scripts to see the volfile, so that > they can parse it and find subvolumes to do things like split-brain > resolution or custom layouts. The API here was specifically intended > to make access e.g. from Python as simple as possible. > > Note that the volume must be started (not necessarily mounted) for > this to work. Change-Id: If3f55ee9611cdf4b77aa53659f0af0d21957817d Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/7183 Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* | Add GF_FOP_IPC for inter-translator communication.Jeff Darcy2014-03-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several features - e.g. encryption, erasure codes, or NSR - involve multiple cooperating translators which sometimes need a "private" means of communication amongst themselves. Historically we've used virtual or synthetic xattrs, but that's not very elegant and clutters up the getxattr/setxattr path which must also handle real xattr requests. This new fop should address that. The only argument is an int32_t "op" which should be recognized by the target translator. It is recommended that translators using these feature follow some convention regarding the ops that they define, to avoid conflicts. Using a hash of the target translator's type string as a base for a series of ops would probably be a good start. Any other information can be passed in both directions using xdata. The default behavior for this fop, as with any other, is to pass through to FIRST_CHILD. That makes use of this fop "transparent" to other translators that were written before it existed, but it also means that it only really works with pass-through translators. If a routing translator (such as DHT) or a fan-out translator (such as AFR) is involved, the IPC might not reach its intended destination unless those translators are modified to forward IPC fops along all paths. If an IPC gets all the way to storage/posix it is considered an error, much like an uncaught exception. We don't actually *do* anything in that case, but we do flag it as an error in the log. Change-Id: I7f37c9247ee35536f8136c7aea758e6fe04616c4 Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
* | Roll-up patch for NSR so far.Jeff Darcy2013-12-111-11/+75
|/ | | | | | | | Previous history: https://forge.gluster.org/~jdarcy/glusterfs-core/glusterfs-nsr Change-Id: I2b56328788753c6a74d9589815f2dd705ac9ce6a Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
* gfapi: add __THROW [(__attribute) ((__nothrow__))] to fn decls for C++ users.Kaleb S. KEITHLEY2013-12-031-91/+100
| | | | | | | | | | | | | | | | | | Off hand I don't know of anything written in C++ that is or could be a user of gfapi. Never the less, it's possible that one could exist, or be written, and marking the library entry points is a) friendly, b) possibly allows the C++ compiler to generate better code, and c) is a good practice when writing APIs that might be consumed by C++ applications. Considering we already take the first step and use __BEGIN_DECLS/__END_DECLS to be C++ friendly, we should take the extra step Change-Id: Ib319ecaa452a46f258a9c6e8c7221454d2fefd0f Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/6393 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* zerofill: Change the type of len argument of glfs_zerofill() to off_tBharata B Rao2013-11-141-2/+2
| | | | | | | | | | | | | | glfs_zerofill() can be potentially called to zero-out entire file and hence allow for bigger value of length parameter. Change-Id: I75f1d11af298915049a3f3a7cb3890a2d72fca63 BUG: 1028673 Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-on: http://review.gluster.org/6266 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: M. Mohan Kumar <mohan@in.ibm.com> Tested-by: M. Mohan Kumar <mohan@in.ibm.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gfapi: introduce glfs_readdir() and glfs_readdirplus() APIsAnand Avati2013-11-131-0/+19
| | | | | | | | | Change-Id: I6b233bf647585675f233898351bf593f251716cc BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/6201 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
* glusterfs: zerofill supportM. Mohan Kumar2013-11-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for a new ZEROFILL fop. Zerofill writes zeroes to a file in the specified range. This fop will be useful when a whole file needs to be initialized with zero (could be useful for zero filled VM disk image provisioning or during scrubbing of VM disk images). Client/application can issue this FOP for zeroing out. Gluster server will zero out required range of bytes ie server offloaded zeroing. In the absence of this fop, client/application has to repetitively issue write (zero) fop to the server, which is very inefficient method because of the overheads involved in RPC calls and acknowledgements. WRITESAME is a SCSI T10 command that takes a block of data as input and writes the same data to other blocks and this write is handled completely within the storage and hence is known as offload . Linux ,now has support for SCSI WRITESAME command which is exposed to the user in the form of BLKZEROOUT ioctl. BD Xlator can exploit BLKZEROOUT ioctl to implement this fop. Thus zeroing out operations can be completely offloaded to the storage device , making it highly efficient. The fop takes two arguments offset and size. It zeroes out 'size' number of bytes in an opened file starting from 'offset' position. This patch adds zerofill support to the following areas: - libglusterfs - io-stats - performance/md-cache,open-behind - quota - cluster/afr,dht,stripe - rpc/xdr - protocol/client,server - io-threads - marker - storage/posix - libgfapi Client applications can exloit this fop by using glfs_zerofill introduced in libgfapi.FUSE support to this fop has not been added as there is no system call for this fop. Changes from previous version 3: * Removed redundant memory failure log messages Changes from previous version 2: * Rebased and fixed build error Changes from previous version 1: * Rebased for latest master TODO : * Add zerofill support to trace xlator * Expose zerofill capability as part of gluster volume info Here is a performance comparison of server offloaded zeofill vs zeroing out using repeated writes. [root@llmvm02 remote]# time ./offloaded aakash-test log 20 real 3m34.155s user 0m0.018s sys 0m0.040s [root@llmvm02 remote]# time ./manually aakash-test log 20 real 4m23.043s user 0m2.197s sys 0m14.457s [root@llmvm02 remote]# time ./offloaded aakash-test log 25; real 4m28.363s user 0m0.021s sys 0m0.025s [root@llmvm02 remote]# time ./manually aakash-test log 25 real 5m34.278s user 0m2.957s sys 0m18.808s The argument log is a file which we want to set for logging purpose and the third argument is size in GB . As we can see there is a performance improvement of around 20% with this fop. Change-Id: I081159f5f7edde0ddb78169fb4c21c776ec91a18 BUG: 1028673 Signed-off-by: Aakash Lal Das <aakash@linux.vnet.ibm.com> Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Reviewed-on: http://review.gluster.org/5327 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gfapi: object handle based API extensionsR.Shyamsundar2013-10-111-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is an ongoing effort to integrate NFS Ganesha ( https://github.com/nfs-ganesha/nfs-ganesha/wiki ) with GlusterFS as one of the file system back ends. Towards this we need extensions to gfapi that can handle object based operations. Meaning, instead of using full paths or relative paths from cwd, it is required that we can work with APIs, like the *at POSIX variants, to be able to create, lookup, open etc. files and directories. Hence the objects are the files or directories themselves and we give out handles to these objects that can be used for further operations. This code drop is an initial implementation of the proposed APIs. The new APIs are implemented as glfs_h_XXX variants in the file glfs-handleops.c to mirror glfs-fops.c style. The code leverages holding onto inode references and doling these out as opaque/cookie type objects to the callers, to enable them to be used as handles in other operations. An fd based approach was considered, but due to the extra footprint that the fd structure and its counterparts would incur, this was dropped to take the approach of holding inode references themselves. Tested by extending glfsxmp.c to invoke and exercise the added APIs, and further tested with a reference integration of the same as an FSAL with NFS Ganesha. Change-Id: I23629c99e905b54070fa2e6565147812e5f3fa5d BUG: 1016000 Signed-off-by: R.Shyamsundar <srangana@redhat.com> Reviewed-on: http://review.gluster.org/5936 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* logging: Expose set_log_file_path() in libglusterfs.Vijay Bellur2013-09-241-1/+3
| | | | | | | | | | | | | This patch also changes the behavior of glfs_set_logging(). If logfile argument is not provided to glfs_set_logging(), libgfapi uses set_log_file_path() to create a logfile. Change-Id: I49ec66c7f16f5604ff2f7cf7b365b08a05b5460d BUG: 764890 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/5910 Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Anand Avati <avati@redhat.com>
* gfapi: implement a minimial glfs_fini()Anand Avati2013-09-171-0/+30
| | | | | | | | | | | | | | | At the very least, we should PARENT_DOWN on the currently active graph and disconnect ourselves from glusterd. Further cleanups underway. Change-Id: I9276686a84b0975b5ce272b4cbec1b80920d5c5c BUG: 1004519 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/5788 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* gfapi: Add description of glfs_io_cbk function as a commentAnand Avati2013-08-231-0/+23
| | | | | | | | | | | | No code change, just add a comment describing the callback function type. Change-Id: I3a5c5b3d3fe042b4f535963dd477806832c15704 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/5696 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* gfapi: async discard supportBrian Foster2013-06-131-0/+3
| | | | | | | | | | | | | | From: Bharata B Rao <bharata@linux.vnet.ibm.com> Add glfs_discard_async() to meet QEMU's discard requirements. BUG: 963678 Change-Id: I97723107fca88dd96cddc08cd67a286645a37922 Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.org/5144 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterfs: discard (hole punch) supportBrian Foster2013-06-131-0/+2
| | | | | | | | | | | | | | | | Add support for the DISCARD file operation. Discard punches a hole in a file in the provided range. Block de-allocation is implemented via fallocate() (as requested via fuse and passed on to the brick fs) but a separate fop is created within gluster to emphasize the fact that discard changes file data (the discarded region is replaced with zeroes) and must invalidate caches where appropriate. BUG: 963678 Change-Id: I34633a0bfff2187afeab4292a15f3cc9adf261af Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.org/5090 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gluster: add fallocate fop supportBrian Foster2013-06-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement support for the fallocate file operation. fallocate allocates blocks for a particular inode such that future writes to the associated region of the file are guaranteed not to fail with ENOSPC. This patch adds fallocate support to the following areas: - libglusterfs - mount/fuse - io-stats - performance/md-cache,open-behind - quota - cluster/afr,dht,stripe - rpc/xdr - protocol/client,server - io-threads - marker - storage/posix - libgfapi BUG: 949242 Change-Id: Ice8e61351f9d6115c5df68768bc844abbf0ce8bd Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.org/4969 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gfapi: add new API glfs_dup() to copy a file descriptorAnand Avati2013-05-291-0/+1
| | | | | | | | | | | | Duplicate a glfs_fd file descriptor. Inherit the internal fd_t with a reference. Change-Id: Ib30e9a46b608b9f78202957f4dab6ba6265a9ec0 BUG: 953694 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/5109 Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* gfapi: add new API glfs_set_xlator_option()Anand Avati2013-05-021-0/+3
| | | | | | | | | | | | This is the equivalent of specifying --xlator-option command line argument to glusterfsd. Change-Id: I1171dd518a85db4bd456fa0790f450e889a956cd BUG: 953694 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4927 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gfapi: POSIX locking supportAnand Avati2013-04-241-0/+6
| | | | | | | | | Change-Id: I37d9e1fb4a715094876be6af3856c1b4cf398021 BUG: 953694 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4881 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gfapi: implement readdirplus_r supportAnand Avati2013-04-241-0/+3
| | | | | | | | | | | This call is used by Samba VFS. Change-Id: Ib371502ad5a71b3b0e993f6b30e3dfb1f839c020 BUG: 953694 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4879 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gfapi: support for chdir() and familyAnand Avati2013-04-191-0/+8
| | | | | | | | | | | | Add support for chdir, fchdir, getcwd, realpath equivalents in GFAPI. These are required for the Samba VFS plugin. Change-Id: I91d2db9146994403c98961c489c7640c51d5add2 BUG: 953694 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4853 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* libgfapi: "tcp" is documented as the valid transport type instead of "socket".Avra Sengupta2012-11-281-2/+2
| | | | | | | | | Change-Id: I066e9be7755a535f385c102cdd1822adeda7f319 BUG: 860203 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/4226 Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* gfapi: added more API callsAnand Avati2012-10-081-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - stat - lstat - access - readlink - mknod - mkdir - rmdir - symlink - rename - link - opendir - closedir - seekdir - telldir - readdir_r - statvfs - chmod - fchmod - chown - lchown - fchown - utimens - lutimens - futimens - getxattr - lgetxattr - fgetxattr - setxattr - lsetxattr - fsetxattr - listxattr - llistxattr - flistxattr - removexattr - lremovexattr - fremovexattr Change-Id: Ic2467293ddfbcefaa9b41c82cec61a5602636833 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4022 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* gfapi: API/library for accessing gluster volumesAnand Avati2012-07-181-0/+366
Change-Id: Ie4cbcf91b58218bebf23cf951c313aceeb29f311 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3664 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Bharata B Rao <bharata.rao@gmail.com>