search for: page_cache_shift

Displaying 20 results from an estimated 54 matches for "page_cache_shift".

2010 Jul 22
4
[PATCH 1/3] ext3/ext4: Factor out disk addressability check
...locksize_bits) is addressable by the sector_t + * and page cache of the system. Return 0 if so and -EFBIG otherwise. + */ +int generic_check_addressable(unsigned blocksize_bits, u64 num_blocks) +{ + u64 last_fs_block = num_blocks - 1; + + BUG_ON(blocksize_bits < 9); + BUG_ON(blocksize_bits > PAGE_CACHE_SHIFT); + + if (unlikely(num_blocks == 0)) + return 0; + + printk(KERN_INFO "HERE %u %lu %u %u", blocksize_bits, last_fs_block, + sizeof(sector_t), sizeof(pgoff_t)); + + if ((last_fs_block > + (sector_t)(~0ULL) >> (blocksize_bits - 9)) || + (last_fs_block > + (...
2010 Jul 12
1
[PATCH] ocfs2: Don't duplicate page passes i_size during CoW.
...t;i_mapping; @@ -2932,12 +2932,20 @@ static int ocfs2_duplicate_clusters_by_page(handle_t *handle, offset = ((loff_t)cpos) << OCFS2_SB(sb)->s_clustersize_bits; end = offset + (new_len << OCFS2_SB(sb)->s_clustersize_bits); + last_page = i_size_read(context->inode) >> PAGE_CACHE_SHIFT; while (offset < end) { page_index = offset >> PAGE_CACHE_SHIFT; map_end = ((loff_t)page_index + 1) << PAGE_CACHE_SHIFT; if (map_end > end) map_end = end; + /* + * If this page is beyond the page contains i_size, + * stop duplicating it. + */ + if (page_in...
2010 Jul 16
1
[PATCH] ocfs2: make __ocfs2_page_mkwrite handle file end properly.
...c int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh, /* * Another node might have truncated while we were waiting on * cluster locks. + * We don't check size == 0 before the shift. This is borrowed + * from do_generic_file_read. */ - last_index = size >> PAGE_CACHE_SHIFT; - if (page->index > last_index) { + last_index = (size - 1) >> PAGE_CACHE_SHIFT; + if (unlikely(!size || page->index > last_index)) { ret = -EINVAL; goto out; } @@ -107,7 +109,7 @@ static int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh, * becaus...
2012 Dec 18
0
[PATCH] [RFC] Btrfs: Subpagesize blocksize (WIP).
...a multi-page block */ - -static int csum_dirty_buffer(struct btrfs_root *root, struct page *page) +static int csum_dirty_buffer(struct btrfs_root *root, struct page *page, + unsigned int offset, unsigned int len) { - struct extent_io_tree *tree; u64 start = (u64)page->index << PAGE_CACHE_SHIFT; u64 found_start; struct extent_buffer *eb; - tree = &BTRFS_I(page->mapping->host)->io_tree; + if (!PageUptodate(page)) { + WARN_ON(1); + return 0; + } eb = (struct extent_buffer *)page->private; - if (page != eb->pages[0]) - return 0; + if (eb->len >= PAGE_SIZ...
2009 Jul 06
1
[Patch v3] btrfs: use file_remove_suid() after i_mutex is held
...ock(&inode->i_mutex); + err = file_remove_suid(file); if (err) - goto out_nolock; + goto out; file_update_time(file); - pages = kmalloc(nrptrs * sizeof(struct page *), GFP_KERNEL); - - mutex_lock(&inode->i_mutex); BTRFS_I(inode)->sequence++; first_index = pos >> PAGE_CACHE_SHIFT; last_index = (pos + count) >> PAGE_CACHE_SHIFT; -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
2013 Oct 09
2
[PATCH] Btrfs: add tests for find_lock_delalloc_range
...OCK (1 << 0) +#define PROCESS_RELEASE (1 << 1) +#define PROCESS_TEST_LOCKED (1 << 2) + +static noinline int process_page_range(struct inode *inode, u64 start, u64 end, + unsigned long flags) +{ + int ret; + struct page *pages[16]; + unsigned long index = start >> PAGE_CACHE_SHIFT; + unsigned long end_index = end >> PAGE_CACHE_SHIFT; + unsigned long nr_pages = end_index - index + 1; + int i; + int count = 0; + int loops = 0; + + while (nr_pages > 0) { + ret = find_get_pages_contig(inode->i_mapping, index, + min_t(unsigned long, nr_pages, + ARRAY_...
2011 Jun 29
14
[PATCH v4 0/6] btrfs: generic readeahead interface
This series introduces a generic readahead interface for btrfs trees. The intention is to use it to speed up scrub in a first run, but balance is another hot candidate. In general, every tree walk could be accompanied by a readahead. Deletion of large files comes to mind, where the fetching of the csums takes most of the time. Also the initial build-ups of free-space-caches and
2010 Mar 03
1
[PATCH V2] Btrfs: add direct I/O helper to process inline compressed extents.
...r_page(struct extent_buffer *eb, return p; } +void access_extent_buffer_page(struct bio_vec *vec, struct extent_buffer *eb, + unsigned long start, unsigned long len) +{ + size_t start_offset = eb->start & ((u64)PAGE_CACHE_SIZE - 1); + unsigned long i = (start_offset + start) >> PAGE_CACHE_SHIFT; + size_t offset = (start_offset + start) & + ((unsigned long)PAGE_CACHE_SIZE - 1); + + WARN_ON(start > eb->len); + WARN_ON(start + len > eb->start + eb->len); + + vec->bv_page = extent_buffer_page(eb, i); + vec->bv_offset = offset; + vec->bv_len = min(len, (PAGE_CACH...
2011 Jul 12
0
[PATCH] Btrfs: Remove unused variable 'last_index' in file.c
..._I(inode)->root; struct page **pages = NULL; unsigned long first_index; - unsigned long last_index; size_t num_written = 0; int nrptrs; int ret = 0; @@ -1172,7 +1171,6 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file, return -ENOMEM; first_index = pos >> PAGE_CACHE_SHIFT; - last_index = (pos + iov_iter_count(i)) >> PAGE_CACHE_SHIFT; while (iov_iter_count(i) > 0) { size_t offset = pos & (PAGE_CACHE_SIZE - 1); @@ -1206,8 +1204,7 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file, * contents of pages from loop to loop */...
2010 Apr 26
0
[PATCH V2 11/12] Btrfs: Pre-allocate space for data relocation
...ndex_cnt; unsigned long index; unsigned long last_index; - unsigned int dirty_page = 0; struct page *page; struct file_ra_state *ra; int nr = 0; @@ -2600,21 +2643,24 @@ static int relocate_file_extent_cluster( if (!ra) return -ENOMEM; - index = (cluster->start - offset) >> PAGE_CACHE_SHIFT; - last_index = (cluster->end - offset) >> PAGE_CACHE_SHIFT; + ret = prealloc_file_extent_cluster(inode, cluster); + if (ret) + goto out; - mutex_lock(&inode->i_mutex); + file_ra_state_init(ra, inode->i_mapping); - i_size_write(inode, cluster->end + 1 - offset); ret = s...
2011 Jun 10
6
[PATCH v2 0/6] btrfs: generic readeahead interface
This series introduces a generic readahead interface for btrfs trees. The intention is to use it to speed up scrub in a first run, but balance is another hot candidate. In general, every tree walk could be accompanied by a readahead. Deletion of large files comes to mind, where the fetching of the csums takes most of the time. Also the initial build-ups of free-space-caches and
2010 Jul 11
2
[PATCH 1/2] JBD2: Allow feature checks before journal recovery
Before we start accessing a huge (> 16 TiB) OCFS2 volume, we need to confirm that its journal supports 64-bit offsets. So we need to check the journal's feature bits before recovering the journal. This is not possible with JBD2 at present, because the journal superblock (where the feature bits reside) is not loaded from disk until the journal is recovered. This patch loads the journal
2013 Oct 25
1
[PATCH] Btrfs: stop using vfs_read in send
...; } +static ssize_t fill_read_buf(struct send_ctx *sctx, u64 offset, u32 len) +{ + struct btrfs_root *root = sctx->send_root; + struct btrfs_fs_info *fs_info = root->fs_info; + struct inode *inode; + struct page *page; + char *addr; + struct btrfs_key key; + pgoff_t index = offset >> PAGE_CACHE_SHIFT; + pgoff_t last_index; + unsigned pg_offset = offset & (PAGE_CACHE_SIZE - 1); + ssize_t ret = 0; + + key.objectid = sctx->cur_ino; + key.type = BTRFS_INODE_ITEM_KEY; + key.offset = 0; + + inode = btrfs_iget(fs_info->sb, &key, root, NULL); + if (IS_ERR(inode)) + return PTR_ERR(inode);...
2009 Jul 06
2
[Patch] btrfs: use file_remove_suid() after i_mutex is held
...; + err = file_remove_suid(file); if (err) - goto out_nolock; + goto out; file_update_time(file); pages = kmalloc(nrptrs * sizeof(struct page *), GFP_KERNEL); + if (!pages) + goto out; - mutex_lock(&inode->i_mutex); BTRFS_I(inode)->sequence++; first_index = pos >> PAGE_CACHE_SHIFT; last_index = (pos + count) >> PAGE_CACHE_SHIFT; -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
2012 Jan 25
3
[PATCH] Btrfs: Check for NULL page in extent_range_uptodate
...ertions(+), 0 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 9d09a4f..fcf77e1 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3909,6 +3909,8 @@ int extent_range_uptodate(struct extent_io_tree *tree, while (start <= end) { index = start >> PAGE_CACHE_SHIFT; page = find_get_page(tree->mapping, index); + if (!page) + return 1; uptodate = PageUptodate(page); page_cache_release(page); if (!uptodate) { -- 1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vg...
2009 Jul 06
2
[Patch v2] btrfs: use file_remove_suid() after i_mutex is held
...ock(&inode->i_mutex); + err = file_remove_suid(file); if (err) - goto out_nolock; + goto out; file_update_time(file); - pages = kmalloc(nrptrs * sizeof(struct page *), GFP_KERNEL); - - mutex_lock(&inode->i_mutex); BTRFS_I(inode)->sequence++; first_index = pos >> PAGE_CACHE_SHIFT; last_index = (pos + count) >> PAGE_CACHE_SHIFT; -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
2012 Apr 26
7
[PATCH 2/4] Btrfs: fix deadlock on sb->s_umount when doing umount
...wait_ordered_extents(root, 0, 0); + } +} + /* * shrink metadata reservation for delalloc */ @@ -3624,8 +3646,7 @@ static int shrink_delalloc(struct btrfs_root *root, u64 to_reclaim, smp_mb(); nr_pages = min_t(unsigned long, nr_pages, root->fs_info->delalloc_bytes >> PAGE_CACHE_SHIFT); - writeback_inodes_sb_nr_if_idle(root->fs_info->sb, nr_pages, - WB_REASON_FS_FREE_SPACE); + btrfs_writeback_inodes_sb_nr(root, nr_pages); spin_lock(&space_info->lock); if (reserved > space_info->bytes_may_use) -- 1.7.6.5 -- To unsubscribe from this list: send th...
2012 Jun 18
3
[PATCH] Ignore unfragmented file checks in defrag when compression enabled
I noticed that btrfs fi defrag -c<method> can''t be used to compress files unless they are fragmented. This patch corrects the problem, by informing should_defrag_range if compression is enabled, and skipping tests for extent and adjacent extents if it is. Andrew Mahone (1): btrfs: ignore unfragmented file checks in defrag when compression enabled fs/btrfs/ioctl.c | 10
2013 Feb 07
8
[RFC] Btrfs: Allow the compressed extent size limit to be modified v2
...g max_uncompressed = root->fs_info->max_compressed_extent_kb * 1024; int i; int will_compress; int compress_type = root->fs_info->compress_type; @@ -361,7 +361,7 @@ static noinline int compress_file_range(struct inode *inode, again: will_compress = 0; nr_pages = (end >> PAGE_CACHE_SHIFT) - (start >> PAGE_CACHE_SHIFT) + 1; - nr_pages = min(nr_pages, (128 * 1024UL) / PAGE_CACHE_SIZE); + nr_pages = min(nr_pages, max_compressed / PAGE_CACHE_SIZE); /* * we don''t want to send crud past the end of i_size through @@ -386,7 +386,7 @@ again: * * We also want to m...
2011 Aug 26
0
[PATCH] Btrfs: make some functions return void
...s for a compressed write */ -static noinline int end_compressed_writeback(struct inode *inode, u64 start, - unsigned long ram_size) +static noinline void end_compressed_writeback(struct inode *inode, u64 start, + unsigned long ram_size) { unsigned long index = start >> PAGE_CACHE_SHIFT; unsigned long end_index = (start + ram_size - 1) >> PAGE_CACHE_SHIFT; @@ -252,7 +252,6 @@ static noinline int end_compressed_writeback(struct inode *inode, u64 start, index += ret; } /* the inode may be gone now */ - return 0; } /* @@ -434,9 +433,9 @@ int btrfs_submit_compressed...