Blob Blame History Raw
From a1aad4e5f096e3ec2ad832f3d91f1000e17cdb37 Mon Sep 17 00:00:00 2001
From: Soumya Koduri <skoduri@redhat.com>
Date: Thu, 30 Jul 2015 16:37:45 +0530
Subject: [PATCH 298/304] snapshot: Make fops static for correct resolution of symbols

Few of the snapshot fops (like 'svc_lookup') may not get resolved
while using dynamic loading as there could be other libraries(like libntirpc)
with same routine names. Making them static to resolve the same.

This is backport of the below fix -
http://review.gluster.org/#/c/11805/

Change-Id: I6577bf3705864f5583425c94427b4e1025a59bcd
BUG: 1245636
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/11805
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/56154
Tested-by: Kaleb Keithley <kkeithle@redhat.com>
---
 .../features/snapview-client/src/snapview-client.c |   74 ++++++++++----------
 1 files changed, 38 insertions(+), 36 deletions(-)

diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c
index f1b3899..b3f1a92 100644
--- a/xlators/features/snapview-client/src/snapview-client.c
+++ b/xlators/features/snapview-client/src/snapview-client.c
@@ -263,7 +263,7 @@ out:
 }
 
 
-int32_t
+static int32_t
 svc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 int32_t op_ret, int32_t op_errno, inode_t *inode,
                 struct iatt *buf, dict_t *xdata, struct iatt *postparent)
@@ -378,7 +378,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc,
             dict_t *xdata)
 {
@@ -498,7 +498,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc,
             dict_t *xdata)
 {
@@ -561,7 +561,7 @@ out:
    handled? i.e just based on inode type decide where the call should
    be sent and in the call back update the contexts.
 */
-int32_t
+static int32_t
 svc_stat (call_frame_t *frame, xlator_t *this, loc_t *loc,
           dict_t *xdata)
 {
@@ -591,7 +591,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
 {
         int32_t      ret        = -1;
@@ -620,7 +620,7 @@ out:
         return ret;
 }
 
-int32_t
+static int32_t
 svc_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                  int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata)
 {
@@ -687,7 +687,7 @@ out:
    will not be any corresponding fd opened on svs and
    svc has to do things that open-behind is doing.
 */
-int32_t
+static int32_t
 svc_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
              dict_t *xdata)
 {
@@ -733,7 +733,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
              struct iatt *stbuf, int32_t valid, dict_t *xdata)
 {
@@ -777,6 +777,7 @@ out:
         return 0;
 }
 
+/* XXX: This function is currently not used. Mark it 'static' when required */
 int32_t
 svc_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf,
              int32_t valid, dict_t *xdata)
@@ -820,7 +821,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name,
               dict_t *xdata)
 {
@@ -900,6 +901,7 @@ out:
         return 0;
 }
 
+/* XXX: This function is currently not used. Mark it 'static' when required */
 int32_t
 svc_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name,
               dict_t *xdata)
@@ -931,7 +933,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
               int32_t flags, dict_t *xdata)
 {
@@ -976,7 +978,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
               int32_t flags, dict_t *xdata)
 {
@@ -1020,7 +1022,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
            dict_t *xdata)
 {
@@ -1064,7 +1066,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                int32_t op_ret, int32_t op_errno, inode_t *inode,
                struct iatt *buf, struct iatt *preparent,
@@ -1089,7 +1091,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
            mode_t umask, dict_t *xdata)
 {
@@ -1136,7 +1138,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                int32_t op_ret, int32_t op_errno, inode_t *inode,
                struct iatt *buf, struct iatt *preparent,
@@ -1160,7 +1162,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
            dev_t rdev, mode_t umask, dict_t *xdata)
 {
@@ -1211,7 +1213,7 @@ out:
    a virtual inode, then unwind the call back with EROFS. Otherwise simply
    STACK_WIND the call to the first child of svc xlator.
 */
-int32_t
+static int32_t
 svc_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
           fd_t *fd, dict_t *xdata)
 {
@@ -1256,7 +1258,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode,
                 struct iatt *stbuf, struct iatt *preparent,
@@ -1281,7 +1283,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_create (call_frame_t *frame, xlator_t *this,
             loc_t *loc, int32_t flags, mode_t mode,
             mode_t umask, fd_t *fd, dict_t *xdata)
@@ -1330,7 +1332,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                      int32_t op_ret, int32_t op_errno, inode_t *inode,
                      struct iatt *buf, struct iatt *preparent,
@@ -1355,7 +1357,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
              loc_t *loc, mode_t umask, dict_t *xdata)
 {
@@ -1402,7 +1404,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
             dict_t *xdata)
 {
@@ -1445,7 +1447,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
            off_t offset, uint32_t flags, dict_t *xdata)
 {
@@ -1476,7 +1478,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_readlink (call_frame_t *frame, xlator_t *this,
               loc_t *loc, size_t size, dict_t *xdata)
 {
@@ -1507,7 +1509,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask,
             dict_t *xdata)
 {
@@ -1538,7 +1540,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd,
              size_t size, off_t off,
              dict_t *xdata)
@@ -1614,7 +1616,7 @@ out:
  * windows.
  */
 
-int32_t
+static int32_t
 svc_readdirp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                          int32_t op_ret, int32_t op_errno, inode_t *inode,
                          struct iatt *buf, dict_t *xdata,
@@ -1787,7 +1789,7 @@ out:
         return unwind;
 }
 
-int32_t
+static int32_t
 svc_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                   int32_t op_ret, int32_t op_errno,
                   gf_dirent_t *entries, dict_t *xdata)
@@ -1847,7 +1849,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd,
               size_t size, off_t off,
               dict_t *xdata)
@@ -1923,7 +1925,7 @@ out:
 /* Renaming the entries from or to snapshots is not allowed as the snapshots
    are read-only.
 */
-int32_t
+static int32_t
 svc_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,
             loc_t *newloc, dict_t *xdata)
 {
@@ -2001,7 +2003,7 @@ out:
    will be equivalent of creating hardlinks across different filesystems.
    And so is vise versa.
 */
-int32_t
+static int32_t
 svc_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
           dict_t *xdata)
 {
@@ -2049,7 +2051,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
                  const char *name, dict_t *xdata)
 {
@@ -2094,7 +2096,7 @@ out:
         return 0;
 }
 
-int
+static int
 svc_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync,
            dict_t *xdata)
 {
@@ -2138,7 +2140,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_flush (call_frame_t *frame, xlator_t *this,
            fd_t *fd, dict_t *xdata)
 {
@@ -2168,7 +2170,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_releasedir (xlator_t *this, fd_t *fd)
 {
         svc_fd_t *sfd      = NULL;
@@ -2191,7 +2193,7 @@ out:
         return 0;
 }
 
-int32_t
+static int32_t
 svc_forget (xlator_t *this, inode_t *inode)
 {
         int            ret      = -1;
-- 
1.7.1