search for: nrptrs

Displaying 7 results from an estimated 7 matches for "nrptrs".

Did you mean: nptrs
2009 Jul 06
1
[Patch v3] btrfs: use file_remove_suid() after i_mutex is held
....ma@oracle.com> --- diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 7c3cd24..e7b0d81 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -944,14 +944,19 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf, if (count == 0) goto out_nolock; + pages = kmalloc(nrptrs * sizeof(struct page *), GFP_KERNEL); + if (!pages) { + err = -ENOMEM; + goto out_nolock; + } + + mutex_lock(&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_KER...
2009 Jul 06
2
[Patch v2] btrfs: use file_remove_suid() after i_mutex is held
...jeffm@suse.com> --- diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 7c3cd24..09ef5d6 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -944,14 +944,17 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf, if (count == 0) goto out_nolock; + pages = kmalloc(nrptrs * sizeof(struct page *), GFP_KERNEL); + if (!pages) + goto out_nolock; + + mutex_lock(&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(&am...
2008 Jul 03
2
iozone remove_suid oops...
...t *ppos) { loff_t pos; loff_t start_pos; ssize_t num_written = 0; 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; i...
2009 Jul 06
2
[Patch] btrfs: use file_remove_suid() after i_mutex is held
...@@ -944,14 +944,17 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf, if (count == 0) goto out_nolock; + mutex_lock(&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); + 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 "unsu...
2010 Jul 29
1
[Bug] check return of kmalloc()
...FS); ins_sizes = (u32 *)ins_data; ins_keys = (struct btrfs_key *)(ins_data + nr * sizeof(u32)); --- ./fs/btrfs/file.c 2010-07-09 15:55:34.000000000 +0400 +++ /tmp/cocci-output-7826-b84666-file.c 2010-07-28 18:43:13.000000000 +0400 @@ -925,7 +925,6 @@ static ssize_t btrfs_file_aio_write(stru nrptrs = min((iov_iter_count(&i) + PAGE_CACHE_SIZE - 1) / PAGE_CACHE_SIZE, PAGE_CACHE_SIZE / (sizeof(struct page *))); - pages = kmalloc(nrptrs * sizeof(struct page *), GFP_KERNEL); /* generic_write_checks can change our pos */ start_pos = pos; --- ./fs/btrfs/inode.c 2010-07-28 0...
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
2011 Jul 12
0
[PATCH] Btrfs: Remove unused variable 'last_index' in file.c
...nt_state *cached_state = NULL; int i; @@ -1159,7 +1159,6 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file, struct btrfs_root *root = BTRFS_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 = p...