search for: page_cache_size

Displaying 20 results from an estimated 68 matches for "page_cache_size".

2007 Jun 08
0
[git patches] ocfs2 fixes
...ing write on 64k pages Tiger Yang: ocfs2: Fix masklog breakage diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 0023b31..a480b09 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -798,6 +798,11 @@ int ocfs2_map_and_write_splice_data(stru } to = from + bytes; + BUG_ON(from > PAGE_CACHE_SIZE); + BUG_ON(to > PAGE_CACHE_SIZE); + BUG_ON(from < cluster_start); + BUG_ON(to > cluster_end); + if (wc->w_this_page_new) ret = ocfs2_map_page_blocks(wc->w_this_page, p_blkno, inode, cluster_start, cluster_end, 1); @@ -809,11 +814,6 @@ int ocfs2_map_and_write_splice_dat...
2010 Mar 03
1
[PATCH V2] Btrfs: add direct I/O helper to process inline compressed extents.
...extent_io.c @@ -3053,6 +3053,22 @@ static inline struct page *extent_buffer_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(e...
2013 Feb 15
1
[PATCH] btrfs: use kmalloc for lzo de/compress buffer
...orkspace->buf); + kfree(workspace->cbuf); + kfree(workspace->mem); kfree(workspace); } @@ -54,9 +53,10 @@ static struct list_head *lzo_alloc_workspace(void) if (!workspace) return ERR_PTR(-ENOMEM); - workspace->mem = vmalloc(LZO1X_MEM_COMPRESS); - workspace->buf = vmalloc(PAGE_CACHE_SIZE); - workspace->cbuf = vmalloc(lzo1x_worst_compress(PAGE_CACHE_SIZE)); + workspace->mem = kmalloc(LZO1X_MEM_COMPRESS, GFP_NOFS); + workspace->buf = kmalloc(PAGE_CACHE_SIZE, GFP_NOFS); + workspace->cbuf = kmalloc(lzo1x_worst_compress(PAGE_CACHE_SIZE), + GFP_NOFS); if (!workspace->m...
2013 Oct 08
3
[PATCH] Btrfs: limit delalloc pages outside of find_delalloc_range
..._bytes) break; - } if (!node) break; } @@ -1636,10 +1634,9 @@ again: /* * make sure to limit the number of pages we try to lock down - * if we''re looping. */ - if (delalloc_end + 1 - delalloc_start > max_bytes && loops) - delalloc_end = delalloc_start + PAGE_CACHE_SIZE - 1; + if (delalloc_end + 1 - delalloc_start > max_bytes) + delalloc_end = delalloc_start + max_bytes - 1; /* step two, lock all the pages after the page that has start */ ret = lock_delalloc_pages(inode, locked_page, @@ -1650,8 +1647,7 @@ again: */ free_extent_state(cached_state);...
2008 Jul 03
2
iozone remove_suid oops...
...struct inode *inode = fdentry(file)->d_inode; struct btrfs_root *root = BTRFS_I(inode)->root; struct page **pages = NULL; int nrptrs; struct page *pinned[2]; unsigned long first_index; unsigned long last_index; nrptrs = min((count + PAGE_CACHE_SIZE - 1) / PAGE_CACHE_SIZE, PAGE_CACHE_SIZE / (sizeof(struct page *))); pinned[0] = NULL; pinned[1] = NULL; if (file->f_flags & O_DIRECT) return -EINVAL; pos = *ppos; start_pos = pos; vfs_check_frozen(inode-&g...
2011 Mar 31
4
[PATCH] Btrfs: fix free space cache when there are pinned extents and clusters
...ace-cache.c index f03ef97..3b06a7a 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -24,6 +24,7 @@ #include "free-space-cache.h" #include "transaction.h" #include "disk-io.h" +#include "extent_io.h" #define BITS_PER_BITMAP (PAGE_CACHE_SIZE * 8) #define MAX_CACHE_BYTES_PER_GIG (32 * 1024) @@ -222,6 +223,7 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info, u64 num_entries; u64 num_bitmaps; u64 generation; + u64 used = btrfs_block_group_used(&block_group->item); u32 cur_crc = ~(u32)0; pgoff_t index = 0; unsi...
2011 Aug 09
2
[PATCH] Btrfs: truncate pages from clone ioctl target range
...trfs/ioctl.c @@ -2243,6 +2243,10 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, btrfs_wait_ordered_range(src, off, len); } + /* truncate page cache pages from target inode range */ + truncate_inode_pages_range(&inode->i_data, off, + ((off+len+PAGE_CACHE_SIZE-1)&PAGE_CACHE_MASK)-1); + /* clone data */ key.objectid = btrfs_ino(src); key.type = BTRFS_EXTENT_DATA_KEY; -- 1.7.0 -- 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://v...
2012 Dec 18
0
[PATCH] [RFC] Btrfs: Subpagesize blocksize (WIP).
.../fs/btrfs/extent_io.c @@ -2519,7 +2519,7 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree, int contig = 0; int this_compressed = bio_flags & EXTENT_BIO_COMPRESSED; int old_compressed = prev_bio_flags & EXTENT_BIO_COMPRESSED; - size_t page_size = min_t(size_t, size, PAGE_CACHE_SIZE); + size_t bio_size = min_t(size_t, size, PAGE_CACHE_SIZE); if (bio_ret && *bio_ret) { bio = *bio_ret; @@ -2530,8 +2530,8 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree, sector; if (prev_bio_flags != bio_flags || !contig || - merge_bio(tree, page,...
2013 Oct 25
1
[PATCH] Btrfs: stop using vfs_read in send
...en) +{ + 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); + + if (offset + len > i_size_read(inode)) { + if (offset > i_size_r...
2010 May 07
6
[PATCH 1/5] fs: allow short direct-io reads to be completed via buffered IO V2
V1->V2: Check to see if our current ppos is >= i_size after a short DIO read, just in case it was actually a short read and we need to just return. This is similar to what already happens in the write case. If we have a short read while doing O_DIRECT, instead of just returning, fallthrough and try to read the rest via buffered IO. BTRFS needs this because if we encounter a compressed or
2010 Jul 29
1
[Bug] check return of kmalloc()
...uld be changed not to panic it would be great. --- ./fs/btrfs/compression.c 2010-07-06 16:45:48.000000000 +0400 +++ /tmp/cocci-output-7773-0df3b6-compression.c 2010-07-28 18:43:07.000000000 +0400 @@ -350,7 +350,6 @@ int btrfs_submit_compressed_write(struct int ret; WARN_ON(start & ((u64)PAGE_CACHE_SIZE - 1)); - cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS); atomic_set(&cb->pending_bios, 0); cb->errors = 0; cb->inode = inode; @@ -587,7 +586,6 @@ int btrfs_submit_compressed_read(struct read_unlock(&em_tree->lock); compressed_len = em->block_len...
2010 Jul 12
1
[PATCH] ocfs2: Don't duplicate page passes i_size during CoW.
..._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_index > last_page) + break; + /* from, to is the offset within the page. */ from = offset & (PAGE_CACHE_SIZE - 1); to = PAGE_CACHE_SIZE; -- 1.7.1.571.gba4d01
2010 Dec 07
9
[PATCH] Btrfs: pwrite blocked when writing from the mmaped buffer of the same page
...23 +++++------------------ 1 files changed, 5 insertions(+), 18 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index dfe15dc..c1faded 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -57,15 +57,11 @@ static noinline int btrfs_copy_from_user(loff_t pos, int num_pages, PAGE_CACHE_SIZE - offset, write_bytes); struct page *page = prepared_pages[pg]; again: - /* - * Copy data from userspace to the current page - * - * Disable pagefault to avoid recursive lock since the pages - * are already locked - */ - pagefault_disable(); - copied = iov_iter_copy_from_user_at...
2010 Apr 26
0
[PATCH V2 11/12] Btrfs: Pre-allocate space for data relocation
...mapping); + goto out; - WARN_ON(cluster->start != cluster->boundary[0]); + index = (cluster->start - offset) >> PAGE_CACHE_SHIFT; + last_index = (cluster->end - offset) >> PAGE_CACHE_SHIFT; while (index <= last_index) { + ret = btrfs_delalloc_reserve_metadata(inode, PAGE_CACHE_SIZE); + if (ret) + goto out; + page = find_lock_page(inode->i_mapping, index); if (!page) { page_cache_sync_readahead(inode->i_mapping, @@ -2622,8 +2668,10 @@ static int relocate_file_extent_cluster( last_index + 1 - index); page = grab_cache_page(inode->i_mapping, in...
2010 Jul 16
1
[PATCH] ocfs2: make __ocfs2_page_mkwrite handle file end properly.
__ocfs2_page_mkwrite now is broken in handling file end. 1. the last page should be the page contains i_size - 1. 2. the len in the last page is also calculated wrong. So change them accordingly. Signed-off-by: Tao Ma <tao.ma at oracle.com> --- fs/ocfs2/mmap.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c index
2013 Apr 06
1
[PATCH 3/4] fsfreeze: manage kill signal when sb_start_pagefault is called
...de.c @@ -7559,7 +7559,9 @@ int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) u64 page_start; u64 page_end; - sb_start_pagefault(inode->i_sb); + ret = sb_start_pagefault(inode->i_sb); + if (ret) + return VM_FAULT_RETRY; ret = btrfs_delalloc_reserve_space(inode, PAGE_CACHE_SIZE); if (!ret) { ret = file_update_time(vma->vm_file); diff --git a/fs/buffer.c b/fs/buffer.c index b4dcb34..6d3d2cc 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2383,7 +2383,9 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, int ret; struct super_block *sb = f...
2013 Oct 09
2
[PATCH] Btrfs: add tests for find_lock_delalloc_range
...n"); + goto out_bits; + } + ClearPageDirty(page); + page_cache_release(page); + + /* We unlocked it in the previous test */ + lock_page(locked_page); + start = test_start; + end = 0; + /* + * Currently if we fail to find dirty pages in the delalloc range we + * will adjust max_bytes down to PAGE_CACHE_SIZE and then re-search. If + * this changes at any point in the future we will need to fix this + * tests expected behavior. + */ + found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, + &end, max_bytes); + if (!found) { + test_msg("Didn''t find our rang...
2011 Feb 12
3
[PATCH] fix uncheck memory allocations
...19 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 4d2110e..f596554 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -340,6 +340,8 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, WARN_ON(start & ((u64)PAGE_CACHE_SIZE - 1)); cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS); + if (!cb) + return -ENOMEM; atomic_set(&cb->pending_bios, 0); cb->errors = 0; cb->inode = inode; @@ -354,6 +356,10 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, bdev = BTRFS_I(i...
2011 Feb 15
1
[PATCH] Btrfs: fix uncheck memory allocations
...12 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 4d2110e..992a4b9 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -340,6 +340,8 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, WARN_ON(start & ((u64)PAGE_CACHE_SIZE - 1)); cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS); + if (!cb) + return -ENOMEM; atomic_set(&cb->pending_bios, 0); cb->errors = 0; cb->inode = inode; @@ -354,6 +356,10 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, bdev = BTRFS_I(i...
2012 Feb 13
10
[RFB] add LZ4 compression method to btrfs
Hi, so here it is, LZ4 compression method inside btrfs. The patchset is based on top of current Chris'' for-linus + Andi''s snappy implementation + the fixes from Li Zefan. Passes xfstests and stresstests. I haven''t measured performance on wide range of hardware or workloads, rather wanted to publish the patches before I get distracted again. I''d like to ask