aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sandeen.net>2016-06-01 03:38:15 -0400
committerDave Chinner <david@fromorbit.com>2016-06-01 03:38:15 -0400
commit0d5a75e9e23ee39cd0d8a167393dcedb4f0f47b2 (patch)
treed9939f394f84061b34691df16c894d99ea29e731
parent0c871f9a101a290e61af02df49087d118543caeb (diff)
xfs: make several functions static
Al Viro noticed that xfs_lock_inodes should be static, and that led to ... a few more. These are just the easy ones, others require moving functions higher in source files, so that's not done here to keep this review simple. Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r--fs/xfs/libxfs/xfs_alloc.c2
-rw-r--r--fs/xfs/libxfs/xfs_alloc.h7
-rw-r--r--fs/xfs/libxfs/xfs_attr_leaf.h3
-rw-r--r--fs/xfs/libxfs/xfs_rtbitmap.c2
-rw-r--r--fs/xfs/xfs_attr_inactive.c2
-rw-r--r--fs/xfs/xfs_attr_list.c2
-rw-r--r--fs/xfs/xfs_bmap_util.c2
-rw-r--r--fs/xfs/xfs_bmap_util.h2
-rw-r--r--fs/xfs/xfs_inode.c16
-rw-r--r--fs/xfs/xfs_inode.h7
-rw-r--r--fs/xfs/xfs_log.c8
-rw-r--r--fs/xfs/xfs_log.h5
-rw-r--r--fs/xfs/xfs_rtalloc.h2
-rw-r--r--fs/xfs/xfs_super.c2
-rw-r--r--fs/xfs/xfs_super.h2
15 files changed, 14 insertions, 50 deletions
diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index a708e38b494c..99b077cbdd97 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -84,7 +84,7 @@ xfs_alloc_lookup_ge(
84 * Lookup the first record less than or equal to [bno, len] 84 * Lookup the first record less than or equal to [bno, len]
85 * in the btree given by cur. 85 * in the btree given by cur.
86 */ 86 */
87int /* error */ 87static int /* error */
88xfs_alloc_lookup_le( 88xfs_alloc_lookup_le(
89 struct xfs_btree_cur *cur, /* btree cursor */ 89 struct xfs_btree_cur *cur, /* btree cursor */
90 xfs_agblock_t bno, /* starting block of extent */ 90 xfs_agblock_t bno, /* starting block of extent */
diff --git a/fs/xfs/libxfs/xfs_alloc.h b/fs/xfs/libxfs/xfs_alloc.h
index 135eb3d24db7..92a66ba76b0d 100644
--- a/fs/xfs/libxfs/xfs_alloc.h
+++ b/fs/xfs/libxfs/xfs_alloc.h
@@ -212,13 +212,6 @@ xfs_free_extent(
212 xfs_fsblock_t bno, /* starting block number of extent */ 212 xfs_fsblock_t bno, /* starting block number of extent */
213 xfs_extlen_t len); /* length of extent */ 213 xfs_extlen_t len); /* length of extent */
214 214
215int /* error */
216xfs_alloc_lookup_le(
217 struct xfs_btree_cur *cur, /* btree cursor */
218 xfs_agblock_t bno, /* starting block of extent */
219 xfs_extlen_t len, /* length of extent */
220 int *stat); /* success/failure */
221
222int /* error */ 215int /* error */
223xfs_alloc_lookup_ge( 216xfs_alloc_lookup_ge(
224 struct xfs_btree_cur *cur, /* btree cursor */ 217 struct xfs_btree_cur *cur, /* btree cursor */
diff --git a/fs/xfs/libxfs/xfs_attr_leaf.h b/fs/xfs/libxfs/xfs_attr_leaf.h
index 882c8d338891..4f2aed04f827 100644
--- a/fs/xfs/libxfs/xfs_attr_leaf.h
+++ b/fs/xfs/libxfs/xfs_attr_leaf.h
@@ -50,7 +50,6 @@ int xfs_attr_shortform_lookup(struct xfs_da_args *args);
50int xfs_attr_shortform_getvalue(struct xfs_da_args *args); 50int xfs_attr_shortform_getvalue(struct xfs_da_args *args);
51int xfs_attr_shortform_to_leaf(struct xfs_da_args *args); 51int xfs_attr_shortform_to_leaf(struct xfs_da_args *args);
52int xfs_attr_shortform_remove(struct xfs_da_args *args); 52int xfs_attr_shortform_remove(struct xfs_da_args *args);
53int xfs_attr_shortform_list(struct xfs_attr_list_context *context);
54int xfs_attr_shortform_allfit(struct xfs_buf *bp, struct xfs_inode *dp); 53int xfs_attr_shortform_allfit(struct xfs_buf *bp, struct xfs_inode *dp);
55int xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes); 54int xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes);
56void xfs_attr_fork_remove(struct xfs_inode *ip, struct xfs_trans *tp); 55void xfs_attr_fork_remove(struct xfs_inode *ip, struct xfs_trans *tp);
@@ -88,8 +87,6 @@ int xfs_attr3_leaf_toosmall(struct xfs_da_state *state, int *retval);
88void xfs_attr3_leaf_unbalance(struct xfs_da_state *state, 87void xfs_attr3_leaf_unbalance(struct xfs_da_state *state,
89 struct xfs_da_state_blk *drop_blk, 88 struct xfs_da_state_blk *drop_blk,
90 struct xfs_da_state_blk *save_blk); 89 struct xfs_da_state_blk *save_blk);
91int xfs_attr3_root_inactive(struct xfs_trans **trans, struct xfs_inode *dp);
92
93/* 90/*
94 * Utility routines. 91 * Utility routines.
95 */ 92 */
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c
index 951c044e24e4..e2e1106c9fad 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.c
+++ b/fs/xfs/libxfs/xfs_rtbitmap.c
@@ -70,7 +70,7 @@ const struct xfs_buf_ops xfs_rtbuf_ops = {
70 * Get a buffer for the bitmap or summary file block specified. 70 * Get a buffer for the bitmap or summary file block specified.
71 * The buffer is returned read and locked. 71 * The buffer is returned read and locked.
72 */ 72 */
73int 73static int
74xfs_rtbuf_get( 74xfs_rtbuf_get(
75 xfs_mount_t *mp, /* file system mount structure */ 75 xfs_mount_t *mp, /* file system mount structure */
76 xfs_trans_t *tp, /* transaction pointer */ 76 xfs_trans_t *tp, /* transaction pointer */
diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c
index 55d214981ed2..be0b79d8900f 100644
--- a/fs/xfs/xfs_attr_inactive.c
+++ b/fs/xfs/xfs_attr_inactive.c
@@ -322,7 +322,7 @@ xfs_attr3_node_inactive(
322 * Recurse (gasp!) through the attribute nodes until we find leaves. 322 * Recurse (gasp!) through the attribute nodes until we find leaves.
323 * We're doing a depth-first traversal in order to invalidate everything. 323 * We're doing a depth-first traversal in order to invalidate everything.
324 */ 324 */
325int 325static int
326xfs_attr3_root_inactive( 326xfs_attr3_root_inactive(
327 struct xfs_trans **trans, 327 struct xfs_trans **trans,
328 struct xfs_inode *dp) 328 struct xfs_inode *dp)
diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
index d25f26b22ac9..25e76cd6c053 100644
--- a/fs/xfs/xfs_attr_list.c
+++ b/fs/xfs/xfs_attr_list.c
@@ -65,7 +65,7 @@ xfs_attr_shortform_compare(const void *a, const void *b)
65 * we have to calculate each entries' hashvalue and sort them before 65 * we have to calculate each entries' hashvalue and sort them before
66 * we can begin returning them to the user. 66 * we can begin returning them to the user.
67 */ 67 */
68int 68static int
69xfs_attr_shortform_list(xfs_attr_list_context_t *context) 69xfs_attr_shortform_list(xfs_attr_list_context_t *context)
70{ 70{
71 attrlist_cursor_kern_t *cursor; 71 attrlist_cursor_kern_t *cursor;
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 3ce3c61af32a..28c42fb0c12a 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -407,7 +407,7 @@ xfs_bmap_count_tree(
407/* 407/*
408 * Count fsblocks of the given fork. 408 * Count fsblocks of the given fork.
409 */ 409 */
410int /* error */ 410static int /* error */
411xfs_bmap_count_blocks( 411xfs_bmap_count_blocks(
412 xfs_trans_t *tp, /* transaction pointer */ 412 xfs_trans_t *tp, /* transaction pointer */
413 xfs_inode_t *ip, /* incore inode */ 413 xfs_inode_t *ip, /* incore inode */
diff --git a/fs/xfs/xfs_bmap_util.h b/fs/xfs/xfs_bmap_util.h
index af97d9a1dfb4..149234824070 100644
--- a/fs/xfs/xfs_bmap_util.h
+++ b/fs/xfs/xfs_bmap_util.h
@@ -31,8 +31,6 @@ struct xfs_bmalloca;
31int xfs_bmap_rtalloc(struct xfs_bmalloca *ap); 31int xfs_bmap_rtalloc(struct xfs_bmalloca *ap);
32int xfs_bmap_eof(struct xfs_inode *ip, xfs_fileoff_t endoff, 32int xfs_bmap_eof(struct xfs_inode *ip, xfs_fileoff_t endoff,
33 int whichfork, int *eof); 33 int whichfork, int *eof);
34int xfs_bmap_count_blocks(struct xfs_trans *tp, struct xfs_inode *ip,
35 int whichfork, int *count);
36int xfs_bmap_punch_delalloc_range(struct xfs_inode *ip, 34int xfs_bmap_punch_delalloc_range(struct xfs_inode *ip,
37 xfs_fileoff_t start_fsb, xfs_fileoff_t length); 35 xfs_fileoff_t start_fsb, xfs_fileoff_t length);
38 36
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index ee6799e0476f..8825bcfd314c 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -431,7 +431,7 @@ xfs_lock_inumorder(int lock_mode, int subclass)
431 * lock more than one at a time, lockdep will report false positives saying we 431 * lock more than one at a time, lockdep will report false positives saying we
432 * have violated locking orders. 432 * have violated locking orders.
433 */ 433 */
434void 434static void
435xfs_lock_inodes( 435xfs_lock_inodes(
436 xfs_inode_t **ips, 436 xfs_inode_t **ips,
437 int inodes, 437 int inodes,
@@ -667,14 +667,6 @@ xfs_ip2xflags(
667 return _xfs_dic2xflags(dic->di_flags, dic->di_flags2, XFS_IFORK_Q(ip)); 667 return _xfs_dic2xflags(dic->di_flags, dic->di_flags2, XFS_IFORK_Q(ip));
668} 668}
669 669
670uint
671xfs_dic2xflags(
672 struct xfs_dinode *dip)
673{
674 return _xfs_dic2xflags(be16_to_cpu(dip->di_flags),
675 be64_to_cpu(dip->di_flags2), XFS_DFORK_Q(dip));
676}
677
678/* 670/*
679 * Lookups up an inode from "name". If ci_name is not NULL, then a CI match 671 * Lookups up an inode from "name". If ci_name is not NULL, then a CI match
680 * is allowed, otherwise it has to be an exact match. If a CI match is found, 672 * is allowed, otherwise it has to be an exact match. If a CI match is found,
@@ -748,7 +740,7 @@ out_unlock:
748 * are not linked into the directory structure - they are attached 740 * are not linked into the directory structure - they are attached
749 * directly to the superblock - and so have no parent. 741 * directly to the superblock - and so have no parent.
750 */ 742 */
751int 743static int
752xfs_ialloc( 744xfs_ialloc(
753 xfs_trans_t *tp, 745 xfs_trans_t *tp,
754 xfs_inode_t *pip, 746 xfs_inode_t *pip,
@@ -1085,7 +1077,7 @@ xfs_dir_ialloc(
1085 * link count to go to zero, move the inode to AGI unlinked list so that it can 1077 * link count to go to zero, move the inode to AGI unlinked list so that it can
1086 * be freed when the last active reference goes away via xfs_inactive(). 1078 * be freed when the last active reference goes away via xfs_inactive().
1087 */ 1079 */
1088int /* error */ 1080static int /* error */
1089xfs_droplink( 1081xfs_droplink(
1090 xfs_trans_t *tp, 1082 xfs_trans_t *tp,
1091 xfs_inode_t *ip) 1083 xfs_inode_t *ip)
@@ -1104,7 +1096,7 @@ xfs_droplink(
1104/* 1096/*
1105 * Increment the link count on an inode & log the change. 1097 * Increment the link count on an inode & log the change.
1106 */ 1098 */
1107int 1099static int
1108xfs_bumplink( 1100xfs_bumplink(
1109 xfs_trans_t *tp, 1101 xfs_trans_t *tp,
1110 xfs_inode_t *ip) 1102 xfs_inode_t *ip)
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index e52d7c7aeb5b..99d75223ff2e 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -395,12 +395,8 @@ void xfs_ilock_demote(xfs_inode_t *, uint);
395int xfs_isilocked(xfs_inode_t *, uint); 395int xfs_isilocked(xfs_inode_t *, uint);
396uint xfs_ilock_data_map_shared(struct xfs_inode *); 396uint xfs_ilock_data_map_shared(struct xfs_inode *);
397uint xfs_ilock_attr_map_shared(struct xfs_inode *); 397uint xfs_ilock_attr_map_shared(struct xfs_inode *);
398int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, umode_t,
399 xfs_nlink_t, xfs_dev_t, prid_t, int,
400 struct xfs_buf **, xfs_inode_t **);
401 398
402uint xfs_ip2xflags(struct xfs_inode *); 399uint xfs_ip2xflags(struct xfs_inode *);
403uint xfs_dic2xflags(struct xfs_dinode *);
404int xfs_ifree(struct xfs_trans *, xfs_inode_t *, 400int xfs_ifree(struct xfs_trans *, xfs_inode_t *,
405 struct xfs_bmap_free *); 401 struct xfs_bmap_free *);
406int xfs_itruncate_extents(struct xfs_trans **, struct xfs_inode *, 402int xfs_itruncate_extents(struct xfs_trans **, struct xfs_inode *,
@@ -411,7 +407,6 @@ void xfs_iunpin_wait(xfs_inode_t *);
411#define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount)) 407#define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount))
412 408
413int xfs_iflush(struct xfs_inode *, struct xfs_buf **); 409int xfs_iflush(struct xfs_inode *, struct xfs_buf **);
414void xfs_lock_inodes(xfs_inode_t **, int, uint);
415void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); 410void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint);
416 411
417xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip); 412xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
@@ -419,8 +414,6 @@ xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
419int xfs_dir_ialloc(struct xfs_trans **, struct xfs_inode *, umode_t, 414int xfs_dir_ialloc(struct xfs_trans **, struct xfs_inode *, umode_t,
420 xfs_nlink_t, xfs_dev_t, prid_t, int, 415 xfs_nlink_t, xfs_dev_t, prid_t, int,
421 struct xfs_inode **, int *); 416 struct xfs_inode **, int *);
422int xfs_droplink(struct xfs_trans *, struct xfs_inode *);
423int xfs_bumplink(struct xfs_trans *, struct xfs_inode *);
424 417
425/* from xfs_file.c */ 418/* from xfs_file.c */
426enum xfs_prealloc_flags { 419enum xfs_prealloc_flags {
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index bde02f1fba73..63dad9ea9016 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -788,7 +788,7 @@ xfs_log_mount_cancel(
788 * As far as I know, there weren't any dependencies on the old behaviour. 788 * As far as I know, there weren't any dependencies on the old behaviour.
789 */ 789 */
790 790
791int 791static int
792xfs_log_unmount_write(xfs_mount_t *mp) 792xfs_log_unmount_write(xfs_mount_t *mp)
793{ 793{
794 struct xlog *log = mp->m_log; 794 struct xlog *log = mp->m_log;
@@ -1036,7 +1036,7 @@ xfs_log_space_wake(
1036 * there's no point in running a dummy transaction at this point because we 1036 * there's no point in running a dummy transaction at this point because we
1037 * can't start trying to idle the log until both the CIL and AIL are empty. 1037 * can't start trying to idle the log until both the CIL and AIL are empty.
1038 */ 1038 */
1039int 1039static int
1040xfs_log_need_covered(xfs_mount_t *mp) 1040xfs_log_need_covered(xfs_mount_t *mp)
1041{ 1041{
1042 struct xlog *log = mp->m_log; 1042 struct xlog *log = mp->m_log;
@@ -1177,7 +1177,7 @@ xlog_space_left(
1177 * The log manager needs its own routine, in order to control what 1177 * The log manager needs its own routine, in order to control what
1178 * happens with the buffer after the write completes. 1178 * happens with the buffer after the write completes.
1179 */ 1179 */
1180void 1180static void
1181xlog_iodone(xfs_buf_t *bp) 1181xlog_iodone(xfs_buf_t *bp)
1182{ 1182{
1183 struct xlog_in_core *iclog = bp->b_fspriv; 1183 struct xlog_in_core *iclog = bp->b_fspriv;
@@ -1302,7 +1302,7 @@ xfs_log_work_queue(
1302 * disk. If there is nothing dirty, then we might need to cover the log to 1302 * disk. If there is nothing dirty, then we might need to cover the log to
1303 * indicate that the filesystem is idle. 1303 * indicate that the filesystem is idle.
1304 */ 1304 */
1305void 1305static void
1306xfs_log_worker( 1306xfs_log_worker(
1307 struct work_struct *work) 1307 struct work_struct *work)
1308{ 1308{
diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h
index 80ba0c047090..b5e71072fde5 100644
--- a/fs/xfs/xfs_log.h
+++ b/fs/xfs/xfs_log.h
@@ -163,12 +163,8 @@ int xfs_log_reserve(struct xfs_mount *mp,
163 __uint8_t clientid, 163 __uint8_t clientid,
164 bool permanent); 164 bool permanent);
165int xfs_log_regrant(struct xfs_mount *mp, struct xlog_ticket *tic); 165int xfs_log_regrant(struct xfs_mount *mp, struct xlog_ticket *tic);
166int xfs_log_unmount_write(struct xfs_mount *mp);
167void xfs_log_unmount(struct xfs_mount *mp); 166void xfs_log_unmount(struct xfs_mount *mp);
168int xfs_log_force_umount(struct xfs_mount *mp, int logerror); 167int xfs_log_force_umount(struct xfs_mount *mp, int logerror);
169int xfs_log_need_covered(struct xfs_mount *mp);
170
171void xlog_iodone(struct xfs_buf *);
172 168
173struct xlog_ticket *xfs_log_ticket_get(struct xlog_ticket *ticket); 169struct xlog_ticket *xfs_log_ticket_get(struct xlog_ticket *ticket);
174void xfs_log_ticket_put(struct xlog_ticket *ticket); 170void xfs_log_ticket_put(struct xlog_ticket *ticket);
@@ -178,7 +174,6 @@ void xfs_log_commit_cil(struct xfs_mount *mp, struct xfs_trans *tp,
178bool xfs_log_item_in_current_chkpt(struct xfs_log_item *lip); 174bool xfs_log_item_in_current_chkpt(struct xfs_log_item *lip);
179 175
180void xfs_log_work_queue(struct xfs_mount *mp); 176void xfs_log_work_queue(struct xfs_mount *mp);
181void xfs_log_worker(struct work_struct *work);
182void xfs_log_quiesce(struct xfs_mount *mp); 177void xfs_log_quiesce(struct xfs_mount *mp);
183bool xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t); 178bool xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t);
184 179
diff --git a/fs/xfs/xfs_rtalloc.h b/fs/xfs/xfs_rtalloc.h
index 76c0a4a9bb17..355dd9e1cb64 100644
--- a/fs/xfs/xfs_rtalloc.h
+++ b/fs/xfs/xfs_rtalloc.h
@@ -98,8 +98,6 @@ xfs_growfs_rt(
98/* 98/*
99 * From xfs_rtbitmap.c 99 * From xfs_rtbitmap.c
100 */ 100 */
101int xfs_rtbuf_get(struct xfs_mount *mp, struct xfs_trans *tp,
102 xfs_rtblock_t block, int issum, struct xfs_buf **bpp);
103int xfs_rtcheck_range(struct xfs_mount *mp, struct xfs_trans *tp, 101int xfs_rtcheck_range(struct xfs_mount *mp, struct xfs_trans *tp,
104 xfs_rtblock_t start, xfs_extlen_t len, int val, 102 xfs_rtblock_t start, xfs_extlen_t len, int val,
105 xfs_rtblock_t *new, int *stat); 103 xfs_rtblock_t *new, int *stat);
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 11ea5d51db56..4700f09e928f 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -546,7 +546,7 @@ xfs_showargs(
546 546
547 return 0; 547 return 0;
548} 548}
549__uint64_t 549static __uint64_t
550xfs_max_file_offset( 550xfs_max_file_offset(
551 unsigned int blockshift) 551 unsigned int blockshift)
552{ 552{
diff --git a/fs/xfs/xfs_super.h b/fs/xfs/xfs_super.h
index 2dfb1ce4585f..529bce9fc37e 100644
--- a/fs/xfs/xfs_super.h
+++ b/fs/xfs/xfs_super.h
@@ -61,8 +61,6 @@ struct xfs_mount;
61struct xfs_buftarg; 61struct xfs_buftarg;
62struct block_device; 62struct block_device;
63 63
64extern __uint64_t xfs_max_file_offset(unsigned int);
65
66extern void xfs_flush_inodes(struct xfs_mount *mp); 64extern void xfs_flush_inodes(struct xfs_mount *mp);
67extern void xfs_blkdev_issue_flush(struct xfs_buftarg *); 65extern void xfs_blkdev_issue_flush(struct xfs_buftarg *);
68extern xfs_agnumber_t xfs_set_inode_alloc(struct xfs_mount *, 66extern xfs_agnumber_t xfs_set_inode_alloc(struct xfs_mount *,