7f4c2a
From a1aad4e5f096e3ec2ad832f3d91f1000e17cdb37 Mon Sep 17 00:00:00 2001
7f4c2a
From: Soumya Koduri <skoduri@redhat.com>
7f4c2a
Date: Thu, 30 Jul 2015 16:37:45 +0530
7f4c2a
Subject: [PATCH 298/304] snapshot: Make fops static for correct resolution of symbols
7f4c2a
7f4c2a
Few of the snapshot fops (like 'svc_lookup') may not get resolved
7f4c2a
while using dynamic loading as there could be other libraries(like libntirpc)
7f4c2a
with same routine names. Making them static to resolve the same.
7f4c2a
7f4c2a
This is backport of the below fix -
7f4c2a
http://review.gluster.org/#/c/11805/
7f4c2a
7f4c2a
Change-Id: I6577bf3705864f5583425c94427b4e1025a59bcd
7f4c2a
BUG: 1245636
7f4c2a
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
7f4c2a
Reviewed-on: http://review.gluster.org/11805
7f4c2a
Reviewed-by: Niels de Vos <ndevos@redhat.com>
7f4c2a
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
7f4c2a
Reviewed-on: https://code.engineering.redhat.com/gerrit/56154
7f4c2a
Tested-by: Kaleb Keithley <kkeithle@redhat.com>
7f4c2a
---
7f4c2a
 .../features/snapview-client/src/snapview-client.c |   74 ++++++++++----------
7f4c2a
 1 files changed, 38 insertions(+), 36 deletions(-)
7f4c2a
7f4c2a
diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c
7f4c2a
index f1b3899..b3f1a92 100644
7f4c2a
--- a/xlators/features/snapview-client/src/snapview-client.c
7f4c2a
+++ b/xlators/features/snapview-client/src/snapview-client.c
7f4c2a
@@ -263,7 +263,7 @@ out:
7f4c2a
 }
7f4c2a
 
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
7f4c2a
                 int32_t op_ret, int32_t op_errno, inode_t *inode,
7f4c2a
                 struct iatt *buf, dict_t *xdata, struct iatt *postparent)
7f4c2a
@@ -378,7 +378,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc,
7f4c2a
             dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -498,7 +498,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc,
7f4c2a
             dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -561,7 +561,7 @@ out:
7f4c2a
    handled? i.e just based on inode type decide where the call should
7f4c2a
    be sent and in the call back update the contexts.
7f4c2a
 */
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_stat (call_frame_t *frame, xlator_t *this, loc_t *loc,
7f4c2a
           dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -591,7 +591,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
7f4c2a
 {
7f4c2a
         int32_t      ret        = -1;
7f4c2a
@@ -620,7 +620,7 @@ out:
7f4c2a
         return ret;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
7f4c2a
                  int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -687,7 +687,7 @@ out:
7f4c2a
    will not be any corresponding fd opened on svs and
7f4c2a
    svc has to do things that open-behind is doing.
7f4c2a
 */
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
7f4c2a
              dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -733,7 +733,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
7f4c2a
              struct iatt *stbuf, int32_t valid, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -777,6 +777,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
+/* XXX: This function is currently not used. Mark it 'static' when required */
7f4c2a
 int32_t
7f4c2a
 svc_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf,
7f4c2a
              int32_t valid, dict_t *xdata)
7f4c2a
@@ -820,7 +821,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name,
7f4c2a
               dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -900,6 +901,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
+/* XXX: This function is currently not used. Mark it 'static' when required */
7f4c2a
 int32_t
7f4c2a
 svc_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name,
7f4c2a
               dict_t *xdata)
7f4c2a
@@ -931,7 +933,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
7f4c2a
               int32_t flags, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -976,7 +978,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
7f4c2a
               int32_t flags, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -1020,7 +1022,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
7f4c2a
            dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -1064,7 +1066,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
7f4c2a
                int32_t op_ret, int32_t op_errno, inode_t *inode,
7f4c2a
                struct iatt *buf, struct iatt *preparent,
7f4c2a
@@ -1089,7 +1091,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
7f4c2a
            mode_t umask, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -1136,7 +1138,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
7f4c2a
                int32_t op_ret, int32_t op_errno, inode_t *inode,
7f4c2a
                struct iatt *buf, struct iatt *preparent,
7f4c2a
@@ -1160,7 +1162,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
7f4c2a
            dev_t rdev, mode_t umask, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -1211,7 +1213,7 @@ out:
7f4c2a
    a virtual inode, then unwind the call back with EROFS. Otherwise simply
7f4c2a
    STACK_WIND the call to the first child of svc xlator.
7f4c2a
 */
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
7f4c2a
           fd_t *fd, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -1256,7 +1258,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
7f4c2a
                 int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode,
7f4c2a
                 struct iatt *stbuf, struct iatt *preparent,
7f4c2a
@@ -1281,7 +1283,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_create (call_frame_t *frame, xlator_t *this,
7f4c2a
             loc_t *loc, int32_t flags, mode_t mode,
7f4c2a
             mode_t umask, fd_t *fd, dict_t *xdata)
7f4c2a
@@ -1330,7 +1332,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
7f4c2a
                      int32_t op_ret, int32_t op_errno, inode_t *inode,
7f4c2a
                      struct iatt *buf, struct iatt *preparent,
7f4c2a
@@ -1355,7 +1357,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
7f4c2a
              loc_t *loc, mode_t umask, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -1402,7 +1404,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
7f4c2a
             dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -1445,7 +1447,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
7f4c2a
            off_t offset, uint32_t flags, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -1476,7 +1478,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_readlink (call_frame_t *frame, xlator_t *this,
7f4c2a
               loc_t *loc, size_t size, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -1507,7 +1509,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask,
7f4c2a
             dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -1538,7 +1540,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd,
7f4c2a
              size_t size, off_t off,
7f4c2a
              dict_t *xdata)
7f4c2a
@@ -1614,7 +1616,7 @@ out:
7f4c2a
  * windows.
7f4c2a
  */
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_readdirp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
7f4c2a
                          int32_t op_ret, int32_t op_errno, inode_t *inode,
7f4c2a
                          struct iatt *buf, dict_t *xdata,
7f4c2a
@@ -1787,7 +1789,7 @@ out:
7f4c2a
         return unwind;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
7f4c2a
                   int32_t op_ret, int32_t op_errno,
7f4c2a
                   gf_dirent_t *entries, dict_t *xdata)
7f4c2a
@@ -1847,7 +1849,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd,
7f4c2a
               size_t size, off_t off,
7f4c2a
               dict_t *xdata)
7f4c2a
@@ -1923,7 +1925,7 @@ out:
7f4c2a
 /* Renaming the entries from or to snapshots is not allowed as the snapshots
7f4c2a
    are read-only.
7f4c2a
 */
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,
7f4c2a
             loc_t *newloc, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -2001,7 +2003,7 @@ out:
7f4c2a
    will be equivalent of creating hardlinks across different filesystems.
7f4c2a
    And so is vise versa.
7f4c2a
 */
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
7f4c2a
           dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -2049,7 +2051,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
7f4c2a
                  const char *name, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -2094,7 +2096,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int
7f4c2a
+static int
7f4c2a
 svc_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync,
7f4c2a
            dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -2138,7 +2140,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_flush (call_frame_t *frame, xlator_t *this,
7f4c2a
            fd_t *fd, dict_t *xdata)
7f4c2a
 {
7f4c2a
@@ -2168,7 +2170,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_releasedir (xlator_t *this, fd_t *fd)
7f4c2a
 {
7f4c2a
         svc_fd_t *sfd      = NULL;
7f4c2a
@@ -2191,7 +2193,7 @@ out:
7f4c2a
         return 0;
7f4c2a
 }
7f4c2a
 
7f4c2a
-int32_t
7f4c2a
+static int32_t
7f4c2a
 svc_forget (xlator_t *this, inode_t *inode)
7f4c2a
 {
7f4c2a
         int            ret      = -1;
7f4c2a
-- 
7f4c2a
1.7.1
7f4c2a