search for: i_blkbits

Displaying 20 results from an estimated 22 matches for "i_blkbits".

2023 Mar 10
5
[PATCH v4 1/5] fs: add i_blockmask()
...+++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index c85916e9f7db..17387d465b8b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -711,6 +711,11 @@ static inline unsigned int i_blocksize(const struct inode *node) return (1 << node->i_blkbits); } +static inline unsigned int i_blockmask(const struct inode *node) +{ + return i_blocksize(node) - 1; +} + static inline int inode_unhashed(struct inode *inode) { return hlist_unhashed(&inode->i_hash); -- 2.25.1
2023 Mar 10
3
[PATCH v3 2/6] erofs: convert to use i_blockmask()
On Thu, Mar 09, 2023 at 11:21:23PM +0800, Yangtao Li wrote: > Use i_blockmask() to simplify code. Umm... What's the branchpoint for that series? Not the mainline - there we have i_blocksize() open-coded... > Signed-off-by: Yangtao Li <frank.li at vivo.com> > --- > v3: > -none > v2: > -convert to i_blockmask() > fs/erofs/data.c | 2 +- > 1 file changed, 1
2023 Mar 10
1
[PATCH v3 4/6] ext4: convert to use i_blockmask()
...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 by (1 << n) is shift down by n and it's easier to follow that way...
2023 Mar 09
8
[PATCH v3 1/6] fs: add i_blockmask()
...+++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index c85916e9f7db..17387d465b8b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -711,6 +711,11 @@ static inline unsigned int i_blocksize(const struct inode *node) return (1 << node->i_blkbits); } +static inline unsigned int i_blockmask(const struct inode *node) +{ + return i_blocksize(node) - 1; +} + static inline int inode_unhashed(struct inode *inode) { return hlist_unhashed(&inode->i_hash); -- 2.25.1
2023 Mar 10
1
erofs: convert to use i_blockmask()
...be able to figure out that division by (1 << n) > > is shift down by n and it's easier to follow that way... > > So it seems better to change to DIV_ROUND_UP(i_size_read_inode(), i_blocksize(inode))? > > > And the fact that the value will be the same (i.e. that ->i_blkbits is never changed by ocfs2) > > is worth mentioning in commit message... > > How about the following msg? > > Use i_blockmask() to simplify code. BTW convert ocfs2_is_io_unaligned > to return bool type and the fact that the value will be the same > (i.e. that ->i_blkbits...
2023 Mar 10
1
[PATCH v4 2/5] erofs: convert to use i_blockmask()
....c index e16545849ea7..d394102ef9de 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -376,7 +376,7 @@ static ssize_t erofs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) if (bdev) blksize_mask = bdev_logical_block_size(bdev) - 1; else - blksize_mask = (1 << inode->i_blkbits) - 1; + blksize_mask = i_blockmask(inode); if ((iocb->ki_pos | iov_iter_count(to) | iov_iter_alignment(to)) & blksize_mask) -- 2.25.1
2023 Jun 18
11
[PATCH v1 0/5] clean up block_commit_write
*** BLURB HERE *** Bean Huo (5): fs/buffer: clean up block_commit_write fs/buffer.c: convert block_commit_write to return void ext4: No need to check return value of block_commit_write() fs/ocfs2: No need to check return value of block_commit_write() udf: No need to check return value of block_commit_write() fs/buffer.c | 24 +++++++-----------------
2023 Mar 09
5
[PATCH v2 1/5] fs: add i_blockmask()
...+++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index c85916e9f7db..17387d465b8b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -711,6 +711,11 @@ static inline unsigned int i_blocksize(const struct inode *node) return (1 << node->i_blkbits); } +static inline unsigned int i_blockmask(const struct inode *node) +{ + return i_blocksize(node) - 1; +} + static inline int inode_unhashed(struct inode *inode) { return hlist_unhashed(&inode->i_hash); -- 2.25.1
2023 Mar 10
0
[PATCH v4 4/5] ocfs2: convert to use i_blockmask()
On 3/10/23 1:48 PM, Yangtao Li wrote: > Use i_blockmask() to simplify code. BTW convert ocfs2_is_io_unaligned > to return bool type and the fact that the value will be the same > (i.e. that ->i_blkbits is never changed by ocfs2). > > Signed-off-by: Yangtao Li <frank.li at vivo.com> > --- > fs/ocfs2/file.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c > index efb09de4343d..7fd06a4d27d4 100644 &gt...
2023 Mar 10
1
[PATCH v4 2/5] erofs: convert to use i_blockmask()
...0644 > --- a/fs/erofs/data.c > +++ b/fs/erofs/data.c > @@ -376,7 +376,7 @@ static ssize_t erofs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) > if (bdev) > blksize_mask = bdev_logical_block_size(bdev) - 1; > else > - blksize_mask = (1 << inode->i_blkbits) - 1; > + blksize_mask = i_blockmask(inode); > > if ((iocb->ki_pos | iov_iter_count(to) | > iov_iter_alignment(to)) & blksize_mask)
2010 Dec 10
2
Issues with stat() call on CentOS5 vs CentOS4
Dear CentOS, I have recently upgraded several servers from CentOS4 to CentOS5 and I am noticing a strange change to the stat() call. I have written a very small program to test and show the behavior. I am calling stat() against a file which is exported from my NAS and mounted with 32k read/write sizes. [dougalb at centos4 tmp]$ cat my_stat.c #include <unistd.h> #include <stdio.h>
2011 Sep 06
17
ext4 BUG in dom0 Kernel 2.6.32.36
...ex3); 2683 <+++<+++err = ext4_ext_insert_extent(handle, inode, path, ex3, 0); 2684 <+++<+++if (err == -ENOSPC && may_zeroout) { 2685 <+++<+++<+++err = ext4_ext_zeroout(inode, &orig_ex); if max_blocks = 0; it means 2225, mpd->b_size >> mpd->inode->i_blkbits is 0. fs/ext4/inode.c 2220 static int mpage_da_map_blocks(struct mpage_da_data *mpd) 2221 { 2222 <+++int err, blks, get_blocks_flags; 2223 <+++struct buffer_head new; 2224 <+++sector_t next = mpd->b_blocknr; 2225 <+++unsigned max_blocks = mpd->b_size >> mpd->inode->i...
2009 Jul 13
1
[PATCH 1/1] adds mlogs to aops.c
...they aren't * accessed concurrently from multiple nodes. @@ -555,6 +586,9 @@ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock, unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; unsigned long max_blocks = bh_result->b_size >> inode->i_blkbits; + mlog_entry("(%llu, %llu, 0x%p, %d)\n", OCFS2_I(inode)->ip_blkno, + (unsigned long long)iblock, bh_result, create); + /* This function won't even be called if the request isn't all * nicely aligned and of the right size, so there's no need * for us to check...
2009 Jul 21
1
(no subject)
...they aren't * accessed concurrently from multiple nodes. @@ -555,6 +589,10 @@ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock, unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; unsigned long max_blocks = bh_result->b_size >> inode->i_blkbits; + mlog_entry("(%llu, %llu, 0x%p, %d)\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, + (unsigned long long)iblock, bh_result, create); + /* This function won't even be called if the request isn't all * nicely aligned and of the right size, so there's no...
2010 Apr 26
0
[PATCH V2 11/12] Btrfs: Pre-allocate space for data relocation
...&& !test_bit(EXTENT_FLAG_PREALLOC, &em->flags))) { - ret = prealloc_file_range(inode, - cur_offset, last_byte, - alloc_hint, mode, offset+len); + ret = btrfs_prealloc_file_range(inode, 0, cur_offset, + last_byte - cur_offset, + 1 << inode->i_blkbits, + offset + len, + &alloc_hint); if (ret < 0) { free_extent_map(em); break; } } - if (em->block_start <= EXTENT_MAP_LAST_BYTE) - alloc_hint = em->block_start; free_extent_map(em); cur_offset = last_byte; diff -urp 2/fs/btrfs/relocation.c 3...
2009 Jul 21
1
[PATCH 1/1] ocfs2: adds mlogs to aops.c -V2
...they aren't * accessed concurrently from multiple nodes. @@ -555,6 +589,10 @@ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock, unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; unsigned long max_blocks = bh_result->b_size >> inode->i_blkbits; + mlog_entry("(%llu, %llu, 0x%p, %d)\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, + (unsigned long long)iblock, bh_result, create); + /* This function won't even be called if the request isn't all * nicely aligned and of the right size, so there's no...
2006 Dec 29
3
[git patches] ocfs2 fixes
...*bh_result, int create) { int ret; - u64 vbo_max; /* file offset, max_blocks from iblock */ - u64 p_blkno; + u64 p_blkno, inode_blocks; int contig_blocks; unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; unsigned long max_blocks = bh_result->b_size >> inode->i_blkbits; @@ -550,12 +549,23 @@ static int ocfs2_direct_IO_get_blocks(st * nicely aligned and of the right size, so there's no need * for us to check any of that. */ - vbo_max = ((u64)iblock + max_blocks) << blocksize_bits; - spin_lock(&OCFS2_I(inode)->ip_lock); - if ((iblock + ma...
2023 Jun 21
3
[PATCH 00/79] fs: new accessors for inode->i_ctime
I've been working on a patchset to change how the inode->i_ctime is accessed in order to give us conditional, high-res timestamps for the ctime and mtime. struct timespec64 has unused bits in it that we can use to implement this. In order to do that however, we need to wrap all accesses of inode->i_ctime to ensure that bits used as flags are appropriately handled. This patchset first
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 Aug 15
9
[patch v2 0/9] btrfs: More error handling patches
Hi all - The following 9 patches add more error handling to the btrfs code: - Add btrfs_panic - Catch locking failures in {set,clear}_extent_bit - Push up set_extent_bit errors to callers - Push up lock_extent errors to callers - Push up clear_extent_bit errors to callers - Push up unlock_extent errors to callers - Make pin_down_extent return void - Push up btrfs_pin_extent errors to