All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Btrfs: remove unused function btrfs_get_inode_ref_index()
@ 2013-11-12 11:32 Wang Shilong
  2013-11-12 11:32 ` [PATCH 2/2] Btrfs: remove dead codes from ctree.h Wang Shilong
  2013-11-12 16:02 ` [PATCH 1/2] Btrfs: remove unused function btrfs_get_inode_ref_index() David Sterba
  0 siblings, 2 replies; 5+ messages in thread
From: Wang Shilong @ 2013-11-12 11:32 UTC (permalink / raw)
  To: linux-btrfs

Since commit d52be818e6(Btrfs: simplify unlink reservations),
btrfs_get_inode_ref_index() is no loner called.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
 fs/btrfs/ctree.h      |  6 -----
 fs/btrfs/inode-item.c | 65 ---------------------------------------------------
 2 files changed, 71 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index f013a31..7038acc 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3570,12 +3570,6 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans,
 			   struct btrfs_root *root,
 			   const char *name, int name_len,
 			   u64 inode_objectid, u64 ref_objectid, u64 *index);
-int btrfs_get_inode_ref_index(struct btrfs_trans_handle *trans,
-			      struct btrfs_root *root,
-			      struct btrfs_path *path,
-			      const char *name, int name_len,
-			      u64 inode_objectid, u64 ref_objectid, int mod,
-			      u64 *ret_index);
 int btrfs_insert_empty_inode(struct btrfs_trans_handle *trans,
 			     struct btrfs_root *root,
 			     struct btrfs_path *path, u64 objectid);
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index ec82fae..2be38df 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -91,32 +91,6 @@ int btrfs_find_name_in_ext_backref(struct btrfs_path *path, u64 ref_objectid,
 	return 0;
 }
 
-static struct btrfs_inode_ref *
-btrfs_lookup_inode_ref(struct btrfs_trans_handle *trans,
-		       struct btrfs_root *root,
-		       struct btrfs_path *path,
-		       const char *name, int name_len,
-		       u64 inode_objectid, u64 ref_objectid, int ins_len,
-		       int cow)
-{
-	int ret;
-	struct btrfs_key key;
-	struct btrfs_inode_ref *ref;
-
-	key.objectid = inode_objectid;
-	key.type = BTRFS_INODE_REF_KEY;
-	key.offset = ref_objectid;
-
-	ret = btrfs_search_slot(trans, root, &key, path, ins_len, cow);
-	if (ret < 0)
-		return ERR_PTR(ret);
-	if (ret > 0)
-		return NULL;
-	if (!find_name_in_backref(path, name, name_len, &ref))
-		return NULL;
-	return ref;
-}
-
 /* Returns NULL if no extref found */
 struct btrfs_inode_extref *
 btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans,
@@ -144,45 +118,6 @@ btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans,
 	return extref;
 }
 
-int btrfs_get_inode_ref_index(struct btrfs_trans_handle *trans,
-			      struct btrfs_root *root,
-			      struct btrfs_path *path,
-			      const char *name, int name_len,
-			      u64 inode_objectid, u64 ref_objectid, int mod,
-			      u64 *ret_index)
-{
-	struct btrfs_inode_ref *ref;
-	struct btrfs_inode_extref *extref;
-	int ins_len = mod < 0 ? -1 : 0;
-	int cow = mod != 0;
-
-	ref = btrfs_lookup_inode_ref(trans, root, path, name, name_len,
-				     inode_objectid, ref_objectid, ins_len,
-				     cow);
-	if (IS_ERR(ref))
-		return PTR_ERR(ref);
-
-	if (ref != NULL) {
-		*ret_index = btrfs_inode_ref_index(path->nodes[0], ref);
-		return 0;
-	}
-
-	btrfs_release_path(path);
-
-	extref = btrfs_lookup_inode_extref(trans, root, path, name,
-					   name_len, inode_objectid,
-					   ref_objectid, ins_len, cow);
-	if (IS_ERR(extref))
-		return PTR_ERR(extref);
-
-	if (extref) {
-		*ret_index = btrfs_inode_extref_index(path->nodes[0], extref);
-		return 0;
-	}
-
-	return -ENOENT;
-}
-
 static int btrfs_del_inode_extref(struct btrfs_trans_handle *trans,
 				  struct btrfs_root *root,
 				  const char *name, int name_len,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] Btrfs: remove dead codes from ctree.h
  2013-11-12 11:32 [PATCH 1/2] Btrfs: remove unused function btrfs_get_inode_ref_index() Wang Shilong
@ 2013-11-12 11:32 ` Wang Shilong
  2013-11-12 16:02 ` [PATCH 1/2] Btrfs: remove unused function btrfs_get_inode_ref_index() David Sterba
  1 sibling, 0 replies; 5+ messages in thread
From: Wang Shilong @ 2013-11-12 11:32 UTC (permalink / raw)
  To: linux-btrfs

These two functions are only stated but undefined.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
 fs/btrfs/ctree.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 7038acc..254209e 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3614,9 +3614,6 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
 			   struct btrfs_ordered_sum *sums);
 int btrfs_csum_one_bio(struct btrfs_root *root, struct inode *inode,
 		       struct bio *bio, u64 file_start, int contig);
-int btrfs_csum_truncate(struct btrfs_trans_handle *trans,
-			struct btrfs_root *root, struct btrfs_path *path,
-			u64 isize);
 int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
 			     struct list_head *list, int search_commit);
 /* inode.c */
@@ -3745,9 +3742,6 @@ void btrfs_cleanup_defrag_inodes(struct btrfs_fs_info *fs_info);
 int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync);
 void btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end,
 			     int skip_pinned);
-int btrfs_replace_extent_cache(struct inode *inode, struct extent_map *replace,
-			       u64 start, u64 end, int skip_pinned,
-			       int modified);
 extern const struct file_operations btrfs_file_operations;
 int __btrfs_drop_extents(struct btrfs_trans_handle *trans,
 			 struct btrfs_root *root, struct inode *inode,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] Btrfs: remove unused function btrfs_get_inode_ref_index()
  2013-11-12 11:32 [PATCH 1/2] Btrfs: remove unused function btrfs_get_inode_ref_index() Wang Shilong
  2013-11-12 11:32 ` [PATCH 2/2] Btrfs: remove dead codes from ctree.h Wang Shilong
@ 2013-11-12 16:02 ` David Sterba
  2013-11-13  1:30   ` Wang Shilong
  2013-11-13  9:46   ` [PATCH v2 1/2] btrfs: cleanup: removed unused 'btrfs_get_inode_ref_index' Wang Shilong
  1 sibling, 2 replies; 5+ messages in thread
From: David Sterba @ 2013-11-12 16:02 UTC (permalink / raw)
  To: Wang Shilong; +Cc: linux-btrfs

On Tue, Nov 12, 2013 at 07:32:03PM +0800, Wang Shilong wrote:
> Since commit d52be818e6(Btrfs: simplify unlink reservations),
> btrfs_get_inode_ref_index() is no loner called.
> 
> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>

http://www.spinics.net/lists/linux-btrfs/msg26646.html
Reviewed-by: David Sterba <dsterba@suse.cz>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] Btrfs: remove unused function btrfs_get_inode_ref_index()
  2013-11-12 16:02 ` [PATCH 1/2] Btrfs: remove unused function btrfs_get_inode_ref_index() David Sterba
@ 2013-11-13  1:30   ` Wang Shilong
  2013-11-13  9:46   ` [PATCH v2 1/2] btrfs: cleanup: removed unused 'btrfs_get_inode_ref_index' Wang Shilong
  1 sibling, 0 replies; 5+ messages in thread
From: Wang Shilong @ 2013-11-13  1:30 UTC (permalink / raw)
  To: dsterba, linux-btrfs

On 11/13/2013 12:02 AM, David Sterba wrote:
> On Tue, Nov 12, 2013 at 07:32:03PM +0800, Wang Shilong wrote:
>> Since commit d52be818e6(Btrfs: simplify unlink reservations),
>> btrfs_get_inode_ref_index() is no loner called.
>>
>> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
> http://www.spinics.net/lists/linux-btrfs/msg26646.html
Oops, i didn't notice there has been patch in flight, will resend it
with original author.

Thanks,
Wang
> Reviewed-by: David Sterba <dsterba@suse.cz>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] btrfs: cleanup: removed unused 'btrfs_get_inode_ref_index'
  2013-11-12 16:02 ` [PATCH 1/2] Btrfs: remove unused function btrfs_get_inode_ref_index() David Sterba
  2013-11-13  1:30   ` Wang Shilong
@ 2013-11-13  9:46   ` Wang Shilong
  1 sibling, 0 replies; 5+ messages in thread
From: Wang Shilong @ 2013-11-13  9:46 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Wang Shilong, Sergei Trofimovich

From: Sergei Trofimovich <slyfox@gentoo.org>

Found by uselex.rb:
> btrfs_get_inode_ref_index: [R]: exported from:
fs/btrfs/inode-item.o fs/btrfs/btrfs.o fs/btrfs/built-in.o

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Reviewed-by: David Stebra <dsterba@suse.cz>
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
Sergei has sent this patch before, just keep original author
and changelog.(Thanks to David!)
---
 fs/btrfs/ctree.h      |  6 -----
 fs/btrfs/inode-item.c | 65 ---------------------------------------------------
 2 files changed, 71 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index f013a31..7038acc 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3570,12 +3570,6 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans,
 			   struct btrfs_root *root,
 			   const char *name, int name_len,
 			   u64 inode_objectid, u64 ref_objectid, u64 *index);
-int btrfs_get_inode_ref_index(struct btrfs_trans_handle *trans,
-			      struct btrfs_root *root,
-			      struct btrfs_path *path,
-			      const char *name, int name_len,
-			      u64 inode_objectid, u64 ref_objectid, int mod,
-			      u64 *ret_index);
 int btrfs_insert_empty_inode(struct btrfs_trans_handle *trans,
 			     struct btrfs_root *root,
 			     struct btrfs_path *path, u64 objectid);
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index ec82fae..2be38df 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -91,32 +91,6 @@ int btrfs_find_name_in_ext_backref(struct btrfs_path *path, u64 ref_objectid,
 	return 0;
 }
 
-static struct btrfs_inode_ref *
-btrfs_lookup_inode_ref(struct btrfs_trans_handle *trans,
-		       struct btrfs_root *root,
-		       struct btrfs_path *path,
-		       const char *name, int name_len,
-		       u64 inode_objectid, u64 ref_objectid, int ins_len,
-		       int cow)
-{
-	int ret;
-	struct btrfs_key key;
-	struct btrfs_inode_ref *ref;
-
-	key.objectid = inode_objectid;
-	key.type = BTRFS_INODE_REF_KEY;
-	key.offset = ref_objectid;
-
-	ret = btrfs_search_slot(trans, root, &key, path, ins_len, cow);
-	if (ret < 0)
-		return ERR_PTR(ret);
-	if (ret > 0)
-		return NULL;
-	if (!find_name_in_backref(path, name, name_len, &ref))
-		return NULL;
-	return ref;
-}
-
 /* Returns NULL if no extref found */
 struct btrfs_inode_extref *
 btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans,
@@ -144,45 +118,6 @@ btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans,
 	return extref;
 }
 
-int btrfs_get_inode_ref_index(struct btrfs_trans_handle *trans,
-			      struct btrfs_root *root,
-			      struct btrfs_path *path,
-			      const char *name, int name_len,
-			      u64 inode_objectid, u64 ref_objectid, int mod,
-			      u64 *ret_index)
-{
-	struct btrfs_inode_ref *ref;
-	struct btrfs_inode_extref *extref;
-	int ins_len = mod < 0 ? -1 : 0;
-	int cow = mod != 0;
-
-	ref = btrfs_lookup_inode_ref(trans, root, path, name, name_len,
-				     inode_objectid, ref_objectid, ins_len,
-				     cow);
-	if (IS_ERR(ref))
-		return PTR_ERR(ref);
-
-	if (ref != NULL) {
-		*ret_index = btrfs_inode_ref_index(path->nodes[0], ref);
-		return 0;
-	}
-
-	btrfs_release_path(path);
-
-	extref = btrfs_lookup_inode_extref(trans, root, path, name,
-					   name_len, inode_objectid,
-					   ref_objectid, ins_len, cow);
-	if (IS_ERR(extref))
-		return PTR_ERR(extref);
-
-	if (extref) {
-		*ret_index = btrfs_inode_extref_index(path->nodes[0], extref);
-		return 0;
-	}
-
-	return -ENOENT;
-}
-
 static int btrfs_del_inode_extref(struct btrfs_trans_handle *trans,
 				  struct btrfs_root *root,
 				  const char *name, int name_len,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-11-13  9:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-12 11:32 [PATCH 1/2] Btrfs: remove unused function btrfs_get_inode_ref_index() Wang Shilong
2013-11-12 11:32 ` [PATCH 2/2] Btrfs: remove dead codes from ctree.h Wang Shilong
2013-11-12 16:02 ` [PATCH 1/2] Btrfs: remove unused function btrfs_get_inode_ref_index() David Sterba
2013-11-13  1:30   ` Wang Shilong
2013-11-13  9:46   ` [PATCH v2 1/2] btrfs: cleanup: removed unused 'btrfs_get_inode_ref_index' Wang Shilong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.