[RFC PATCH V7 07/16] Btrfs: subpagesize-blocksize: Allow mounting filesystems where sectorsize != PAGE_SIZE

2014-09-21 Thread Chandan Rajendra
From: Chandra Seetharaman This patch allows mounting filesystems with blocksize smaller than the PAGE_SIZE. Signed-off-by: Chandra Seetharaman Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk

[RFC PATCH V7 10/16] Btrfs: subpagesize-blocksize: fallocate: Work with sectorsized units.

2014-09-21 Thread Chandan Rajendra
While at it, this commit changes btrfs_truncate_page() to truncate sectorsized blocks instead of pages. Hence the function has been renamed to btrfs_truncate_block(). Signed-off-by: Chandan Rajendra --- fs/btrfs/ctree.h | 2 +- fs/btrfs/file.c | 41

[RFC PATCH V8 02/16] Btrfs: subpagesize-blocksize: Get rid of whole page writes.

2014-11-12 Thread Chandan Rajendra
This commit brings back functions that set/clear EXTENT_WRITEBACK bits. These are required to reliably clear PG_writeback page flag. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 47 +++ fs/btrfs/inode.c | 40

[RFC PATCH V8 00/16] Btrfs: Subpagesize-blocksize: Get rid of whole page I/O.

2014-11-12 Thread Chandan Rajendra
fs_writepage_fixup_worker(). 3. Create separate slab caches for 'extent buffer head' and 'extent buffer'. 4. Add 'leak list' tracking for 'extent buffer' instances. 5. Rename EXTENT_BUFFER_TREE_REF and EXTENT_BUFFER_IN_TREE to EXTENT_BUFFER_HEAD_TREE_REF and

[RFC PATCH V8 05/16] Btrfs: subpagesize-blocksize: Read tree blocks whose size is

2014-11-12 Thread Chandan Rajendra
In the case of subpagesize-blocksize, this patch makes it possible to read only a single metadata block from the disk instead of all the metadata blocks that map into a page. Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 45 +++-- fs/btrfs/disk-io.h | 3 ++ fs

[RFC PATCH V8 12/16] Btrfs: subpagesize-blocksize: Search for all ordered extents that could span across a page.

2014-11-12 Thread Chandan Rajendra
In subpagesize-blocksize scenario it is not sufficient to search using the first byte of the page to make sure that there are no ordered extents present across the page. Fix this. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 3 ++- fs/btrfs/inode.c | 6 +++--- 2 files changed

[RFC PATCH V8 11/16] Btrfs: subpagesize-blocksize: btrfs_page_mkwrite: Reserve space in sectorsized units.

2014-11-12 Thread Chandan Rajendra
In subpagesize-blocksize scenario, if i_size occurs in a block which is not the last block in the page, then the space to be reserved should be calculated appropriately. Signed-off-by: Chandan Rajendra --- fs/btrfs/inode.c | 33 ++--- 1 file changed, 22 insertions

[RFC PATCH V8 03/16] Btrfs: subpagesize-blocksize: __btrfs_buffered_write: Reserve/release extents aligned to block size.

2014-11-12 Thread Chandan Rajendra
Currently, the code reserves/releases extents in multiples of PAGE_CACHE_SIZE units. Fix this. Signed-off-by: Chandan Rajendra --- fs/btrfs/file.c | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index

[RFC PATCH V8 14/16] Btrfs: subpagesize-blocksize: Explicitly Track I/O status of blocks of an ordered extent.

2014-11-12 Thread Chandan Rajendra
In subpagesize-blocksize scenario a page can have more than one block. So in addition to PagePrivate2 flag, we would have to track the I/O status of each block of a page to reliably mark the ordered extent as complete. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c| 19 +-- fs

[RFC PATCH V8 09/16] Btrfs: subpagesize-blocksize: __extent_writepage: Write only dirty blocks of a page.

2014-11-12 Thread Chandan Rajendra
The code now loops across 'ordered extents' instead of 'extent maps' to figure out the dirty blocks of the page to be submitted for a write operation. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 74

[RFC PATCH V8 16/16] Btrfs: subpagesize-blocksize: Track blocks of ordered extent submitted for write I/O.

2014-11-12 Thread Chandan Rajendra
e 8192 2048" \ -c "pwrite 10240 2048" \ -c "sync_range 10240 2048" \ /mnt/btrfs/file.bin To fix this, we would have to explicitly track the blocks of an ordered extent that have already been submitted for write I/O. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c

[RFC PATCH V8 10/16] Btrfs: subpagesize-blocksize: fallocate: Work with sectorsized units.

2014-11-12 Thread Chandan Rajendra
While at it, this commit changes btrfs_truncate_page() to truncate sectorsized blocks instead of pages. Hence the function has been renamed to btrfs_truncate_block(). Signed-off-by: Chandan Rajendra --- fs/btrfs/ctree.h | 2 +- fs/btrfs/file.c | 41

[RFC PATCH V8 06/16] Btrfs: subpagesize-blocksize: Write only dirty extent buffers belonging to a page

2014-11-12 Thread Chandan Rajendra
For the subpagesize-blocksize scenario, This patch adds the ability to write a single extent buffer to the disk. Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 20 ++-- fs/btrfs/extent_io.c | 300 --- 2 files changed, 250 insertions

[RFC PATCH V8 08/16] Btrfs: subpagesize-blocksize: Compute and look up csums based on sectorsized blocks.

2014-11-12 Thread Chandan Rajendra
Checksums are applicable to sectorsize units. The current code uses bio->bv_len units to compute and look up checksums. This works on machines where sectorsize == PAGE_CACHE_SIZE. This patch makes the checksum computation and look up code to work with sectorsize units. Signed-off-by: Chan

[RFC PATCH V8 07/16] Btrfs: subpagesize-blocksize: Allow mounting filesystems where sectorsize != PAGE_SIZE

2014-11-12 Thread Chandan Rajendra
From: Chandra Seetharaman This patch allows mounting filesystems with blocksize smaller than the PAGE_SIZE. Signed-off-by: Chandra Seetharaman Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk

[RFC PATCH V8 13/16] Btrfs: subpagesize-blocksize: Deal with partial ordered extent allocations.

2014-11-12 Thread Chandan Rajendra
In subpagesize-blocksize scenario, extent allocations for only some of the dirty blocks of a page can succeed, while allocation for rest of the blocks can fail. This patch allows I/O against such partially allocated ordered extents to be submitted. Signed-off-by: Chandan Rajendra --- fs/btrfs

[RFC PATCH V8 04/16] Btrfs: subpagesize-blocksize: Define extent_buffer_head.

2014-11-12 Thread Chandan Rajendra
nt buffers in a page from 'struct extent buffer' to 'struct extent_buffer_head' Also, this patch moves EXTENT_BUFFER_TREE_REF, EXTENT_BUFFER_DUMMY and EXTENT_BUFFER_IN_TREE flags from extent_buffer->ebflags to extent_buffer_head->bflags. Signed-off-by: Chandra Seethara

[RFC PATCH V8 15/16] Btrfs: subpagesize-blocksize: Revert commit fc4adbff823f76577ece26dcb88bf6f8392dbd43.

2014-11-12 Thread Chandan Rajendra
In subpagesize-blocksize, we have multiple blocks in a page. Checking for existence of a page in the page cache isn't a sufficient check, since we could be truncating a subset of the blocks mapped by the page. Signed-off-by: Chandan Rajendra --- fs/btrfs/btrfs_inode.h | 2 -- fs/btrfs/f

[RFC PATCH V8 01/16] Btrfs: subpagesize-blocksize: Get rid of whole page reads.

2014-11-12 Thread Chandan Rajendra
Based on original patch from Aneesh Kumar K.V For the subpagesize-blocksize scenario, a page can contain multiple blocks. This patch handles this case. This patch also brings back check_page_locked() to reliably unlock pages in readpage's end bio function. Signed-off-by: Chandan Raj

[RFC PATCH V9 01/17] Btrfs: subpagesize-blocksize: Get rid of whole page reads.

2014-11-14 Thread Chandan Rajendra
Based on original patch from Aneesh Kumar K.V For the subpagesize-blocksize scenario, a page can contain multiple blocks. This patch handles this case. This patch also brings back check_page_locked() to reliably unlock pages in readpage's end bio function. Signed-off-by: Chandan Raj

[RFC PATCH V9 00/17] Btrfs: Subpagesize-blocksize: Get rid of whole page I/O.

2014-11-14 Thread Chandan Rajendra
extent buffer head' and 'extent buffer'. 4. Add 'leak list' tracking for 'extent buffer' instances. 5. Rename EXTENT_BUFFER_TREE_REF and EXTENT_BUFFER_IN_TREE to EXTENT_BUFFER_HEAD_TREE_REF and EXTENT_BUFFER_HEAD_IN_TREE respectively. Chandan Rajendra (15

[RFC PATCH V9 02/17] Btrfs: subpagesize-blocksize: Get rid of whole page writes.

2014-11-14 Thread Chandan Rajendra
This commit brings back functions that set/clear EXTENT_WRITEBACK bits. These are required to reliably clear PG_writeback page flag. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 47 +++ fs/btrfs/inode.c | 40

[RFC PATCH V9 12/17] Btrfs: subpagesize-blocksize: Search for all ordered extents that could span across a page.

2014-11-14 Thread Chandan Rajendra
In subpagesize-blocksize scenario it is not sufficient to search using the first byte of the page to make sure that there are no ordered extents present across the page. Fix this. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 3 ++- fs/btrfs/inode.c | 6 +++--- 2 files changed

[RFC PATCH V9 03/17] Btrfs: subpagesize-blocksize: __btrfs_buffered_write: Reserve/release extents aligned to block size.

2014-11-14 Thread Chandan Rajendra
Currently, the code reserves/releases extents in multiples of PAGE_CACHE_SIZE units. Fix this. Signed-off-by: Chandan Rajendra --- fs/btrfs/file.c | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index

[RFC PATCH V9 13/17] Btrfs: subpagesize-blocksize: Deal with partial ordered extent allocations.

2014-11-14 Thread Chandan Rajendra
In subpagesize-blocksize scenario, extent allocations for only some of the dirty blocks of a page can succeed, while allocation for rest of the blocks can fail. This patch allows I/O against such partially allocated ordered extents to be submitted. Signed-off-by: Chandan Rajendra --- fs/btrfs

[RFC PATCH V9 15/17] Btrfs: subpagesize-blocksize: Revert commit fc4adbff823f76577ece26dcb88bf6f8392dbd43.

2014-11-14 Thread Chandan Rajendra
In subpagesize-blocksize, we have multiple blocks in a page. Checking for existence of a page in the page cache isn't a sufficient check, since we could be truncating a subset of the blocks mapped by the page. Signed-off-by: Chandan Rajendra --- fs/btrfs/btrfs_inode.h | 2 -- fs/btrfs/f

[RFC PATCH V9 10/17] Btrfs: subpagesize-blocksize: fallocate: Work with sectorsized units.

2014-11-14 Thread Chandan Rajendra
While at it, this commit changes btrfs_truncate_page() to truncate sectorsized blocks instead of pages. Hence the function has been renamed to btrfs_truncate_block(). Signed-off-by: Chandan Rajendra --- fs/btrfs/ctree.h | 2 +- fs/btrfs/file.c | 41

[RFC PATCH V9 17/17] Btrfs: subpagesize-blocksize: Prevent writes to an extent buffer when PG_writeback flag is set.

2014-11-14 Thread Chandan Rajendra
ed to a page. Hence this patch adds a new flag (i.e. EXTENT_BUFFER_HEAD_WRITEBACK) and corresponding code to track the writeback status of the page and to prevent writes to any of the extent buffers mapped to the page while writeback is going on. Signed-off-by: Chandan Rajendra --- fs/btrfs/ct

[RFC PATCH V9 09/17] Btrfs: subpagesize-blocksize: __extent_writepage: Write only dirty blocks of a page.

2014-11-14 Thread Chandan Rajendra
The code now loops across 'ordered extents' instead of 'extent maps' to figure out the dirty blocks of the page to be submitted for a write operation. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 74

[RFC PATCH V9 05/17] Btrfs: subpagesize-blocksize: Read tree blocks whose size is

2014-11-14 Thread Chandan Rajendra
In the case of subpagesize-blocksize, this patch makes it possible to read only a single metadata block from the disk instead of all the metadata blocks that map into a page. Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 45 +++-- fs/btrfs/disk-io.h | 3 ++ fs

[RFC PATCH V9 14/17] Btrfs: subpagesize-blocksize: Explicitly Track I/O status of blocks of an ordered extent.

2014-11-14 Thread Chandan Rajendra
In subpagesize-blocksize scenario a page can have more than one block. So in addition to PagePrivate2 flag, we would have to track the I/O status of each block of a page to reliably mark the ordered extent as complete. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c| 19 +-- fs

[RFC PATCH V9 11/17] Btrfs: subpagesize-blocksize: btrfs_page_mkwrite: Reserve space in sectorsized units.

2014-11-14 Thread Chandan Rajendra
In subpagesize-blocksize scenario, if i_size occurs in a block which is not the last block in the page, then the space to be reserved should be calculated appropriately. Signed-off-by: Chandan Rajendra --- fs/btrfs/inode.c | 33 ++--- 1 file changed, 22 insertions

[RFC PATCH V9 07/17] Btrfs: subpagesize-blocksize: Allow mounting filesystems where sectorsize != PAGE_SIZE

2014-11-14 Thread Chandan Rajendra
From: Chandra Seetharaman This patch allows mounting filesystems with blocksize smaller than the PAGE_SIZE. Signed-off-by: Chandra Seetharaman Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk

[RFC PATCH V9 04/17] Btrfs: subpagesize-blocksize: Define extent_buffer_head.

2014-11-14 Thread Chandan Rajendra
nt buffers in a page from 'struct extent buffer' to 'struct extent_buffer_head' Also, this patch moves EXTENT_BUFFER_TREE_REF, EXTENT_BUFFER_DUMMY and EXTENT_BUFFER_IN_TREE flags from extent_buffer->ebflags to extent_buffer_head->bflags. Signed-off-by: Chandra Seethara

[RFC PATCH V9 08/17] Btrfs: subpagesize-blocksize: Compute and look up csums based on sectorsized blocks.

2014-11-14 Thread Chandan Rajendra
Checksums are applicable to sectorsize units. The current code uses bio->bv_len units to compute and look up checksums. This works on machines where sectorsize == PAGE_CACHE_SIZE. This patch makes the checksum computation and look up code to work with sectorsize units. Signed-off-by: Chan

[RFC PATCH V9 06/17] Btrfs: subpagesize-blocksize: Write only dirty extent buffers belonging to a page

2014-11-14 Thread Chandan Rajendra
For the subpagesize-blocksize scenario, This patch adds the ability to write a single extent buffer to the disk. Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 20 ++-- fs/btrfs/extent_io.c | 300 --- 2 files changed, 250 insertions

[RFC PATCH V9 16/17] Btrfs: subpagesize-blocksize: Track blocks of ordered extent submitted for write I/O.

2014-11-14 Thread Chandan Rajendra
e 8192 2048" \ -c "pwrite 10240 2048" \ -c "sync_range 10240 2048" \ /mnt/btrfs/file.bin To fix this, we would have to explicitly track the blocks of an ordered extent that have already been submitted for write I/O. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c

[PATCH] Btrfs-progs: add_refs_for_implied: Use root_id instead of root_bytenr.

2014-11-26 Thread Chandan Rajendra
resolve_one_root() returns the objectid of a tree rather than the logical address of the root node. Hence using root_bytenr is misleading. Fix this. Signed-off-by: Chandan Rajendra --- qgroup-verify.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qgroup-verify.c b

[LSF/MM TOPIC]: Btrfs: Decoupling block-size and page-size in BTRFS.

2014-11-27 Thread Chandan Rajendra
In BTRFS, BLOCK_SIZE, the basic IO size of the filesystem, is equal to the PAGE_SIZE of the architecture. Some 64-bit architectures, like PPC64 and ARM64, can/do have a default PAGE_SIZE of 64K, which means the filesystems handled in these architectures have a BLOCK_SIZE of 64K. This works fine as

<    2   3   4   5   6   7