提交 0d5a75e9 编写于 作者: E Eric Sandeen 提交者: Dave Chinner

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: NEric Sandeen <sandeen@sandeen.net>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 0c871f9a
...@@ -84,7 +84,7 @@ xfs_alloc_lookup_ge( ...@@ -84,7 +84,7 @@ xfs_alloc_lookup_ge(
* Lookup the first record less than or equal to [bno, len] * Lookup the first record less than or equal to [bno, len]
* in the btree given by cur. * in the btree given by cur.
*/ */
int /* error */ static int /* error */
xfs_alloc_lookup_le( xfs_alloc_lookup_le(
struct xfs_btree_cur *cur, /* btree cursor */ struct xfs_btree_cur *cur, /* btree cursor */
xfs_agblock_t bno, /* starting block of extent */ xfs_agblock_t bno, /* starting block of extent */
......
...@@ -212,13 +212,6 @@ xfs_free_extent( ...@@ -212,13 +212,6 @@ xfs_free_extent(
xfs_fsblock_t bno, /* starting block number of extent */ xfs_fsblock_t bno, /* starting block number of extent */
xfs_extlen_t len); /* length of extent */ xfs_extlen_t len); /* length of extent */
int /* error */
xfs_alloc_lookup_le(
struct xfs_btree_cur *cur, /* btree cursor */
xfs_agblock_t bno, /* starting block of extent */
xfs_extlen_t len, /* length of extent */
int *stat); /* success/failure */
int /* error */ int /* error */
xfs_alloc_lookup_ge( xfs_alloc_lookup_ge(
struct xfs_btree_cur *cur, /* btree cursor */ struct xfs_btree_cur *cur, /* btree cursor */
......
...@@ -50,7 +50,6 @@ int xfs_attr_shortform_lookup(struct xfs_da_args *args); ...@@ -50,7 +50,6 @@ int xfs_attr_shortform_lookup(struct xfs_da_args *args);
int xfs_attr_shortform_getvalue(struct xfs_da_args *args); int xfs_attr_shortform_getvalue(struct xfs_da_args *args);
int xfs_attr_shortform_to_leaf(struct xfs_da_args *args); int xfs_attr_shortform_to_leaf(struct xfs_da_args *args);
int xfs_attr_shortform_remove(struct xfs_da_args *args); int xfs_attr_shortform_remove(struct xfs_da_args *args);
int xfs_attr_shortform_list(struct xfs_attr_list_context *context);
int xfs_attr_shortform_allfit(struct xfs_buf *bp, struct xfs_inode *dp); int xfs_attr_shortform_allfit(struct xfs_buf *bp, struct xfs_inode *dp);
int xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes); int xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes);
void xfs_attr_fork_remove(struct xfs_inode *ip, struct xfs_trans *tp); void 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); ...@@ -88,8 +87,6 @@ int xfs_attr3_leaf_toosmall(struct xfs_da_state *state, int *retval);
void xfs_attr3_leaf_unbalance(struct xfs_da_state *state, void xfs_attr3_leaf_unbalance(struct xfs_da_state *state,
struct xfs_da_state_blk *drop_blk, struct xfs_da_state_blk *drop_blk,
struct xfs_da_state_blk *save_blk); struct xfs_da_state_blk *save_blk);
int xfs_attr3_root_inactive(struct xfs_trans **trans, struct xfs_inode *dp);
/* /*
* Utility routines. * Utility routines.
*/ */
......
...@@ -70,7 +70,7 @@ const struct xfs_buf_ops xfs_rtbuf_ops = { ...@@ -70,7 +70,7 @@ const struct xfs_buf_ops xfs_rtbuf_ops = {
* Get a buffer for the bitmap or summary file block specified. * Get a buffer for the bitmap or summary file block specified.
* The buffer is returned read and locked. * The buffer is returned read and locked.
*/ */
int static int
xfs_rtbuf_get( xfs_rtbuf_get(
xfs_mount_t *mp, /* file system mount structure */ xfs_mount_t *mp, /* file system mount structure */
xfs_trans_t *tp, /* transaction pointer */ xfs_trans_t *tp, /* transaction pointer */
......
...@@ -322,7 +322,7 @@ xfs_attr3_node_inactive( ...@@ -322,7 +322,7 @@ xfs_attr3_node_inactive(
* Recurse (gasp!) through the attribute nodes until we find leaves. * Recurse (gasp!) through the attribute nodes until we find leaves.
* We're doing a depth-first traversal in order to invalidate everything. * We're doing a depth-first traversal in order to invalidate everything.
*/ */
int static int
xfs_attr3_root_inactive( xfs_attr3_root_inactive(
struct xfs_trans **trans, struct xfs_trans **trans,
struct xfs_inode *dp) struct xfs_inode *dp)
......
...@@ -65,7 +65,7 @@ xfs_attr_shortform_compare(const void *a, const void *b) ...@@ -65,7 +65,7 @@ xfs_attr_shortform_compare(const void *a, const void *b)
* we have to calculate each entries' hashvalue and sort them before * we have to calculate each entries' hashvalue and sort them before
* we can begin returning them to the user. * we can begin returning them to the user.
*/ */
int static int
xfs_attr_shortform_list(xfs_attr_list_context_t *context) xfs_attr_shortform_list(xfs_attr_list_context_t *context)
{ {
attrlist_cursor_kern_t *cursor; attrlist_cursor_kern_t *cursor;
......
...@@ -407,7 +407,7 @@ xfs_bmap_count_tree( ...@@ -407,7 +407,7 @@ xfs_bmap_count_tree(
/* /*
* Count fsblocks of the given fork. * Count fsblocks of the given fork.
*/ */
int /* error */ static int /* error */
xfs_bmap_count_blocks( xfs_bmap_count_blocks(
xfs_trans_t *tp, /* transaction pointer */ xfs_trans_t *tp, /* transaction pointer */
xfs_inode_t *ip, /* incore inode */ xfs_inode_t *ip, /* incore inode */
......
...@@ -31,8 +31,6 @@ struct xfs_bmalloca; ...@@ -31,8 +31,6 @@ struct xfs_bmalloca;
int xfs_bmap_rtalloc(struct xfs_bmalloca *ap); int xfs_bmap_rtalloc(struct xfs_bmalloca *ap);
int xfs_bmap_eof(struct xfs_inode *ip, xfs_fileoff_t endoff, int xfs_bmap_eof(struct xfs_inode *ip, xfs_fileoff_t endoff,
int whichfork, int *eof); int whichfork, int *eof);
int xfs_bmap_count_blocks(struct xfs_trans *tp, struct xfs_inode *ip,
int whichfork, int *count);
int xfs_bmap_punch_delalloc_range(struct xfs_inode *ip, int xfs_bmap_punch_delalloc_range(struct xfs_inode *ip,
xfs_fileoff_t start_fsb, xfs_fileoff_t length); xfs_fileoff_t start_fsb, xfs_fileoff_t length);
......
...@@ -431,7 +431,7 @@ xfs_lock_inumorder(int lock_mode, int subclass) ...@@ -431,7 +431,7 @@ xfs_lock_inumorder(int lock_mode, int subclass)
* lock more than one at a time, lockdep will report false positives saying we * lock more than one at a time, lockdep will report false positives saying we
* have violated locking orders. * have violated locking orders.
*/ */
void static void
xfs_lock_inodes( xfs_lock_inodes(
xfs_inode_t **ips, xfs_inode_t **ips,
int inodes, int inodes,
...@@ -667,14 +667,6 @@ xfs_ip2xflags( ...@@ -667,14 +667,6 @@ xfs_ip2xflags(
return _xfs_dic2xflags(dic->di_flags, dic->di_flags2, XFS_IFORK_Q(ip)); return _xfs_dic2xflags(dic->di_flags, dic->di_flags2, XFS_IFORK_Q(ip));
} }
uint
xfs_dic2xflags(
struct xfs_dinode *dip)
{
return _xfs_dic2xflags(be16_to_cpu(dip->di_flags),
be64_to_cpu(dip->di_flags2), XFS_DFORK_Q(dip));
}
/* /*
* Lookups up an inode from "name". If ci_name is not NULL, then a CI match * Lookups up an inode from "name". If ci_name is not NULL, then a CI match
* is allowed, otherwise it has to be an exact match. If a CI match is found, * is allowed, otherwise it has to be an exact match. If a CI match is found,
...@@ -748,7 +740,7 @@ xfs_lookup( ...@@ -748,7 +740,7 @@ xfs_lookup(
* are not linked into the directory structure - they are attached * are not linked into the directory structure - they are attached
* directly to the superblock - and so have no parent. * directly to the superblock - and so have no parent.
*/ */
int static int
xfs_ialloc( xfs_ialloc(
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_inode_t *pip, xfs_inode_t *pip,
...@@ -1085,7 +1077,7 @@ xfs_dir_ialloc( ...@@ -1085,7 +1077,7 @@ xfs_dir_ialloc(
* link count to go to zero, move the inode to AGI unlinked list so that it can * link count to go to zero, move the inode to AGI unlinked list so that it can
* be freed when the last active reference goes away via xfs_inactive(). * be freed when the last active reference goes away via xfs_inactive().
*/ */
int /* error */ static int /* error */
xfs_droplink( xfs_droplink(
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_inode_t *ip) xfs_inode_t *ip)
...@@ -1104,7 +1096,7 @@ xfs_droplink( ...@@ -1104,7 +1096,7 @@ xfs_droplink(
/* /*
* Increment the link count on an inode & log the change. * Increment the link count on an inode & log the change.
*/ */
int static int
xfs_bumplink( xfs_bumplink(
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_inode_t *ip) xfs_inode_t *ip)
......
...@@ -395,12 +395,8 @@ void xfs_ilock_demote(xfs_inode_t *, uint); ...@@ -395,12 +395,8 @@ void xfs_ilock_demote(xfs_inode_t *, uint);
int xfs_isilocked(xfs_inode_t *, uint); int xfs_isilocked(xfs_inode_t *, uint);
uint xfs_ilock_data_map_shared(struct xfs_inode *); uint xfs_ilock_data_map_shared(struct xfs_inode *);
uint xfs_ilock_attr_map_shared(struct xfs_inode *); uint xfs_ilock_attr_map_shared(struct xfs_inode *);
int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, umode_t,
xfs_nlink_t, xfs_dev_t, prid_t, int,
struct xfs_buf **, xfs_inode_t **);
uint xfs_ip2xflags(struct xfs_inode *); uint xfs_ip2xflags(struct xfs_inode *);
uint xfs_dic2xflags(struct xfs_dinode *);
int xfs_ifree(struct xfs_trans *, xfs_inode_t *, int xfs_ifree(struct xfs_trans *, xfs_inode_t *,
struct xfs_bmap_free *); struct xfs_bmap_free *);
int xfs_itruncate_extents(struct xfs_trans **, struct xfs_inode *, int xfs_itruncate_extents(struct xfs_trans **, struct xfs_inode *,
...@@ -411,7 +407,6 @@ void xfs_iunpin_wait(xfs_inode_t *); ...@@ -411,7 +407,6 @@ void xfs_iunpin_wait(xfs_inode_t *);
#define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount)) #define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount))
int xfs_iflush(struct xfs_inode *, struct xfs_buf **); int xfs_iflush(struct xfs_inode *, struct xfs_buf **);
void xfs_lock_inodes(xfs_inode_t **, int, uint);
void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint);
xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip); xfs_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); ...@@ -419,8 +414,6 @@ xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
int xfs_dir_ialloc(struct xfs_trans **, struct xfs_inode *, umode_t, int xfs_dir_ialloc(struct xfs_trans **, struct xfs_inode *, umode_t,
xfs_nlink_t, xfs_dev_t, prid_t, int, xfs_nlink_t, xfs_dev_t, prid_t, int,
struct xfs_inode **, int *); struct xfs_inode **, int *);
int xfs_droplink(struct xfs_trans *, struct xfs_inode *);
int xfs_bumplink(struct xfs_trans *, struct xfs_inode *);
/* from xfs_file.c */ /* from xfs_file.c */
enum xfs_prealloc_flags { enum xfs_prealloc_flags {
......
...@@ -788,7 +788,7 @@ xfs_log_mount_cancel( ...@@ -788,7 +788,7 @@ xfs_log_mount_cancel(
* As far as I know, there weren't any dependencies on the old behaviour. * As far as I know, there weren't any dependencies on the old behaviour.
*/ */
int static int
xfs_log_unmount_write(xfs_mount_t *mp) xfs_log_unmount_write(xfs_mount_t *mp)
{ {
struct xlog *log = mp->m_log; struct xlog *log = mp->m_log;
...@@ -1036,7 +1036,7 @@ xfs_log_space_wake( ...@@ -1036,7 +1036,7 @@ xfs_log_space_wake(
* there's no point in running a dummy transaction at this point because we * there's no point in running a dummy transaction at this point because we
* can't start trying to idle the log until both the CIL and AIL are empty. * can't start trying to idle the log until both the CIL and AIL are empty.
*/ */
int static int
xfs_log_need_covered(xfs_mount_t *mp) xfs_log_need_covered(xfs_mount_t *mp)
{ {
struct xlog *log = mp->m_log; struct xlog *log = mp->m_log;
...@@ -1177,7 +1177,7 @@ xlog_space_left( ...@@ -1177,7 +1177,7 @@ xlog_space_left(
* The log manager needs its own routine, in order to control what * The log manager needs its own routine, in order to control what
* happens with the buffer after the write completes. * happens with the buffer after the write completes.
*/ */
void static void
xlog_iodone(xfs_buf_t *bp) xlog_iodone(xfs_buf_t *bp)
{ {
struct xlog_in_core *iclog = bp->b_fspriv; struct xlog_in_core *iclog = bp->b_fspriv;
...@@ -1302,7 +1302,7 @@ xfs_log_work_queue( ...@@ -1302,7 +1302,7 @@ xfs_log_work_queue(
* disk. If there is nothing dirty, then we might need to cover the log to * disk. If there is nothing dirty, then we might need to cover the log to
* indicate that the filesystem is idle. * indicate that the filesystem is idle.
*/ */
void static void
xfs_log_worker( xfs_log_worker(
struct work_struct *work) struct work_struct *work)
{ {
......
...@@ -163,12 +163,8 @@ int xfs_log_reserve(struct xfs_mount *mp, ...@@ -163,12 +163,8 @@ int xfs_log_reserve(struct xfs_mount *mp,
__uint8_t clientid, __uint8_t clientid,
bool permanent); bool permanent);
int xfs_log_regrant(struct xfs_mount *mp, struct xlog_ticket *tic); int xfs_log_regrant(struct xfs_mount *mp, struct xlog_ticket *tic);
int xfs_log_unmount_write(struct xfs_mount *mp);
void xfs_log_unmount(struct xfs_mount *mp); void xfs_log_unmount(struct xfs_mount *mp);
int xfs_log_force_umount(struct xfs_mount *mp, int logerror); int xfs_log_force_umount(struct xfs_mount *mp, int logerror);
int xfs_log_need_covered(struct xfs_mount *mp);
void xlog_iodone(struct xfs_buf *);
struct xlog_ticket *xfs_log_ticket_get(struct xlog_ticket *ticket); struct xlog_ticket *xfs_log_ticket_get(struct xlog_ticket *ticket);
void xfs_log_ticket_put(struct xlog_ticket *ticket); void 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, ...@@ -178,7 +174,6 @@ void xfs_log_commit_cil(struct xfs_mount *mp, struct xfs_trans *tp,
bool xfs_log_item_in_current_chkpt(struct xfs_log_item *lip); bool xfs_log_item_in_current_chkpt(struct xfs_log_item *lip);
void xfs_log_work_queue(struct xfs_mount *mp); void xfs_log_work_queue(struct xfs_mount *mp);
void xfs_log_worker(struct work_struct *work);
void xfs_log_quiesce(struct xfs_mount *mp); void xfs_log_quiesce(struct xfs_mount *mp);
bool xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t); bool xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t);
......
...@@ -98,8 +98,6 @@ xfs_growfs_rt( ...@@ -98,8 +98,6 @@ xfs_growfs_rt(
/* /*
* From xfs_rtbitmap.c * From xfs_rtbitmap.c
*/ */
int xfs_rtbuf_get(struct xfs_mount *mp, struct xfs_trans *tp,
xfs_rtblock_t block, int issum, struct xfs_buf **bpp);
int xfs_rtcheck_range(struct xfs_mount *mp, struct xfs_trans *tp, int xfs_rtcheck_range(struct xfs_mount *mp, struct xfs_trans *tp,
xfs_rtblock_t start, xfs_extlen_t len, int val, xfs_rtblock_t start, xfs_extlen_t len, int val,
xfs_rtblock_t *new, int *stat); xfs_rtblock_t *new, int *stat);
......
...@@ -546,7 +546,7 @@ xfs_showargs( ...@@ -546,7 +546,7 @@ xfs_showargs(
return 0; return 0;
} }
__uint64_t static __uint64_t
xfs_max_file_offset( xfs_max_file_offset(
unsigned int blockshift) unsigned int blockshift)
{ {
......
...@@ -61,8 +61,6 @@ struct xfs_mount; ...@@ -61,8 +61,6 @@ struct xfs_mount;
struct xfs_buftarg; struct xfs_buftarg;
struct block_device; struct block_device;
extern __uint64_t xfs_max_file_offset(unsigned int);
extern void xfs_flush_inodes(struct xfs_mount *mp); extern void xfs_flush_inodes(struct xfs_mount *mp);
extern void xfs_blkdev_issue_flush(struct xfs_buftarg *); extern void xfs_blkdev_issue_flush(struct xfs_buftarg *);
extern xfs_agnumber_t xfs_set_inode_alloc(struct xfs_mount *, extern xfs_agnumber_t xfs_set_inode_alloc(struct xfs_mount *,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册