From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Zheng Liu <gnehzuil.liu@gmail.com>
Cc: linux-ext4@vger.kernel.org, "Theodore Ts'o" <tytso@mit.edu>,
Zheng Liu <wenqing.lz@taobao.com>
Subject: Re: [PATCH v2 27/28] libext2fs: export inode cahce creation function
Date: Tue, 3 Dec 2013 14:22:49 -0800 [thread overview]
Message-ID: <20131203222249.GG9535@birch.djwong.org> (raw)
In-Reply-To: <1386072715-9869-28-git-send-email-wenqing.lz@taobao.com>
On Tue, Dec 03, 2013 at 08:11:54PM +0800, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
>
> Currently we have already exported inode cache flush and free functions
> for users. This commit exports inode cache creation function. Later
> we will use this function to initialize inode cache and do some unit
> tests for inline data.
>
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> ---
> lib/ext2fs/ext2fs.h | 1 +
> lib/ext2fs/inode.c | 8 ++++----
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h
> index bf0ef26..a47bb40 100644
> --- a/lib/ext2fs/ext2fs.h
> +++ b/lib/ext2fs/ext2fs.h
> @@ -1369,6 +1369,7 @@ extern errcode_t ext2fs_get_memalign(unsigned long size,
> unsigned long align, void *ptr);
>
> /* inode.c */
> +extern errcode_t ext2fs_create_inode_cache(ext2_filsys fs, int cache_size);
> extern void ext2fs_free_inode_cache(struct ext2_inode_cache *icache);
> extern errcode_t ext2fs_flush_icache(ext2_filsys fs);
> extern errcode_t ext2fs_get_next_inode_full(ext2_inode_scan scan,
> diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c
> index 46c1c58..8cf76b0 100644
> --- a/lib/ext2fs/inode.c
> +++ b/lib/ext2fs/inode.c
> @@ -91,7 +91,7 @@ void ext2fs_free_inode_cache(struct ext2_inode_cache *icache)
> ext2fs_free_mem(&icache);
> }
>
> -static errcode_t create_icache(ext2_filsys fs)
> +errcode_t ext2fs_create_inode_cache(ext2_filsys fs, int cache_size)
cache_size should unsigned int; there's not much point in letting people pass
us a negative size.
Possibly ext2_inode_cache.cache_size should be unsigned too...
--D
> {
> int i;
> errcode_t retval;
> @@ -109,7 +109,7 @@ static errcode_t create_icache(ext2_filsys fs)
>
> fs->icache->buffer_blk = 0;
> fs->icache->cache_last = -1;
> - fs->icache->cache_size = 4;
> + fs->icache->cache_size = cache_size;
> fs->icache->refcount = 1;
> retval = ext2fs_get_array(fs->icache->cache_size,
> sizeof(struct ext2_inode_cache_ent),
> @@ -596,7 +596,7 @@ errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino,
> return EXT2_ET_BAD_INODE_NUM;
> /* Create inode cache if not present */
> if (!fs->icache) {
> - retval = create_icache(fs);
> + retval = ext2fs_create_inode_cache(fs, 4);
> if (retval)
> return retval;
> }
> @@ -732,7 +732,7 @@ errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino,
> }
> }
> } else {
> - retval = create_icache(fs);
> + retval = ext2fs_create_inode_cache(fs, 4);
> if (retval)
> goto errout;
> }
> --
> 1.7.9.7
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-12-03 22:22 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-03 12:11 [PATCH v2 00/28] e2fsprogs: inline data refinement patch set Zheng Liu
2013-12-03 12:11 ` [PATCH v2 01/28] libext2fs: support modifying arbitrary extended attributes Zheng Liu
2013-12-03 19:54 ` Darrick J. Wong
2013-12-04 3:20 ` Zheng Liu
2013-12-04 3:21 ` Darrick J. Wong
2013-12-04 14:53 ` Theodore Ts'o
2013-12-04 20:30 ` Darrick J. Wong
2013-12-04 22:43 ` Theodore Ts'o
2013-12-04 22:55 ` Darrick J. Wong
2013-12-03 12:11 ` [PATCH v2 02/28] libext2fs: various tweaks to the xattr editor APIs Zheng Liu
2013-12-03 12:11 ` [PATCH v2 03/28] libext2fs: extend xattr api to query number of attrs Zheng Liu
2013-12-03 12:11 ` [PATCH v2 04/28] libext2fs: fix memory leaks in extended attribute code Zheng Liu
2013-12-03 12:11 ` [PATCH v2 05/28] libext2fs: fix block leak when releasing xattr block Zheng Liu
2013-12-03 12:11 ` [PATCH v2 06/28] libext2fs: remove redundant code Zheng Liu
2013-12-03 12:11 ` [PATCH v2 07/28] libext2fs: free key/value pairs before reading Zheng Liu
2013-12-03 12:11 ` [PATCH v2 08/28] debugfs: dump all extended attributes Zheng Liu
2013-12-03 12:11 ` [PATCH v2 09/28] libext2fs: handle inline data in dir iterator function Zheng Liu
2013-12-03 22:13 ` Darrick J. Wong
2013-12-04 4:57 ` Zheng Liu
2013-12-04 5:10 ` Darrick J. Wong
2013-12-04 5:26 ` Zheng Liu
2013-12-04 6:07 ` Darrick J. Wong
2013-12-04 6:21 ` Zheng Liu
2013-12-04 7:33 ` Darrick J. Wong
2013-12-03 12:11 ` [PATCH v2 10/28] libext2fs: handle inline_data in block " Zheng Liu
2013-12-03 12:11 ` [PATCH v2 11/28] debugfs: make stat command support inline data Zheng Liu
2013-12-03 12:11 ` [PATCH v2 12/28] debugfs: make expand " Zheng Liu
2013-12-03 21:19 ` Darrick J. Wong
2013-12-04 3:42 ` Zheng Liu
2013-12-03 12:11 ` [PATCH v2 13/28] debugfs: make mkdir " Zheng Liu
2013-12-03 12:11 ` [PATCH v2 14/28] debugfs: make lsdel " Zheng Liu
2013-12-03 12:11 ` [PATCH v2 15/28] debugfs: handle inline_data feature in bmap command Zheng Liu
2013-12-04 3:11 ` Darrick J. Wong
2013-12-04 3:46 ` Zheng Liu
2013-12-03 12:11 ` [PATCH v2 16/28] debugfs: handle inline data feature in punch command Zheng Liu
2013-12-03 12:11 ` [PATCH v2 17/28] libext2fs: handle inline data in read/write function Zheng Liu
2013-12-04 3:02 ` Darrick J. Wong
2013-12-04 3:47 ` Zheng Liu
2013-12-03 12:11 ` [PATCH v2 18/28] libext2fs: add inline_data feature into EXT2_LIB_FEATURE_INCOMPAT_SUPP Zheng Liu
2013-12-03 12:11 ` [PATCH v2 19/28] mke2fs: add inline_data support in mke2fs Zheng Liu
2013-12-03 22:30 ` Darrick J. Wong
2013-12-04 3:27 ` Zheng Liu
2013-12-04 4:08 ` Darrick J. Wong
2013-12-04 5:21 ` Zheng Liu
2013-12-04 5:26 ` Darrick J. Wong
2013-12-04 5:50 ` Zheng Liu
2013-12-04 6:02 ` Darrick J. Wong
2013-12-04 6:18 ` Zheng Liu
2013-12-03 12:11 ` [PATCH v2 20/28] tune2fs: add inline_data feature in tune2fs Zheng Liu
2013-12-03 22:29 ` Darrick J. Wong
2013-12-04 3:55 ` Zheng Liu
2013-12-04 4:03 ` Darrick J. Wong
2013-12-04 5:27 ` Zheng Liu
2013-12-03 12:11 ` [PATCH v2 21/28] e2fsck: add problem descriptions and check inline data feature Zheng Liu
2013-12-03 12:11 ` [PATCH v2 22/28] e2fsck: check inline_data in pass1 Zheng Liu
2013-12-03 12:11 ` [PATCH v2 23/28] e2fsck: check inline_data in pass2 Zheng Liu
2013-12-03 12:11 ` [PATCH v2 24/28] e2fsck: check inline_data in pass3 Zheng Liu
2013-12-03 12:11 ` [PATCH v2 25/28] tests: change result in f_bad_disconnected_inode Zheng Liu
2013-12-03 12:11 ` [PATCH v2 26/28] mke2fs: enable inline_data feature on ext4dev filesystem Zheng Liu
2013-12-03 12:11 ` [PATCH v2 27/28] libext2fs: export inode cahce creation function Zheng Liu
2013-12-03 22:22 ` Darrick J. Wong [this message]
2013-12-04 3:56 ` Zheng Liu
2013-12-03 12:11 ` [PATCH v2 28/28] libext2fs: add a unit test for inline data Zheng Liu
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=20131203222249.GG9535@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=gnehzuil.liu@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=wenqing.lz@taobao.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).