10 Commits

Author SHA1 Message Date
Jiffin Tony Thottan
1ead86a8bc libgfapi: adding 'follow' flag to glfs_h_lookupat()
Previously glfs_h_lookupat won't follow the symlink, this patch
introduces new flag `follow` which will resolve the same. Applications
linking against the new library will need to use the new glfs_h_lookupat
API call.

In order to stay compatible with existing binaries that use the previous
glfs_h_lookupat() function, the old symbol needs to stay available.

Verification that there are two versions of glfs_h_lookupat:

  $ objdump -T /usr/lib64/libgfapi.so.0 | grep -w glfs_h_lookupat
  0000000000015070 g    DF .text  000000000000021e  GFAPI_3.7.4 glfs_h_lookupat
  0000000000015290 g    DF .text  0000000000000008 (GFAPI_3.4.2) glfs_h_lookupat

Testing with a binary (based on anonymous_fd_read_write.c from ./tests/)
that was linked against the old library:

  $ objdump -T ./lookupat | grep -w glfs_h_lookupat
  0000000000000000      DF *UND*  0000000000000000  GFAPI_3.4.2 glfs_h_lookupat

Enable debugging for 'ld.so' so that we can check that the GFAPI_3.4.2
version of the symbol gets loaded:

  $ export LD_DEBUG_OUTPUT=lookupat.ld.log LD_DEBUG=all
  $ ./lookupat
  $ grep -w glfs_h_lookupat lookupat.ld.log.2543
  2543:     symbol=glfs_h_lookupat;  lookup in file=./lookupat [0]
  2543:     symbol=glfs_h_lookupat;  lookup in file=/lib64/libgfapi.so.0 [0]
  2543:     binding file ./lookupat [0] to /lib64/libgfapi.so.0 [0]: normal symbol `glfs_h_lookupat' [GFAPI_3.4.2]

Change-Id: I8bf9b1c19a0585f681bc1a7f84aad1ccd0f75f6a
BUG: 1252410
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/11883
Reviewed-by: soumya k <skoduri@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
2015-08-24 09:21:51 -07:00
arvindch
d4343f0d19 fixed a few misspellings. no code changes present
Change-Id: Ia1a771301e9f1becbbffd8afd7eb68bec9696ef8
BUG: 1075417
Signed-off-by: arvindch <achembarpu@gmail.com>
Reviewed-on: http://review.gluster.org/7283
Reviewed-by: Justin Clift <justin@gluster.org>
Tested-by: Anand Avati <avati@redhat.com>
2014-03-17 16:13:31 -07:00
Lalatendu Mohanty
f42a764924 libgfapi: fixing tabs in glfsxmp.c with whitespace
Just replacing tabs with whitespace. No code changes present
in this patch

Change-Id: Ic3f64f5a52b0ab5e5c9fe9f45113901dec751e68
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
Reviewed-on: http://review.gluster.org/6148
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-10-27 22:50:11 -07:00
Lalatendu Mohanty
656db3a8e0 libgfapi: Fix to compilation failure/warnings for examples/glfsxmp.c
The comilation of glfsxmp.c i.e. "make glfsxmp" was failing
with "undefined reference to `clock_gettime'" error.

Fixed all compilation warnings for unused variables and
wrong formart specifier in printf e.g. : "format ‘%d’ expects
argument of type ‘int’, but argument 3 has type ‘__syscall_slong_t’
[-Wformat]"

Also added the compilation steps for glfsxmp.c in the
README file

Change-Id: I399ec7c9ad7b6412463c89099d63922caef6749e
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
Reviewed-on: http://review.gluster.org/6085
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Tested-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-10-16 00:55:50 -07:00
R.Shyamsundar
d573f170cf gfapi: object handle based API extensions
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>
2013-10-11 12:16:46 -07:00
Anand Avati
a1db18cf7a gfapi: support for chdir() and family
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>
2013-04-19 04:41:35 -07:00
Avra Sengupta
5f88d4c1b0 libgfapi: "tcp" is documented as the valid transport type instead of "socket".
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>
2012-11-28 16:24:41 -08:00
Anand Avati
b872ccf508 api/examples: updated examples to use new calls
Change-Id: I865d0c52de268b27bbdb8786d3f4af5ef3ce3d9a
BUG: 839950
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/4023
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2012-11-05 05:53:56 -08:00
Anand Avati
c8ed0096d5 glfsxmp extension
Change-Id: I3859621637025e464bc83d748bae7dff9808643f
BUG: 839950
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.com/3735
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-08-02 13:25:02 -07:00
Anand Avati
b324e31731 glfsxmp: libgfapi based example
This is an example application which uses libgfapi. It is
a complete autotools based build system which demonstrates the
required changes in configure.ac, Makefile.am etc to successfuly
detect for and build an application against libgfapi.

There are two approaches to building a libgfapi based application:

1. In the presence of pkg-config in your build system.
This is the recommended approach which is also used in this example.
For this approach to work, you need to build glusterfs by passing
--pkgconfigdir=/usr/lib64/pkgconfig (or the appropriate directory)
in your distro. This already happens if you build RPMs with the
glusterfs.spec provided in glusterfs.git. You will also need to
install glusterfs-api RPM.

2. In the absence of pkg-config in your build system.
Make sure your LDFLAGS includes -L/path/to/lib where libgfapi.so is
installed and -I/path/to/include/glusterfs where the 'api' directory

Change-Id: Ic4eab2df002d7e8d20593a03e643859423048848
BUG: 839950
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.com/3666
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-07-18 12:12:25 -07:00