aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/root-tree.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2013-07-15 23:19:18 -0400
committerChris Mason <chris.mason@fusionio.com>2013-09-01 07:57:37 -0400
commit3cae210fa529d69cb25c2a3c491f29dab687b245 (patch)
tree998853ce555cbabda25eafbc4e8fc9aaa378b693 /fs/btrfs/root-tree.c
parent1e7bac1ef754b3112eb78c64a7382d286e454424 (diff)
btrfs: Cleanup for using BTRFS_SETGET_STACK instead of raw convert
Some codes still use the cpu_to_lexx instead of the BTRFS_SETGET_STACK_FUNCS declared in ctree.h. Also added some BTRFS_SETGET_STACK_FUNCS for btrfs_header btrfs_timespec and other structures. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Reviewed-by: Miao Xie <miaoxie@cn.fujitsu.com> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/root-tree.c')
-rw-r--r--fs/btrfs/root-tree.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
index ffb1036ef10d..70193d0e7058 100644
--- a/fs/btrfs/root-tree.c
+++ b/fs/btrfs/root-tree.c
@@ -490,13 +490,13 @@ again:
490 */ 490 */
491void btrfs_check_and_init_root_item(struct btrfs_root_item *root_item) 491void btrfs_check_and_init_root_item(struct btrfs_root_item *root_item)
492{ 492{
493 u64 inode_flags = le64_to_cpu(root_item->inode.flags); 493 u64 inode_flags = btrfs_stack_inode_flags(&root_item->inode);
494 494
495 if (!(inode_flags & BTRFS_INODE_ROOT_ITEM_INIT)) { 495 if (!(inode_flags & BTRFS_INODE_ROOT_ITEM_INIT)) {
496 inode_flags |= BTRFS_INODE_ROOT_ITEM_INIT; 496 inode_flags |= BTRFS_INODE_ROOT_ITEM_INIT;
497 root_item->inode.flags = cpu_to_le64(inode_flags); 497 btrfs_set_stack_inode_flags(&root_item->inode, inode_flags);
498 root_item->flags = 0; 498 btrfs_set_root_flags(root_item, 0);
499 root_item->byte_limit = 0; 499 btrfs_set_root_limit(root_item, 0);
500 } 500 }
501} 501}
502 502
@@ -507,8 +507,8 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans,
507 struct timespec ct = CURRENT_TIME; 507 struct timespec ct = CURRENT_TIME;
508 508
509 spin_lock(&root->root_item_lock); 509 spin_lock(&root->root_item_lock);
510 item->ctransid = cpu_to_le64(trans->transid); 510 btrfs_set_root_ctransid(item, trans->transid);
511 item->ctime.sec = cpu_to_le64(ct.tv_sec); 511 btrfs_set_stack_timespec_sec(&item->ctime, ct.tv_sec);
512 item->ctime.nsec = cpu_to_le32(ct.tv_nsec); 512 btrfs_set_stack_timespec_nsec(&item->ctime, ct.tv_nsec);
513 spin_unlock(&root->root_item_lock); 513 spin_unlock(&root->root_item_lock);
514} 514}