All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 01/18] btrfs: add an inode-item.h
Date: Mon, 6 Dec 2021 19:45:49 +0100	[thread overview]
Message-ID: <20211206184549.GT28560@twin.jikos.cz> (raw)
In-Reply-To: <da8f34d466181ae99ccc229088f6173ce42914ae.1638569556.git.josef@toxicpanda.com>

On Fri, Dec 03, 2021 at 05:18:03PM -0500, Josef Bacik wrote:
> We have a few helpers in inode-item.c, and I'm going to make a few
> changes to how we do truncate in the future, so break out these
> definitions into their own header file to trim down ctree.h some and
> make it easier to do the work on truncate in the future.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
>  fs/btrfs/ctree.h            | 30 ------------------------------
>  fs/btrfs/delayed-inode.c    |  1 +
>  fs/btrfs/free-space-cache.c |  1 +
>  fs/btrfs/inode-item.c       |  1 +
>  fs/btrfs/inode-item.h       | 37 +++++++++++++++++++++++++++++++++++++
>  fs/btrfs/inode.c            |  1 +
>  fs/btrfs/relocation.c       |  1 +
>  fs/btrfs/tree-log.c         |  1 +
>  8 files changed, 43 insertions(+), 30 deletions(-)
>  create mode 100644 fs/btrfs/inode-item.h
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index dfee4b403da1..f33cae82e7dd 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -3126,36 +3126,6 @@ int btrfs_del_orphan_item(struct btrfs_trans_handle *trans,
>  			  struct btrfs_root *root, u64 offset);
>  int btrfs_find_orphan_item(struct btrfs_root *root, u64 offset);
>  
> -/* inode-item.c */
> -int btrfs_insert_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_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_insert_empty_inode(struct btrfs_trans_handle *trans,
> -			     struct btrfs_root *root,
> -			     struct btrfs_path *path, u64 objectid);
> -int btrfs_lookup_inode(struct btrfs_trans_handle *trans, struct btrfs_root
> -		       *root, struct btrfs_path *path,
> -		       struct btrfs_key *location, int mod);
> -
> -struct btrfs_inode_extref *
> -btrfs_lookup_inode_extref(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);
> -
> -struct btrfs_inode_ref *btrfs_find_name_in_backref(struct extent_buffer *leaf,
> -						   int slot, const char *name,
> -						   int name_len);
> -struct btrfs_inode_extref *btrfs_find_name_in_ext_backref(
> -		struct extent_buffer *leaf, int slot, u64 ref_objectid,
> -		const char *name, int name_len);
>  /* file-item.c */
>  struct btrfs_dio_private;
>  int btrfs_del_csums(struct btrfs_trans_handle *trans,
> diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
> index 6f134f2c5e68..748bf6b0d860 100644
> --- a/fs/btrfs/delayed-inode.c
> +++ b/fs/btrfs/delayed-inode.c
> @@ -13,6 +13,7 @@
>  #include "ctree.h"
>  #include "qgroup.h"
>  #include "locking.h"
> +#include "inode-item.h"
>  
>  #define BTRFS_DELAYED_WRITEBACK		512
>  #define BTRFS_DELAYED_BACKGROUND	128
> diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
> index 132209ff2262..55e1be703a39 100644
> --- a/fs/btrfs/free-space-cache.c
> +++ b/fs/btrfs/free-space-cache.c
> @@ -23,6 +23,7 @@
>  #include "block-group.h"
>  #include "discard.h"
>  #include "subpage.h"
> +#include "inode-item.h"
>  
>  #define BITS_PER_BITMAP		(PAGE_SIZE * 8UL)
>  #define MAX_CACHE_BYTES_PER_GIG	SZ_64K
> diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
> index 56755ce9a907..72593a93c43c 100644
> --- a/fs/btrfs/inode-item.c
> +++ b/fs/btrfs/inode-item.c
> @@ -4,6 +4,7 @@
>   */
>  
>  #include "ctree.h"
> +#include "inode-item.h"
>  #include "disk-io.h"
>  #include "transaction.h"
>  #include "print-tree.h"
> diff --git a/fs/btrfs/inode-item.h b/fs/btrfs/inode-item.h
> new file mode 100644
> index 000000000000..cb4b140e3b7d
> --- /dev/null
> +++ b/fs/btrfs/inode-item.h
> @@ -0,0 +1,37 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#ifndef BTRFS_INODE_ITEM_H
> +#define BTRFS_INODE_ITEM_H
> +

Please don't forget to add forward declarations for all structure types
and include all other necessary headers for eg. u64 when adding a new
header. I'll add it now.

  reply	other threads:[~2021-12-06 18:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 22:18 [PATCH 00/18] Truncate cleanups and preparation work Josef Bacik
2021-12-03 22:18 ` [PATCH 01/18] btrfs: add an inode-item.h Josef Bacik
2021-12-06 18:45   ` David Sterba [this message]
2021-12-03 22:18 ` [PATCH 02/18] btrfs: move btrfs_truncate_inode_items to inode-item.c Josef Bacik
2021-12-03 22:18 ` [PATCH 03/18] btrfs: move extent locking outside of btrfs_truncate_inode_items Josef Bacik
2021-12-03 22:18 ` [PATCH 04/18] btrfs: remove free space cache inode check in btrfs_truncate_inode_items Josef Bacik
2021-12-03 22:18 ` [PATCH 05/18] btrfs: move btrfs_kill_delayed_inode_items into evict Josef Bacik
2021-12-03 22:18 ` [PATCH 06/18] btrfs: remove found_extent from btrfs_truncate_inode_items Josef Bacik
2021-12-03 22:18 ` [PATCH 07/18] btrfs: add btrfs_truncate_control struct Josef Bacik
2021-12-03 22:18 ` [PATCH 08/18] btrfs: only update i_size in truncate paths that care Josef Bacik
2021-12-03 22:18 ` [PATCH 09/18] btrfs: only call inode_sub_bytes " Josef Bacik
2021-12-03 22:18 ` [PATCH 10/18] btrfs: control extent reference updates with a control flag for truncate Josef Bacik
2021-12-03 22:18 ` [PATCH 11/18] btrfs: use a flag to control when to clear the file extent range Josef Bacik
2021-12-03 22:18 ` [PATCH 12/18] btrfs: pass the ino via btrfs_truncate_control Josef Bacik
2021-12-03 22:18 ` [PATCH 13/18] btrfs: add inode to btrfs_truncate_control Josef Bacik
2021-12-03 22:18 ` [PATCH 14/18] btrfs: convert BUG_ON() in btrfs_truncate_inode_items to ASSERT Josef Bacik
2021-12-03 22:18 ` [PATCH 15/18] btrfs: convert BUG() for pending_del_nr into an ASSERT Josef Bacik
2021-12-03 22:18 ` [PATCH 16/18] btrfs: combine extra if statements in btrfs_truncate_inode_items Josef Bacik
2021-12-03 22:18 ` [PATCH 17/18] btrfs: make should_throttle loop local " Josef Bacik
2021-12-03 22:18 ` [PATCH 18/18] btrfs: do not check -EAGAIN when truncating inodes in the log root Josef Bacik
2021-12-06 14:43 ` [PATCH 00/18] Truncate cleanups and preparation work Filipe Manana
2021-12-06 21:06 ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211206184549.GT28560@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.