Subject: [to-be-updated] hfsplus-introduce-descriptor-of-block-list-buffer.patch removed from -mm tree To: slava@xxxxxxxxxxx,hch@xxxxxxxxxxxxx,htl10@xxxxxxxxxxxxxxxxxxxxx,viro@xxxxxxxxxxxxxxxxxx,mm-commits@xxxxxxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Wed, 05 Feb 2014 15:49:11 -0800 The patch titled Subject: hfsplus: introduce descriptor of block list buffer has been removed from the -mm tree. Its filename was hfsplus-introduce-descriptor-of-block-list-buffer.patch This patch was dropped because an updated version will be merged ------------------------------------------------------ From: Vyacheslav Dubeyko <slava@xxxxxxxxxxx> Subject: hfsplus: introduce descriptor of block list buffer Lis (binfo array) can have size from 4KB till 16KB. Thereby, block list can be placed in several file system blocks. This patch introduces special structure that it incapsulates all necessary details and buffer's pointers for passing through binfo array, check binfo and replay transactions' blocks. Also, the patch implements functions that initialize and deinitialize hfsplus_blist_desc structure. Signed-off-by: Vyacheslav Dubeyko <slava@xxxxxxxxxxx> Cc: Hin-Tak Leung <htl10@xxxxxxxxxxxxxxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/hfsplus/journal.c | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff -puN fs/hfsplus/journal.c~hfsplus-introduce-descriptor-of-block-list-buffer fs/hfsplus/journal.c --- a/fs/hfsplus/journal.c~hfsplus-introduce-descriptor-of-block-list-buffer +++ a/fs/hfsplus/journal.c @@ -50,6 +50,30 @@ (le32_to_cpu(((struct hfsplus_journal_header *)(jh))->jhdr_size)) /* + * struct hfsplus_blist_desc - descriptor of block list buffer + * @start_sec: start sector of block list + * @cur_sec: current sector of block list + * @cur_index: start block index for current sector + * @available_bytes: how many bytes of block list does contain buffer? + * @blist_buf: buffer for current part of block list + * @binfo: pointer on binfo[0] + * @blhdr: cached copy of block list header + * @src_buf: pointer on source block in journal buffer + * @dst_buf: pointer on buffer for destination block + */ +struct hfsplus_blist_desc { + sector_t start_sec; + sector_t cur_sec; + u16 cur_index; + size_t available_bytes; + void *blist_buf; + struct hfsplus_block_info *binfo; + struct hfsplus_blhdr blhdr; + void *src_buf; + void *dst_buf; +}; + +/* * We want at least 8 megs of journal for each 100 gigs of * disk space. We cap the size at 512 megs (64x default), unless * the allocation block size is larger, in which case we use one @@ -227,6 +251,50 @@ static int hfsplus_create_journal(struct return 0; } +static void hfsplus_deinit_block_list_desc(struct hfsplus_blist_desc *desc); + +static int hfsplus_init_block_list_desc(struct super_block *sb, + struct hfsplus_blist_desc *desc) +{ + int err; + + memset((void *)desc, 0, sizeof(*desc)); + + desc->blist_buf = kmalloc(hfsplus_min_io_size(sb), GFP_KERNEL); + if (unlikely(!desc->blist_buf)) { + pr_err("unable to allocate blist_buf\n"); + err = -ENOMEM; + goto failed_init; + } + + desc->src_buf = kmalloc(hfsplus_min_io_size(sb), GFP_KERNEL); + if (unlikely(!desc->src_buf)) { + pr_err("unable to allocate src_buf\n"); + err = -ENOMEM; + goto failed_init; + } + + desc->dst_buf = kmalloc(hfsplus_min_io_size(sb), GFP_KERNEL); + if (unlikely(!desc->dst_buf)) { + pr_err("unable to allocate dst_buf\n"); + err = -ENOMEM; + goto failed_init; + } + + return 0; + +failed_init: + hfsplus_deinit_block_list_desc(desc); + return err; +} + +static void hfsplus_deinit_block_list_desc(struct hfsplus_blist_desc *desc) +{ + kfree(desc->blist_buf); + kfree(desc->src_buf); + kfree(desc->dst_buf); +} + static inline bool hfsplus_journal_empty(struct hfsplus_journal_header *jh) { _ Patches currently in -mm which might be from slava@xxxxxxxxxxx are hfsplus-implement-get-and-verify-block-list-header-functionality.patch hfsplus-implement-functionality-of-getting-transactions-block-info.patch hfsplus-implement-functionality-of-journal-log-wrapping.patch hfsplus-implement-functionality-of-transactions-block-check.patch hfsplus-implement-replay-transactions-block-functionality.patch hfsplus-implement-replay-journal-functionality.patch hfsplus-implement-replay-journal-functionality-fix.patch hfsplus-integrate-journal-replay-support-into-driver.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html