Skip to contentSkip to conversation

xfs:Make the function,xfs_alloc_lookup_eq static

PATCH In review Nicholas Krause 3 participants 16 messages May 5, 2015 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/12 xfs:Make the function,xfs_alloc_lookup_eq static

This makes the function,xfs_alloc_lookup_eq static as there are no calls to this function outside the definition file for this function, xfs_alloc.c.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +1 -1
index 516162b..48de3f0 100644
@@ -52,7 +52,7 @@ STATIC int xfs_alloc_ag_vextent_small(xfs_alloc_arg_t *,
 /*
  * Lookup the record equal to [bno, len] in the btree given by cur.
  */
-STATIC int				/* error */
+static int				/* error */
 xfs_alloc_lookup_eq(
 	struct xfs_btree_cur	*cur,	/* btree cursor */
 	xfs_agblock_t		bno,	/* starting block of extent */
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw

PATCH 3/12 xfs:Make the function,xfs_alloc_compute_aligned static

This makes the function,xfs_alloc_compute_aligned static now as there are no callers outside of the function's declariton file.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +1 -1
index 096c6c8..5e575ac 100644
@@ -139,7 +139,7 @@ xfs_alloc_get_rec(
  * Compute aligned version of the found extent.
  * Takes alignment and min length into account.
  */
-STATIC void
+static void
 xfs_alloc_compute_aligned(
 	xfs_alloc_arg_t	*args,		/* allocation argument structure */
 	xfs_agblock_t	foundbno,	/* starting block in found extent */
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw

PATCH 2/12 xfs:Make the function,xfs_alloc_update static

In reply to Nicholas Krause

This makes the function xfs_alloc_update now to be a statically defined function due to no callers outside of the declarition file,xfs_alloc.c.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +1 -1
index 48de3f0..096c6c8 100644
@@ -101,7 +101,7 @@ xfs_alloc_lookup_le(
  * by [bno, len].
  * This either works (return 0) or gets an EFSCORRUPTED error.
  */
-STATIC int				/* error */
+static int				/* error */
 xfs_alloc_update(
 	struct xfs_btree_cur	*cur,	/* btree cursor */
 	xfs_agblock_t		bno,	/* starting block of extent */
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#3 lore raw

PATCH 4/12 xfs:Make the function,xfs_alloc_fix_len static

In reply to Nicholas Krause

This properly makes the function,xfs_alloc_fix_len static due to no callers outside of the file this function is declared and defined in.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +1 -1
index 5e575ac..71d20a4 100644
@@ -239,7 +239,7 @@ xfs_alloc_compute_diff(
  * If len is too small it is returned unchanged.
  * If len hits maxlen it is left alone.
  */
-STATIC void
+static void
 xfs_alloc_fix_len(
 	xfs_alloc_arg_t	*args)		/* allocation argument structure */
 {
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#4 lore raw

PATCH 5/12 xfs:Make the function, xfs_alloc_fix_minleft static

In reply to Nicholas Krause

This makes the function, xfs_alloc_fix_minleft to be static due to no callers of this function outside the file,xfs_alloc.c.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +1 -1
index 71d20a4..fdf2877 100644
@@ -272,7 +272,7 @@ xfs_alloc_fix_len(
  * Fix up length if there is too little space left in the a.g.
  * Return 1 if ok, 0 if too little, should give up.
  */
-STATIC int
+static int
 xfs_alloc_fix_minleft(
 	xfs_alloc_arg_t	*args)		/* allocation argument structure */
 {
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#6 lore raw

PATCH 7/12 xfs:Make the function,xfs_alloc_read_agfl static

In reply to Nicholas Krause

This makes the function,xfs_alloc_read_agfl static now due to having no external callers outside the file,xfs_alloc.c.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +1 -1
index 4492311..53ed3f3 100644
@@ -526,7 +526,7 @@ const struct xfs_buf_ops xfs_agfl_buf_ops = {
 /*
  * Read in the allocation group free block array.
  */
-STATIC int				/* error */
+static int				/* error */
 xfs_alloc_read_agfl(
 	xfs_mount_t	*mp,		/* mount point structure */
 	xfs_trans_t	*tp,		/* transaction pointer */
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#5 lore raw

PATCH 6/12 xfs:Make the function,xfs_alloc_fixup_trees static

In reply to Nicholas Krause

This makes the function,xfs_alloc_fixup_trees static now due to it having no external callers outside of the file,xfs_alloc.c.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +1 -1
index fdf2877..4492311 100644
@@ -301,7 +301,7 @@ xfs_alloc_fix_minleft(
  * Flags are passed in indicating whether the cursors are set to the
  * relevant records.
  */
-STATIC int				/* error code */
+static int				/* error code */
 xfs_alloc_fixup_trees(
 	xfs_btree_cur_t	*cnt_cur,	/* cursor for by-size btree */
 	xfs_btree_cur_t	*bno_cur,	/* cursor for by-block btree */
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#7 lore raw

PATCH 8/12 xfs:Make the function,xfs_alloc_update_counters static

In reply to Nicholas Krause

This makes the function,xfs_alloc_update_counters static now due to no external callers to this function for other files.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +1 -1
index 53ed3f3..2f94b53 100644
@@ -548,7 +548,7 @@ xfs_alloc_read_agfl(
 	return 0;
 }
 
-STATIC int
+static int
 xfs_alloc_update_counters(
 	struct xfs_trans	*tp,
 	struct xfs_perag	*pag,
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#8 lore raw

PATCH 9/12 xfs:Make the function,xfs_alloc_ag_vextent static

In reply to Nicholas Krause

This makes the function,xfs_alloc_ag_vextent static now due to its only callers being in the same file as this function's declaration and definition.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +1 -1
index 2f94b53..3c9a58f 100644
@@ -581,7 +581,7 @@ xfs_alloc_update_counters(
  * and of the form k * prod + mod unless there's nothing that large.
  * Return the starting a.g. block, or NULLAGBLOCK if we can't do it.
  */
-STATIC int			/* error */
+static int			/* error */
 xfs_alloc_ag_vextent(
 	xfs_alloc_arg_t	*args)	/* argument structure for allocation */
 {
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#9 lore raw

PATCH 10/12 xfs:Make the function, xfs_alloc_find_best_extent static

In reply to Nicholas Krause

This makes the function, xfs_alloc_find_best_extent to be static now due to having no external calls to this function.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +1 -1
index 3c9a58f..cd09335 100644
@@ -760,7 +760,7 @@ error0:
  * Search the btree in a given direction via the search cursor and compare
  * the records found against the good extent we've already found.
  */
-STATIC int
+static int
 xfs_alloc_find_best_extent(
 	struct xfs_alloc_arg	*args,	/* allocation argument structure */
 	struct xfs_btree_cur	**gcur,	/* good cursor */
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#10 lore raw

PATCH 11/12 xfs:Make the function,xfs_free_ag_extent static

In reply to Nicholas Krause

This makes the function,xfs_free_ag_extent static now due to having no external callers from outside the declaration file,xfs_alloc.c.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +1 -1
index cd09335..cbdd804 100644
@@ -1542,7 +1542,7 @@ error0:
 /*
  * Free the extent starting at agno/bno for length.
  */
-STATIC int			/* error */
+static int			/* error */
 xfs_free_ag_extent(
 	xfs_trans_t	*tp,	/* transaction pointer */
 	xfs_buf_t	*agbp,	/* buffer for a.g. freelist header */
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#11 lore raw

PATCH 12/12 xfs:Make the function,xfs_alloc_fix_freelist static

In reply to Nicholas Krause

This makes the function,xfs_alloc_fix_freelist static now due to it having no external callers.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +1 -1
index cbdd804..6628d5e 100644
@@ -1842,7 +1842,7 @@ xfs_alloc_longest_free_extent(
  * Decide whether to use this allocation group for this allocation.
  * If so, fix up the btree freelist's size.
  */
-STATIC int			/* error */
+static int			/* error */
 xfs_alloc_fix_freelist(
 	xfs_alloc_arg_t	*args,	/* allocation argument structure */
 	int		flags)	/* XFS_ALLOC_FLAG_... */
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#12 lore raw
In reply to Nicholas Krause
Quoted 3 lines · Nicholas Krause

This makes the function,xfs_alloc_lookup_eq static as there are no calls to this function outside the definition file for this function, xfs_alloc.c.

Nic, please stop trolling our lists.

Thank you, and *plonk*

author
#13 lore raw
Quoted 9 lines · Christoph Hellwig
Quoted 3 lines · Nicholas Krause

This makes the function,xfs_alloc_lookup_eq static as there are no calls to this function outside the definition file for this function, xfs_alloc.c.

Nic, please stop trolling our lists.

Thank you, and *plonk*

I am no trying to troll here, these are built tested and apply fine for me.
Nick

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#14 lore raw
In reply to Nicholas Krause
Quoted 14 lines · Nicholas Krause

This makes the function,xfs_alloc_lookup_eq static as there are no calls to this function outside the definition file for this function, xfs_alloc.c.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +0 -0
index 516162b..48de3f0 100644

fs/xfs/libxfs/xfs_alloc.c STATIC int xfs_alloc_ag_vextent_small(xfs_alloc_arg_t *, · line 58

Quoted 8 lines
fs/xfs/libxfs/xfs_alloc.c +1 -1
@@ -52,7 +52,7 @@ STATIC int xfs_alloc_ag_vextent_small(xfs_alloc_arg_t *,
 /*
  * Lookup the record equal to [bno, len] in the btree given by cur.
  */
-STATIC int				/* error */
+static int				/* error */
 xfs_alloc_lookup_eq(
 	struct xfs_btree_cur	*cur,	/* btree cursor */
 	xfs_agblock_t		bno,	/* starting block of extent */

Please have a look at what STATIC actually means, and then use the sparse checker to confirm that these functions are already static for a CONFIG_XFS_DEBUG=n build.

i.e. STATIC is a stack usage minimisation and debugging aid, not something that is broken and needs fixing.

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
author
#15 lore raw
Quoted 28 lines · Dave Chinner
Quoted 14 lines · Nicholas Krause

This makes the function,xfs_alloc_lookup_eq static as there are no calls to this function outside the definition file for this function, xfs_alloc.c.

---
 fs/xfs/libxfs/xfs_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_alloc.c +0 -0
index 516162b..48de3f0 100644

fs/xfs/libxfs/xfs_alloc.c STATIC int xfs_alloc_ag_vextent_small(xfs_alloc_arg_t *, · line 58

Quoted 8 lines
fs/xfs/libxfs/xfs_alloc.c +1 -1
@@ -52,7 +52,7 @@ STATIC int xfs_alloc_ag_vextent_small(xfs_alloc_arg_t *,
 /*
  * Lookup the record equal to [bno, len] in the btree given by cur.
  */
-STATIC int				/* error */
+static int				/* error */
 xfs_alloc_lookup_eq(
 	struct xfs_btree_cur	*cur,	/* btree cursor */
 	xfs_agblock_t		bno,	/* starting block of extent */

Please have a look at what STATIC actually means, and then use the sparse checker to confirm that these functions are already static for a CONFIG_XFS_DEBUG=n build.

Quoted 7 lines

i.e. STATIC is a stack usage minimisation and debugging aid, not something that is broken and needs fixing.

Cheers,

Dave.

That's Ok I wasn't sure if that was there for those reasons.Next time I will be more careful and check out the macros I don't known. :( Sorry,
Nick

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs