summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2008-10-09 11:46:29 -0400
committerChris Mason <chris.mason@oracle.com>2008-10-09 11:46:29 -0400
commita76a3cd40c1127ca199d4f7f37bf0d541bf44eb2 (patch)
treea91e91d9f67ce8bd314cebdacc458315d3e54275 /fs/btrfs/ctree.h
parenta62b940160d8125016e85046e68ae621c99e751f (diff)
downloadop-kernel-dev-a76a3cd40c1127ca199d4f7f37bf0d541bf44eb2.zip
op-kernel-dev-a76a3cd40c1127ca199d4f7f37bf0d541bf44eb2.tar.gz
Btrfs: Count space allocated to file in bytes
This patch makes btrfs count space allocated to file in bytes instead of 512 byte sectors. Everything else in btrfs uses a byte count instead of sector sizes or blocks sizes, so this fits better. Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 8566eb3..50fbcc9 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -411,7 +411,7 @@ struct btrfs_inode_item {
/* transid that last touched this inode */
__le64 transid;
__le64 size;
- __le64 nblocks;
+ __le64 nbytes;
__le64 block_group;
__le32 nlink;
__le32 uid;
@@ -1017,7 +1017,7 @@ BTRFS_SETGET_FUNCS(inode_ref_index, struct btrfs_inode_ref, index, 64);
BTRFS_SETGET_FUNCS(inode_generation, struct btrfs_inode_item, generation, 64);
BTRFS_SETGET_FUNCS(inode_transid, struct btrfs_inode_item, transid, 64);
BTRFS_SETGET_FUNCS(inode_size, struct btrfs_inode_item, size, 64);
-BTRFS_SETGET_FUNCS(inode_nblocks, struct btrfs_inode_item, nblocks, 64);
+BTRFS_SETGET_FUNCS(inode_nbytes, struct btrfs_inode_item, nbytes, 64);
BTRFS_SETGET_FUNCS(inode_block_group, struct btrfs_inode_item, block_group, 64);
BTRFS_SETGET_FUNCS(inode_nlink, struct btrfs_inode_item, nlink, 32);
BTRFS_SETGET_FUNCS(inode_uid, struct btrfs_inode_item, uid, 32);
@@ -1814,15 +1814,6 @@ void btrfs_invalidate_dcache_root(struct btrfs_root *root, char *name,
int btrfs_merge_bio_hook(struct page *page, unsigned long offset,
size_t size, struct bio *bio);
-static inline void dec_i_blocks(struct inode *inode, u64 dec)
-{
- dec = dec >> 9;
- if (dec <= inode->i_blocks)
- inode->i_blocks -= dec;
- else
- inode->i_blocks = 0;
-}
-
unsigned long btrfs_force_ra(struct address_space *mapping,
struct file_ra_state *ra, struct file *file,
pgoff_t offset, pgoff_t last_index);
OpenPOWER on IntegriCloud