Displaying 20 results from an estimated 22 matches for "last_index".
2010 Jul 16
1
[PATCH] ocfs2: make __ocfs2_page_mkwrite handle file end properly.
....c
@@ -74,9 +74,11 @@ static 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, struc...
2011 Jul 12
0
[PATCH] Btrfs: Remove unused variable 'last_index' in file.c
The variable ''last_index'' is calculated in the __btrfs_buffered_write
function and passed as a parameter to the prepare_pages function,
but is not used anywhere in the prepare_pages function.
Remove instances of ''last_index'' in these functions.
Signed-off-by: Mitch Harder <mitch.harder@sabay...
2012 Oct 16
3
[PATCH] Change the check for PageReadahead into an else-if
.../relocation.c
+++ b/fs/btrfs/relocation.c
@@ -2996,12 +2996,10 @@ static int relocate_file_extent_cluster(struct inode *inode,
ret = -ENOMEM;
goto out;
}
- }
-
- if (PageReadahead(page)) {
- page_cache_async_readahead(inode->i_mapping,
- ra, NULL, page, index,
- last_index + 1 - index);
+ } else if (PageReadahead(page)) {
+ page_cache_async_readahead(inode->i_mapping,
+ ra, NULL, page, index,
+ last_index + 1 - index);
}
if (!PageUptodate(page)) {
diff --git a/mm/filemap.c b/mm/filemap.c
index 3843445..d703224 100644
--- a/mm/filemap.c
+++...
2010 Apr 26
0
[PATCH V2 11/12] Btrfs: Pre-allocate space for data relocation
...->i_mutex);
+ return ret;
+}
+
+static noinline_for_stack
int setup_extent_mapping(struct inode *inode, u64 start, u64 end,
u64 block_start)
{
@@ -2587,7 +2631,6 @@ static int relocate_file_extent_cluster(
u64 offset = BTRFS_I(inode)->index_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)...
2013 Oct 25
1
[PATCH] Btrfs: stop using vfs_read in send
...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);
+
+ if (offset + len...
2010 Dec 07
9
[PATCH] Btrfs: pwrite blocked when writing from the mmaped buffer of the same page
.../*
- * fault pages before locking them in prepare_pages
- * to avoid recursive lock
- */
- if (unlikely(iov_iter_fault_in_readable(&i, write_bytes))) {
- ret = -EFAULT;
- goto out;
- }
-
ret = prepare_pages(root, file, pages, num_pages,
pos, first_index, last_index,
write_bytes);
--
1.6.2.2
--
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
2009 Jul 06
1
[Patch v3] btrfs: use file_remove_suid() after i_mutex is held
..._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
2008 Jul 03
2
iozone remove_suid oops...
...ssize_t err = 0;
int ret = 0;
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;
sta...
2007 Apr 16
0
7 commits - libswfdec/swfdec_codec_gst.c libswfdec/swfdec_font.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_morph_movie.c libswfdec/swfdec_pattern.c libswfdec/swfdec_pattern.h libswfdec/swfdec_shape.c libswfdec/swfdec_shape.h libswfdec/swfdec_sprite.c
...;, NULL, 0},
};
diff --git a/test/dump.c b/test/dump.c
index 9c0475e..96f9328 100644
--- a/test/dump.c
+++ b/test/dump.c
@@ -188,17 +188,22 @@ dump_shape (SwfdecShape *shape)
shapevec = &g_array_index (shape->vecs, SwfdecShapeVec, i);
g_print(" %3u: ", shapevec->last_index);
- if (shapevec->pattern == NULL) {
- g_print ("not filled\n");
- } else {
- char *str = swfdec_pattern_to_string (shapevec->pattern);
+ if (SWFDEC_IS_PATTERN (shapevec->pattern)) {
+ SwfdecPattern *pattern = shapevec->pattern;
+ char *str = swfde...
2011 Jan 06
3
Offline Deduplication for Btrfs V2
Just a quick update, I''ve dropped the hashing stuff in favor of doing a memcmp
in the kernel to make sure the data is still the same. The thing that takes a
while is reading the data up from disk, so doing a memcmp of the entire buffer
isn''t that big of a deal, not to mention there''s a possiblity for malicious
users if there is a problem with the hashing algorithms we
2011 Mar 31
4
[PATCH] Btrfs: fix free space cache when there are pinned extents and clusters
...*pos, *n;
struct page *page;
struct extent_state *cached_state = NULL;
+ struct btrfs_free_cluster *cluster = NULL;
+ struct extent_io_tree *unpin = NULL;
struct list_head bitmap_list;
struct btrfs_key key;
+ u64 start, end, len;
u64 bytes = 0;
u32 *crc, *checksums;
pgoff_t index = 0, last_index = 0;
@@ -505,6 +521,7 @@ int btrfs_write_out_cache(struct btrfs_root *root,
int entries = 0;
int bitmaps = 0;
int ret = 0;
+ bool next_page = false;
root = root->fs_info->tree_root;
@@ -551,6 +568,18 @@ int btrfs_write_out_cache(struct btrfs_root *root,
*/
first_page_offset =...
2009 Jul 06
2
[Patch] btrfs: use file_remove_suid() after i_mutex is held
...ove_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 Jul 24
1
[PATCH v4] Btrfs: Check INCOMPAT flags on remount and add helper function
...btrfs/ioctl.c
@@ -1042,11 +1042,9 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
u64 newer_than, unsigned long max_to_defrag)
{
struct btrfs_root *root = BTRFS_I(inode)->root;
- struct btrfs_super_block *disk_super;
struct file_ra_state *ra = NULL;
unsigned long last_index;
u64 isize = i_size_read(inode);
- u64 features;
u64 last_len = 0;
u64 skip = 0;
u64 defrag_end = 0;
@@ -1233,11 +1231,8 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
mutex_unlock(&inode->i_mutex);
}
- disk_super = root->fs_info->super_copy;
- features...
2009 Jul 06
2
[Patch v2] btrfs: use file_remove_suid() after i_mutex is held
..._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
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
2019 Feb 14
3
32 seconds vs 72 minutes -- expected performance difference?
Saurabh Nanda <saurabhnanda at gmail.com> writes:
> I found something interesting in /proc/fs/cifs/Stats. Notice the
> "QueryDirectories > Failed" number. This keeps increasing as along as `ls
> -lR` is running.
That's interesting indeed. The verbose logs and network trace would tell
us more.
--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97
2019 Feb 15
0
32 seconds vs 72 minutes -- expected performance difference?
...sc.c: SMB2 len 16370
Feb 15 05:43:23 prod-backoffice kernel: [57211.548458]
/build/linux-Y38gIP/linux-4.15.0/fs/cifs/transport.c: cifs_sync_mid_result:
cmd=14 mid=11915 state=4
Feb 15 05:43:23 prod-backoffice kernel: [57211.554266]
/build/linux-Y38gIP/linux-4.15.0/fs/cifs/smb2pdu.c: num entries 185
last_index 185 srch start 00000000d950f9ad srch end 00000000df0e5967
Feb 15 05:43:23 prod-backoffice kernel: [57211.567057]
/build/linux-Y38gIP/linux-4.15.0/fs/cifs/readdir.c: initiate cifs search rc
0
Feb 15 05:43:23 prod-backoffice kernel: [57211.570155]
/build/linux-Y38gIP/linux-4.15.0/fs/cifs/smb2misc.c:...
2011 Jun 13
5
3.0.0-rc2: Xen: High amount of kernel "reserved" memory, about 33% in 256MB DOMU
Hi,
another issue I''m seeing with 3.0-rc2 and Xen is that there is an
unexpectedly high amount of kernel reserved memory.
I suspect that Linux allocates page table entries and corresponding
data structures for the whole 6GB areas of the provided ''physical
RAM map'' even though it has rather big unusable holes in it.
[ 0.000000] BIOS-provided physical RAM map:
[
2012 Sep 28
0
Wine release 1.5.14
...sed to_boolean.
jscript: Always use jsval-based to_number implementation.
jscript: Always use jsval-based to_uint32 implementation.
jscript: Always use jsval-based to_string implementation.
jscript: Always use jsval-based to_object implementation.
jscript: Store regexp last_index value as jsval.
jscript: Get rid of no longer needed VARIANT helpers.
jscript: Store Boolean object's value as BOOL instead of VARIANT_BOOL.
jscript: Return BOOL instead of VARIANT_BOOL from jsdisp_is_own_prop.
jscript: Use BOOL instead of VARIANT_BOOL in a few more plac...
2011 Jan 05
52
Offline Deduplication for Btrfs
Here are patches to do offline deduplication for Btrfs. It works well for the
cases it''s expected to, I''m looking for feedback on the ioctl interface and
such, I''m well aware there are missing features for the userspace app (like
being able to set a different blocksize). If this interface is acceptable I
will flesh out the userspace app a little more, but I believe the