Skip to content

Commit 182608c

Browse files
committed
btrfs: remove old unused commented out code
Remove code which has been #if0-ed out for a very long time and does not seem to be related to current codebase anymore. Signed-off-by: David Sterba <dsterba@suse.cz>
1 parent f2a97a9 commit 182608c

5 files changed

Lines changed: 1 addition & 2071 deletions

File tree

‎fs/btrfs/delayed-ref.c‎

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -709,79 +709,3 @@ btrfs_find_delayed_ref_head(struct btrfs_trans_handle *trans, u64 bytenr)
709709
return btrfs_delayed_node_to_head(ref);
710710
return NULL;
711711
}
712-
713-
/*
714-
* add a delayed ref to the tree. This does all of the accounting required
715-
* to make sure the delayed ref is eventually processed before this
716-
* transaction commits.
717-
*
718-
* The main point of this call is to add and remove a backreference in a single
719-
* shot, taking the lock only once, and only searching for the head node once.
720-
*
721-
* It is the same as doing a ref add and delete in two separate calls.
722-
*/
723-
#if 0
724-
int btrfs_update_delayed_ref(struct btrfs_trans_handle *trans,
725-
u64 bytenr, u64 num_bytes, u64 orig_parent,
726-
u64 parent, u64 orig_ref_root, u64 ref_root,
727-
u64 orig_ref_generation, u64 ref_generation,
728-
u64 owner_objectid, int pin)
729-
{
730-
struct btrfs_delayed_ref *ref;
731-
struct btrfs_delayed_ref *old_ref;
732-
struct btrfs_delayed_ref_head *head_ref;
733-
struct btrfs_delayed_ref_root *delayed_refs;
734-
int ret;
735-
736-
ref = kmalloc(sizeof(*ref), GFP_NOFS);
737-
if (!ref)
738-
return -ENOMEM;
739-
740-
old_ref = kmalloc(sizeof(*old_ref), GFP_NOFS);
741-
if (!old_ref) {
742-
kfree(ref);
743-
return -ENOMEM;
744-
}
745-
746-
/*
747-
* the parent = 0 case comes from cases where we don't actually
748-
* know the parent yet. It will get updated later via a add/drop
749-
* pair.
750-
*/
751-
if (parent == 0)
752-
parent = bytenr;
753-
if (orig_parent == 0)
754-
orig_parent = bytenr;
755-
756-
head_ref = kmalloc(sizeof(*head_ref), GFP_NOFS);
757-
if (!head_ref) {
758-
kfree(ref);
759-
kfree(old_ref);
760-
return -ENOMEM;
761-
}
762-
delayed_refs = &trans->transaction->delayed_refs;
763-
spin_lock(&delayed_refs->lock);
764-
765-
/*
766-
* insert both the head node and the new ref without dropping
767-
* the spin lock
768-
*/
769-
ret = __btrfs_add_delayed_ref(trans, &head_ref->node, bytenr, num_bytes,
770-
(u64)-1, 0, 0, 0,
771-
BTRFS_UPDATE_DELAYED_HEAD, 0);
772-
BUG_ON(ret);
773-
774-
ret = __btrfs_add_delayed_ref(trans, &ref->node, bytenr, num_bytes,
775-
parent, ref_root, ref_generation,
776-
owner_objectid, BTRFS_ADD_DELAYED_REF, 0);
777-
BUG_ON(ret);
778-
779-
ret = __btrfs_add_delayed_ref(trans, &old_ref->node, bytenr, num_bytes,
780-
orig_parent, orig_ref_root,
781-
orig_ref_generation, owner_objectid,
782-
BTRFS_DROP_DELAYED_REF, pin);
783-
BUG_ON(ret);
784-
spin_unlock(&delayed_refs->lock);
785-
return 0;
786-
}
787-
#endif

‎fs/btrfs/disk-io.c‎

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,35 +1348,6 @@ struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info,
13481348
return ERR_PTR(ret);
13491349
}
13501350

1351-
#if 0
1352-
struct btrfs_root *root;
1353-
int ret;
1354-
1355-
root = btrfs_read_fs_root_no_name(fs_info, location);
1356-
if (!root)
1357-
return NULL;
1358-
1359-
if (root->in_sysfs)
1360-
return root;
1361-
1362-
ret = btrfs_set_root_name(root, name, namelen);
1363-
if (ret) {
1364-
free_extent_buffer(root->node);
1365-
kfree(root);
1366-
return ERR_PTR(ret);
1367-
}
1368-
1369-
ret = btrfs_sysfs_add_root(root);
1370-
if (ret) {
1371-
free_extent_buffer(root->node);
1372-
kfree(root->name);
1373-
kfree(root);
1374-
return ERR_PTR(ret);
1375-
}
1376-
root->in_sysfs = 1;
1377-
return root;
1378-
#endif
1379-
13801351
static int btrfs_congested_fn(void *congested_data, int bdi_bits)
13811352
{
13821353
struct btrfs_fs_info *info = (struct btrfs_fs_info *)congested_data;

0 commit comments

Comments
 (0)