linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@kernel.org>
To: "Yuezhang.Mo@sony.com" <Yuezhang.Mo@sony.com>
Cc: "sj1557.seo@samsung.com" <sj1557.seo@samsung.com>,
	 "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"Andy.Wu@sony.com" <Andy.Wu@sony.com>,
	 "Wataru.Aoyama@sony.com" <Wataru.Aoyama@sony.com>,
	"cpgs@samsung.com" <cpgs@samsung.com>
Subject: Re: [PATCH v5 1/2] exfat: change to get file size from DataLength
Date: Tue, 5 Dec 2023 12:30:16 +0900	[thread overview]
Message-ID: <CAKYAXd_VDotfcAHq+4TjM6oEdb7fO-QOuO8sAftNvZGed7o_cA@mail.gmail.com> (raw)
In-Reply-To: <PUZPR04MB6316F0640983B00CC55D903F8182A@PUZPR04MB6316.apcprd04.prod.outlook.com>

> +static int exfat_file_zeroed_range(struct file *file, loff_t start, loff_t
> end)
> +{
> +	int err;
> +	struct inode *inode = file_inode(file);
> +	struct exfat_inode_info *ei = EXFAT_I(inode);
> +	struct address_space *mapping = inode->i_mapping;
> +	const struct address_space_operations *ops = mapping->a_ops;
> +
> +	while (start < end) {
> +		u32 zerofrom, len;
> +		struct page *page = NULL;
> +
> +		zerofrom = start & (PAGE_SIZE - 1);
> +		len = PAGE_SIZE - zerofrom;
> +		if (start + len > end)
> +			len = end - start;
> +
> +		err = ops->write_begin(file, mapping, start, len, &page, NULL);
Is there any reason why you don't use block_write_begin and
generic_write_end() ?

Thanks.
> +		if (err)
> +			goto out;
> +
> +		zero_user_segment(page, zerofrom, zerofrom + len);
> +
> +		err = ops->write_end(file, mapping, start, len, len, page, NULL);
> +		if (err < 0)
> +			goto out;
> +		start += len;
> +
> +		balance_dirty_pages_ratelimited(mapping);
> +		cond_resched();
> +	}
> +
> +	ei->valid_size = end;
> +	mark_inode_dirty(inode);
> +
> +out:
> +	return err;
> +}

  parent reply	other threads:[~2023-12-05  3:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02  9:58 [PATCH v4 0/2] exfat: get file size from DataLength Yuezhang.Mo
2023-11-30  3:09 ` [PATCH v5 " Yuezhang.Mo
2023-12-05 10:16   ` [PATCH v6 " Yuezhang.Mo
2023-12-12  4:12     ` Namjae Jeon
     [not found]       ` <PUZPR04MB63160A6FD8E7EF04E4342B1B818EA@PUZPR04MB6316.apcprd04.prod.outlook.com>
2023-12-12 10:29         ` Yuezhang.Mo
2023-12-13  4:14           ` Namjae Jeon
2023-12-05 10:16   ` [PATCH v6 1/2] exfat: change to " Yuezhang.Mo
2023-12-05 10:16   ` [PATCH v6 2/2] exfat: do not zero the extended part Yuezhang.Mo
2023-11-30  3:09 ` [PATCH v5 1/2] exfat: change to get file size from DataLength Yuezhang.Mo
2023-11-30 17:10   ` kernel test robot
2023-11-30 18:04   ` kernel test robot
2023-12-01  8:29   ` Dan Carpenter
2023-12-05  2:11     ` Sungjong Seo
2023-12-05  3:30   ` Namjae Jeon [this message]
     [not found]     ` <PUZPR04MB6316B8BAC361A5B2A70FD5098185A@PUZPR04MB6316.apcprd04.prod.outlook.com>
2023-12-05  5:29       ` Yuezhang.Mo
2023-11-30  3:09 ` [PATCH v5 2/2] exfat: do not zero the extended part Yuezhang.Mo

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=CAKYAXd_VDotfcAHq+4TjM6oEdb7fO-QOuO8sAftNvZGed7o_cA@mail.gmail.com \
    --to=linkinjeon@kernel.org \
    --cc=Andy.Wu@sony.com \
    --cc=Wataru.Aoyama@sony.com \
    --cc=Yuezhang.Mo@sony.com \
    --cc=cpgs@samsung.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sj1557.seo@samsung.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).