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