Skip to content

Commit 964f14a

Browse files
JunPiaoHWtorvalds
authored andcommitted
ocfs2: clean up some dead code
clean up some unused functions and parameters. Link: http://lkml.kernel.org/r/598A5E21.2080807@huawei.com Signed-off-by: Jun Piao <piaojun@huawei.com> Reviewed-by: Alex Chen <alex.chen@huawei.com> Cc: Mark Fasheh <mfasheh@versity.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Joseph Qi <jiangqi903@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 01ffb56 commit 964f14a

File tree

12 files changed

+19
-71
lines changed

12 files changed

+19
-71
lines changed

fs/ocfs2/alloc.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -955,8 +955,7 @@ int ocfs2_read_extent_block(struct ocfs2_caching_info *ci, u64 eb_blkno,
955955
/*
956956
* How many free extents have we got before we need more meta data?
957957
*/
958-
int ocfs2_num_free_extents(struct ocfs2_super *osb,
959-
struct ocfs2_extent_tree *et)
958+
int ocfs2_num_free_extents(struct ocfs2_extent_tree *et)
960959
{
961960
int retval;
962961
struct ocfs2_extent_list *el = NULL;
@@ -1933,14 +1932,12 @@ int ocfs2_find_leaf(struct ocfs2_caching_info *ci,
19331932
* the new changes.
19341933
*
19351934
* left_rec: the record on the left.
1936-
* left_child_el: is the child list pointed to by left_rec
19371935
* right_rec: the record to the right of left_rec
19381936
* right_child_el: is the child list pointed to by right_rec
19391937
*
19401938
* By definition, this only works on interior nodes.
19411939
*/
19421940
static void ocfs2_adjust_adjacent_records(struct ocfs2_extent_rec *left_rec,
1943-
struct ocfs2_extent_list *left_child_el,
19441941
struct ocfs2_extent_rec *right_rec,
19451942
struct ocfs2_extent_list *right_child_el)
19461943
{
@@ -2003,7 +2000,7 @@ static void ocfs2_adjust_root_records(struct ocfs2_extent_list *root_el,
20032000
*/
20042001
BUG_ON(i >= (le16_to_cpu(root_el->l_next_free_rec) - 1));
20052002

2006-
ocfs2_adjust_adjacent_records(&root_el->l_recs[i], left_el,
2003+
ocfs2_adjust_adjacent_records(&root_el->l_recs[i],
20072004
&root_el->l_recs[i + 1], right_el);
20082005
}
20092006

@@ -2060,8 +2057,7 @@ static void ocfs2_complete_edge_insert(handle_t *handle,
20602057
el = right_path->p_node[i].el;
20612058
right_rec = &el->l_recs[0];
20622059

2063-
ocfs2_adjust_adjacent_records(left_rec, left_el, right_rec,
2064-
right_el);
2060+
ocfs2_adjust_adjacent_records(left_rec, right_rec, right_el);
20652061

20662062
ocfs2_journal_dirty(handle, left_path->p_node[i].bh);
20672063
ocfs2_journal_dirty(handle, right_path->p_node[i].bh);
@@ -2509,7 +2505,7 @@ static int ocfs2_rotate_tree_right(handle_t *handle,
25092505

25102506
static int ocfs2_update_edge_lengths(handle_t *handle,
25112507
struct ocfs2_extent_tree *et,
2512-
int subtree_index, struct ocfs2_path *path)
2508+
struct ocfs2_path *path)
25132509
{
25142510
int i, idx, ret;
25152511
struct ocfs2_extent_rec *rec;
@@ -2755,8 +2751,7 @@ static int ocfs2_rotate_subtree_left(handle_t *handle,
27552751
if (del_right_subtree) {
27562752
ocfs2_unlink_subtree(handle, et, left_path, right_path,
27572753
subtree_index, dealloc);
2758-
ret = ocfs2_update_edge_lengths(handle, et, subtree_index,
2759-
left_path);
2754+
ret = ocfs2_update_edge_lengths(handle, et, left_path);
27602755
if (ret) {
27612756
mlog_errno(ret);
27622757
goto out;
@@ -3060,8 +3055,7 @@ static int ocfs2_remove_rightmost_path(handle_t *handle,
30603055

30613056
ocfs2_unlink_subtree(handle, et, left_path, path,
30623057
subtree_index, dealloc);
3063-
ret = ocfs2_update_edge_lengths(handle, et, subtree_index,
3064-
left_path);
3058+
ret = ocfs2_update_edge_lengths(handle, et, left_path);
30653059
if (ret) {
30663060
mlog_errno(ret);
30673061
goto out;
@@ -4790,7 +4784,7 @@ int ocfs2_add_clusters_in_btree(handle_t *handle,
47904784
if (mark_unwritten)
47914785
flags = OCFS2_EXT_UNWRITTEN;
47924786

4793-
free_extents = ocfs2_num_free_extents(osb, et);
4787+
free_extents = ocfs2_num_free_extents(et);
47944788
if (free_extents < 0) {
47954789
status = free_extents;
47964790
mlog_errno(status);
@@ -5668,7 +5662,7 @@ static int ocfs2_reserve_blocks_for_rec_trunc(struct inode *inode,
56685662

56695663
*ac = NULL;
56705664

5671-
num_free_extents = ocfs2_num_free_extents(osb, et);
5665+
num_free_extents = ocfs2_num_free_extents(et);
56725666
if (num_free_extents < 0) {
56735667
ret = num_free_extents;
56745668
mlog_errno(ret);

fs/ocfs2/alloc.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ int ocfs2_remove_btree_range(struct inode *inode,
144144
struct ocfs2_cached_dealloc_ctxt *dealloc,
145145
u64 refcount_loc, bool refcount_tree_locked);
146146

147-
int ocfs2_num_free_extents(struct ocfs2_super *osb,
148-
struct ocfs2_extent_tree *et);
147+
int ocfs2_num_free_extents(struct ocfs2_extent_tree *et);
149148

150149
/*
151150
* how many new metadata chunks would an allocation need at maximum?

fs/ocfs2/cluster/heartbeat.c

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,7 @@ static inline void o2hb_bio_wait_dec(struct o2hb_bio_wait_ctxt *wc,
505505
}
506506
}
507507

508-
static void o2hb_wait_on_io(struct o2hb_region *reg,
509-
struct o2hb_bio_wait_ctxt *wc)
508+
static void o2hb_wait_on_io(struct o2hb_bio_wait_ctxt *wc)
510509
{
511510
o2hb_bio_wait_dec(wc, 1);
512511
wait_for_completion(&wc->wc_io_complete);
@@ -608,7 +607,7 @@ static int o2hb_read_slots(struct o2hb_region *reg,
608607
status = 0;
609608

610609
bail_and_wait:
611-
o2hb_wait_on_io(reg, &wc);
610+
o2hb_wait_on_io(&wc);
612611
if (wc.wc_error && !status)
613612
status = wc.wc_error;
614613

@@ -1162,7 +1161,7 @@ static int o2hb_do_disk_heartbeat(struct o2hb_region *reg)
11621161
* before we can go to steady state. This ensures that
11631162
* people we find in our steady state have seen us.
11641163
*/
1165-
o2hb_wait_on_io(reg, &write_wc);
1164+
o2hb_wait_on_io(&write_wc);
11661165
if (write_wc.wc_error) {
11671166
/* Do not re-arm the write timeout on I/O error - we
11681167
* can't be sure that the new block ever made it to
@@ -1275,7 +1274,7 @@ static int o2hb_thread(void *data)
12751274
o2hb_prepare_block(reg, 0);
12761275
ret = o2hb_issue_node_write(reg, &write_wc);
12771276
if (ret == 0)
1278-
o2hb_wait_on_io(reg, &write_wc);
1277+
o2hb_wait_on_io(&write_wc);
12791278
else
12801279
mlog_errno(ret);
12811280
}
@@ -2576,22 +2575,6 @@ void o2hb_unregister_callback(const char *region_uuid,
25762575
}
25772576
EXPORT_SYMBOL_GPL(o2hb_unregister_callback);
25782577

2579-
int o2hb_check_node_heartbeating(u8 node_num)
2580-
{
2581-
unsigned long testing_map[BITS_TO_LONGS(O2NM_MAX_NODES)];
2582-
2583-
o2hb_fill_node_map(testing_map, sizeof(testing_map));
2584-
if (!test_bit(node_num, testing_map)) {
2585-
mlog(ML_HEARTBEAT,
2586-
"node (%u) does not have heartbeating enabled.\n",
2587-
node_num);
2588-
return 0;
2589-
}
2590-
2591-
return 1;
2592-
}
2593-
EXPORT_SYMBOL_GPL(o2hb_check_node_heartbeating);
2594-
25952578
int o2hb_check_node_heartbeating_no_sem(u8 node_num)
25962579
{
25972580
unsigned long testing_map[BITS_TO_LONGS(O2NM_MAX_NODES)];
@@ -2626,23 +2609,6 @@ int o2hb_check_node_heartbeating_from_callback(u8 node_num)
26262609
}
26272610
EXPORT_SYMBOL_GPL(o2hb_check_node_heartbeating_from_callback);
26282611

2629-
/* Makes sure our local node is configured with a node number, and is
2630-
* heartbeating. */
2631-
int o2hb_check_local_node_heartbeating(void)
2632-
{
2633-
u8 node_num;
2634-
2635-
/* if this node was set then we have networking */
2636-
node_num = o2nm_this_node();
2637-
if (node_num == O2NM_MAX_NODES) {
2638-
mlog(ML_HEARTBEAT, "this node has not been configured.\n");
2639-
return 0;
2640-
}
2641-
2642-
return o2hb_check_node_heartbeating(node_num);
2643-
}
2644-
EXPORT_SYMBOL_GPL(o2hb_check_local_node_heartbeating);
2645-
26462612
/*
26472613
* this is just a hack until we get the plumbing which flips file systems
26482614
* read only and drops the hb ref instead of killing the node dead.

fs/ocfs2/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3249,7 +3249,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
32493249
spin_unlock(&OCFS2_I(dir)->ip_lock);
32503250
ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(dir),
32513251
parent_fe_bh);
3252-
num_free_extents = ocfs2_num_free_extents(osb, &et);
3252+
num_free_extents = ocfs2_num_free_extents(&et);
32533253
if (num_free_extents < 0) {
32543254
status = num_free_extents;
32553255
mlog_errno(status);

fs/ocfs2/file.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -713,13 +713,6 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
713713
return status;
714714
}
715715

716-
int ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
717-
u32 clusters_to_add, int mark_unwritten)
718-
{
719-
return __ocfs2_extend_allocation(inode, logical_start,
720-
clusters_to_add, mark_unwritten);
721-
}
722-
723716
/*
724717
* While a write will already be ordering the data, a truncate will not.
725718
* Thus, we need to explicitly order the zeroed pages.

fs/ocfs2/journal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,6 @@ void ocfs2_complete_mount_recovery(struct ocfs2_super *osb)
13481348
ocfs2_schedule_truncate_log_flush(osb, 0);
13491349

13501350
osb->local_alloc_copy = NULL;
1351-
osb->dirty = 0;
13521351

13531352
/* queue to recover orphan slots for all offline slots */
13541353
ocfs2_replay_map_set_state(osb, REPLAY_NEEDED);

fs/ocfs2/move_extents.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int ocfs2_lock_allocators_move_extents(struct inode *inode,
175175
unsigned int max_recs_needed = 2 * extents_to_split + clusters_to_move;
176176
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
177177

178-
num_free_extents = ocfs2_num_free_extents(osb, et);
178+
num_free_extents = ocfs2_num_free_extents(et);
179179
if (num_free_extents < 0) {
180180
ret = num_free_extents;
181181
mlog_errno(ret);

fs/ocfs2/ocfs2.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ struct ocfs2_super
320320
u64 system_dir_blkno;
321321
u64 bitmap_blkno;
322322
u32 bitmap_cpg;
323-
u8 *uuid;
324323
char *uuid_str;
325324
u32 uuid_hash;
326325
u8 *vol_label;
@@ -388,9 +387,8 @@ struct ocfs2_super
388387
unsigned int osb_resv_level;
389388
unsigned int osb_dir_resv_level;
390389

391-
/* Next three fields are for local node slot recovery during
390+
/* Next two fields are for local node slot recovery during
392391
* mount. */
393-
int dirty;
394392
struct ocfs2_dinode *local_alloc_copy;
395393
struct ocfs2_quota_recovery *quota_rec;
396394

fs/ocfs2/refcounttree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2851,7 +2851,7 @@ static int ocfs2_lock_refcount_allocators(struct super_block *sb,
28512851
int *credits)
28522852
{
28532853
int ret = 0, meta_add = 0;
2854-
int num_free_extents = ocfs2_num_free_extents(OCFS2_SB(sb), et);
2854+
int num_free_extents = ocfs2_num_free_extents(et);
28552855

28562856
if (num_free_extents < 0) {
28572857
ret = num_free_extents;

fs/ocfs2/suballoc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2700,7 +2700,7 @@ int ocfs2_lock_allocators(struct inode *inode,
27002700

27012701
BUG_ON(clusters_to_add != 0 && data_ac == NULL);
27022702

2703-
num_free_extents = ocfs2_num_free_extents(osb, et);
2703+
num_free_extents = ocfs2_num_free_extents(et);
27042704
if (num_free_extents < 0) {
27052705
ret = num_free_extents;
27062706
mlog_errno(ret);

0 commit comments

Comments
 (0)