Message ID | 20201210063905.75727-4-wqu@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs: add read-only support for subpage sector size | expand |
On 10.12.20 г. 8:38 ч., Qu Wenruo wrote: > The original comment is from the initial merge, which has several > problems: > - No holes check any more > - No inline decision is made > > Update the out-of-date comment with more correct one. > > Signed-off-by: Qu Wenruo <wqu@suse.com> > --- > fs/btrfs/file.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c > index 0e41459b8de6..a29b50208eee 100644 > --- a/fs/btrfs/file.c > +++ b/fs/btrfs/file.c > @@ -453,12 +453,15 @@ static void btrfs_drop_pages(struct page **pages, size_t num_pages) > } > > /* > - * after copy_from_user, pages need to be dirtied and we need to make > - * sure holes are created between the current EOF and the start of > - * any next extents (if required). > - * > - * this also makes the decision about creating an inline extent vs > - * doing real data extents, marking pages dirty and delalloc as required. > + * After btrfs_copy_from_user(), update the following things for delalloc: > + * - DELALLOC extent io tree bits > + * Later btrfs_run_delalloc_range() relies on this bit to determine the > + * writeback range. IMO the following seems more coherent and concise: - Mark newly dirtied pages as DELALLOC in the io tree. Used to advise which range is to be written back. > + * - Page status > + * Including basic status like Dirty and Uptodate, and btrfs specific bit > + * like Checked (for cow fixup) - Marks modified pages as Uptodate/Dirty and not needing cowfixup > + * - Inode size update > + * If needed - Update inode size for past EOF write. > */ > int btrfs_dirty_pages(struct btrfs_inode *inode, struct page **pages, > size_t num_pages, loff_t pos, size_t write_bytes, >
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 0e41459b8de6..a29b50208eee 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -453,12 +453,15 @@ static void btrfs_drop_pages(struct page **pages, size_t num_pages) } /* - * after copy_from_user, pages need to be dirtied and we need to make - * sure holes are created between the current EOF and the start of - * any next extents (if required). - * - * this also makes the decision about creating an inline extent vs - * doing real data extents, marking pages dirty and delalloc as required. + * After btrfs_copy_from_user(), update the following things for delalloc: + * - DELALLOC extent io tree bits + * Later btrfs_run_delalloc_range() relies on this bit to determine the + * writeback range. + * - Page status + * Including basic status like Dirty and Uptodate, and btrfs specific bit + * like Checked (for cow fixup) + * - Inode size update + * If needed */ int btrfs_dirty_pages(struct btrfs_inode *inode, struct page **pages, size_t num_pages, loff_t pos, size_t write_bytes,
The original comment is from the initial merge, which has several problems: - No holes check any more - No inline decision is made Update the out-of-date comment with more correct one. Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/file.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)