Displaying 20 results from an estimated 77 matches for "i_size_read".
2009 Apr 07
0
[PATCH 1/1] OCFS2: use i_size_read() instead of direct accessing inode->i_size
use i_size_read() instead of accessing inode->i_size directly.
Signed-off-by: Wengang Wang <wen.gang.wang at oracle.com>
--
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index b2c52b3..4491851 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -1920,7 +1920,7 @@ int ocfs2_write_end_nolock(struct addr...
2010 Jul 12
1
[PATCH] ocfs2: Don't duplicate page passes i_size during CoW.
...ss_space *mapping = context->inode->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,
+...
2023 Feb 20
1
[PATCH v2] ocfs2: fix non-auto defrag path not working issue
...e *filp, void __user *argp)
context->range = ⦥
+ /*
+ * ok, the default theshold for the defragmentation
+ * is 1M, since our maximum clustersize was 1M also.
+ * any thought?
+ */
+ if (!range.me_threshold)
+ range.me_threshold = 1024 * 1024;
+
+ if (range.me_threshold > i_size_read(inode))
+ range.me_threshold = i_size_read(inode);
+
if (range.me_flags & OCFS2_MOVE_EXT_FL_AUTO_DEFRAG) {
context->auto_defrag = 1;
- /*
- * ok, the default theshold for the defragmentation
- * is 1M, since our maximum clustersize was 1M also.
- * any thought?
- */
- if (!ra...
2023 Feb 17
1
[PATCH] ocfs2: fix non-auto defrag path not working issue
...e *filp, void __user *argp)
context->range = ⦥
+ /*
+ * ok, the default theshold for the defragmentation
+ * is 1M, since our maximum clustersize was 1M also.
+ * any thought?
+ */
+ if (!range.me_threshold)
+ range.me_threshold = 1024 * 1024;
+
+ if (range.me_threshold > i_size_read(inode))
+ range.me_threshold = i_size_read(inode);
+
if (range.me_flags & OCFS2_MOVE_EXT_FL_AUTO_DEFRAG) {
context->auto_defrag = 1;
- /*
- * ok, the default theshold for the defragmentation
- * is 1M, since our maximum clustersize was 1M also.
- * any thought?
- */
- if (!ra...
2023 Mar 10
1
[PATCH v3 4/6] ext4: convert to use i_blockmask()
...s/ext4/inode.c
> index d251d705c276..eec36520e5e9 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -2218,7 +2218,7 @@ static int mpage_process_page_bufs(struct mpage_da_data *mpd,
> {
> struct inode *inode = mpd->inode;
> int err;
> - ext4_lblk_t blocks = (i_size_read(inode) + i_blocksize(inode) - 1)
> + ext4_lblk_t blocks = (i_size_read(inode) + i_blockmask(inode))
> >> inode->i_blkbits;
Umm... That actually asks for DIV_ROUND_UP(i_size_read_inode(), i_blocksize(inode)) -
compiler should bloody well be able to figure out that division b...
2023 Feb 20
1
[PATCH v2] ocfs2: fix non-auto defrag path not working issue
...= ⦥
>
> + /*
> + * ok, the default theshold for the defragmentation
> + * is 1M, since our maximum clustersize was 1M also.
> + * any thought?
> + */
> + if (!range.me_threshold)
> + range.me_threshold = 1024 * 1024;
> +
> + if (range.me_threshold > i_size_read(inode))
> + range.me_threshold = i_size_read(inode);
> +
> if (range.me_flags & OCFS2_MOVE_EXT_FL_AUTO_DEFRAG) {
> context->auto_defrag = 1;
> - /*
> - * ok, the default theshold for the defragmentation
> - * is 1M, since our maximum clustersize was 1M also.
&...
2023 Feb 28
0
[merged mm-hotfixes-stable] ocfs2-fix-non-auto-defrag-path-not-working-issue.patch removed from -mm tree
...tl_move_extents(struct file
context->range = ⦥
+ /*
+ * ok, the default theshold for the defragmentation
+ * is 1M, since our maximum clustersize was 1M also.
+ * any thought?
+ */
+ if (!range.me_threshold)
+ range.me_threshold = 1024 * 1024;
+
+ if (range.me_threshold > i_size_read(inode))
+ range.me_threshold = i_size_read(inode);
+
if (range.me_flags & OCFS2_MOVE_EXT_FL_AUTO_DEFRAG) {
context->auto_defrag = 1;
- /*
- * ok, the default theshold for the defragmentation
- * is 1M, since our maximum clustersize was 1M also.
- * any thought?
- */
- if (!ra...
2009 Aug 03
1
Non sparse init fix v3
One line fix from Joel's version. Also, some comments removed.
18:58 <sunil> wc->w_first_new_cpos =
18:58 <sunil> - ocfs2_align_bytes_to_clusters(inode->i_sb, i_size_read(inode));
18:58 <sunil> + ocfs2_clusters_for_bytes(inode->i_sb, i_size_read(inode));
2023 Mar 06
0
Patch "ocfs2: fix non-auto defrag path not working issue" has been added to the 6.2-stable tree
...tl_move_extents(struct file
context->range = ⦥
+ /*
+ * ok, the default theshold for the defragmentation
+ * is 1M, since our maximum clustersize was 1M also.
+ * any thought?
+ */
+ if (!range.me_threshold)
+ range.me_threshold = 1024 * 1024;
+
+ if (range.me_threshold > i_size_read(inode))
+ range.me_threshold = i_size_read(inode);
+
if (range.me_flags & OCFS2_MOVE_EXT_FL_AUTO_DEFRAG) {
context->auto_defrag = 1;
- /*
- * ok, the default theshold for the defragmentation
- * is 1M, since our maximum clustersize was 1M also.
- * any thought?
- */
- if (!ra...
2023 Mar 06
0
Patch "ocfs2: fix non-auto defrag path not working issue" has been added to the 6.1-stable tree
...tl_move_extents(struct file
context->range = ⦥
+ /*
+ * ok, the default theshold for the defragmentation
+ * is 1M, since our maximum clustersize was 1M also.
+ * any thought?
+ */
+ if (!range.me_threshold)
+ range.me_threshold = 1024 * 1024;
+
+ if (range.me_threshold > i_size_read(inode))
+ range.me_threshold = i_size_read(inode);
+
if (range.me_flags & OCFS2_MOVE_EXT_FL_AUTO_DEFRAG) {
context->auto_defrag = 1;
- /*
- * ok, the default theshold for the defragmentation
- * is 1M, since our maximum clustersize was 1M also.
- * any thought?
- */
- if (!ra...
2023 Mar 06
0
Patch "ocfs2: fix non-auto defrag path not working issue" has been added to the 5.15-stable tree
...tl_move_extents(struct file
context->range = ⦥
+ /*
+ * ok, the default theshold for the defragmentation
+ * is 1M, since our maximum clustersize was 1M also.
+ * any thought?
+ */
+ if (!range.me_threshold)
+ range.me_threshold = 1024 * 1024;
+
+ if (range.me_threshold > i_size_read(inode))
+ range.me_threshold = i_size_read(inode);
+
if (range.me_flags & OCFS2_MOVE_EXT_FL_AUTO_DEFRAG) {
context->auto_defrag = 1;
- /*
- * ok, the default theshold for the defragmentation
- * is 1M, since our maximum clustersize was 1M also.
- * any thought?
- */
- if (!ra...
2023 Mar 06
0
Patch "ocfs2: fix non-auto defrag path not working issue" has been added to the 5.4-stable tree
...tl_move_extents(struct file
context->range = ⦥
+ /*
+ * ok, the default theshold for the defragmentation
+ * is 1M, since our maximum clustersize was 1M also.
+ * any thought?
+ */
+ if (!range.me_threshold)
+ range.me_threshold = 1024 * 1024;
+
+ if (range.me_threshold > i_size_read(inode))
+ range.me_threshold = i_size_read(inode);
+
if (range.me_flags & OCFS2_MOVE_EXT_FL_AUTO_DEFRAG) {
context->auto_defrag = 1;
- /*
- * ok, the default theshold for the defragmentation
- * is 1M, since our maximum clustersize was 1M also.
- * any thought?
- */
- if (!ra...
2023 Mar 06
0
Patch "ocfs2: fix non-auto defrag path not working issue" has been added to the 4.19-stable tree
...tl_move_extents(struct file
context->range = ⦥
+ /*
+ * ok, the default theshold for the defragmentation
+ * is 1M, since our maximum clustersize was 1M also.
+ * any thought?
+ */
+ if (!range.me_threshold)
+ range.me_threshold = 1024 * 1024;
+
+ if (range.me_threshold > i_size_read(inode))
+ range.me_threshold = i_size_read(inode);
+
if (range.me_flags & OCFS2_MOVE_EXT_FL_AUTO_DEFRAG) {
context->auto_defrag = 1;
- /*
- * ok, the default theshold for the defragmentation
- * is 1M, since our maximum clustersize was 1M also.
- * any thought?
- */
- if (!ra...
2023 Feb 23
0
+ ocfs2-fix-non-auto-defrag-path-not-working-issue.patch added to mm-hotfixes-unstable branch
...tl_move_extents(struct file
context->range = ⦥
+ /*
+ * ok, the default theshold for the defragmentation
+ * is 1M, since our maximum clustersize was 1M also.
+ * any thought?
+ */
+ if (!range.me_threshold)
+ range.me_threshold = 1024 * 1024;
+
+ if (range.me_threshold > i_size_read(inode))
+ range.me_threshold = i_size_read(inode);
+
if (range.me_flags & OCFS2_MOVE_EXT_FL_AUTO_DEFRAG) {
context->auto_defrag = 1;
- /*
- * ok, the default theshold for the defragmentation
- * is 1M, since our maximum clustersize was 1M also.
- * any thought?
- */
- if (!ra...
2011 Nov 29
3
[PATCH] fs: push file_update_time into ->page_mkwrite
...215f..c272b91 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6313,6 +6313,7 @@ int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
}
ret = VM_FAULT_NOPAGE; /* make the VM retry the fault */
+ file_update_time(vma->vm_file);
again:
lock_page(page);
size = i_size_read(inode);
diff --git a/fs/buffer.c b/fs/buffer.c
index 1a80b04..c949a11 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2347,6 +2347,7 @@ int __block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
loff_t size;
int ret;
+ file_update_time(vma->vm_file);
lock_page(page);
siz...
2023 Mar 09
8
[PATCH v3 1/6] fs: add i_blockmask()
Introduce i_blockmask() to simplify code, which replace
(i_blocksize(node) - 1). Like done in commit
93407472a21b("fs: add i_blocksize()").
Signed-off-by: Yangtao Li <frank.li at vivo.com>
---
v3:
-none
v2:
-convert to i_blockmask()
include/linux/fs.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c85916e9f7db..17387d465b8b
2013 Oct 25
1
[PATCH] Btrfs: stop using vfs_read in send
...nsigned 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_read(inode))
+ len = 0;
+ else
+ len = offset - i_size_read(inode);
+ }
+ if (len == 0)
+ goto out;
+
+ last_index = (offset + len - 1) >> PAGE_CACHE_SHIFT;
+ while (index <= last_index) {
+ unsigned cur_len = min_t(unsigned, len, PAGE_CACHE_SIZE)...
2009 Aug 02
1
Non sparse extend init issue
The patch was created against a 1.4 tree. However, it applies cleanly to mainline too.
The patch has been lightly tested. I am running fill_verify_holes on a non sparse volume
currently.
Please review.
Sunil
2007 Sep 19
1
[PATCH 06/15] ocfs2: Remove open coded readdir()
.../*
+ * This is intended to be called from inside other kernel functions,
+ * so we fake some arguments.
+ */
+int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv,
+ filldir_t filldir)
+{
+ int ret = 0;
+ unsigned long version = inode->i_version;
+
+ while (*f_pos < i_size_read(inode)) {
+ ret = ocfs2_dir_foreach_blk(inode, &version, f_pos, priv,
+ filldir);
+ if (ret)
+ break;
+ }
+
+ return 0;
+}
+
+/*
* ocfs2_readdir()
*
*/
diff --git a/fs/ocfs2/dir.h b/fs/ocfs2/dir.h
index 7bf9c0a..075d0e9 100644
--- a/fs/ocfs2/dir.h
+++ b/fs/ocfs2/dir.h
@@ -62,6...
2009 Jul 13
1
[PATCH 1/1] adds mlogs to aops.c
...}
@@ -191,7 +191,9 @@ static int ocfs2_get_block(struct inode *inode, sector_t iblock,
(unsigned long long)iblock,
(unsigned long long)p_blkno,
(unsigned long long)OCFS2_I(inode)->ip_blkno);
- mlog(ML_ERROR, "Size %llu, clusters %u\n", (unsigned long long)i_size_read(inode), OCFS2_I(inode)->ip_clusters);
+ mlog(ML_ERROR, "Size %llu, clusters %u\n",
+ (unsigned long long)i_size_read(inode),
+ OCFS2_I(inode)->ip_clusters);
dump_stack();
}
@@ -217,11 +219,16 @@ int ocfs2_read_inline_data(struct inode *inode, struct page *pa...