vol: Make FindLinkHandle static and namei-only
authorAndrew Deason <adeason@sinenomine.net>
Tue, 18 Feb 2014 19:00:38 +0000 (13:00 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 3 Dec 2014 01:14:45 +0000 (20:14 -0500)
FindLinkHandle is only referenced inside vol-salvage.c. Also, the
concept of a link table only exists on namei, so the function is only
used for the namei server (and it's only called by other namei-only
code).

So, make the function static, and put it inside the AFS_NAMEI_ENV
ifdef, to be a little more clear about where it can be used. Moving it
inside the AFS_NAMEI_ENV ifdef also avoids a warning if FindLinkHandle
is made static, since otherwise the function would be defined but
unused on non-namei.

This change should incur no difference in behavior; it is just code
reorganization.

Change-Id: Ia8cdadafaf15c724462f600514aa59910619a090
Reviewed-on: http://gerrit.openafs.org/10848
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/vol/vol-salvage.c

index 03945ff..547a5ca 100644 (file)
@@ -1801,10 +1801,11 @@ GetVolumeSummary(struct SalvInfo *salvinfo, VolumeId singleVolumeNumber)
     return 0;
 }
 
+#ifdef AFS_NAMEI_ENV
 /* Find the link table. This should be associated with the RW volume, even
  * if there is only an RO volume at this site.
  */
-Inode
+static Inode
 FindLinkHandle(struct InodeSummary *isp, int nVols,
               struct ViceInodeInfo *allInodes)
 {
@@ -1824,7 +1825,6 @@ FindLinkHandle(struct InodeSummary *isp, int nVols,
     return (Inode) - 1;
 }
 
-#ifdef AFS_NAMEI_ENV
 static int
 CheckDupLinktable(struct SalvInfo *salvinfo, struct InodeSummary *isp, struct ViceInodeInfo *ip)
 {