/*
* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU General Public License version 2.
*/
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/completion.h>
#include <linux/buffer_head.h>
#include <linux/posix_acl.h>
#include <linux/sort.h>
#include <linux/gfs2_ondisk.h>
#include <linux/crc32.h>
#include <linux/lm_interface.h>
#include "gfs2.h"
#include "incore.h"
#include "acl.h"
#include "bmap.h"
#include "dir.h"
#include "eattr.h"
#include "glock.h"
#include "glops.h"
#include "inode.h"
#include "log.h"
#include "meta_io.h"
#include "ops_address.h"
#include "ops_file.h"
#include "ops_inode.h"
#include "quota.h"
#include "rgrp.h"
#include "trans.h"
#include "util.h"
/**
* gfs2_inode_attr_in - Copy attributes from the dinode into the VFS inode
* @ip: The GFS2 inode (with embedded disk inode data)
* @inode: The Linux VFS inode
*
*/
void gfs2_inode_attr_in(struct gfs2_inode *ip)
{
struct inode *inode = &ip->i_inode;
struct gfs2_dinode *di = &ip->i_di;
inode->i_ino = ip->i_num.no_addr;
switch (di->di_mode & S_IFMT) {
case S_IFBLK:
case S_IFCHR:
inode->i_rdev = MKDEV(di->di_major, di->di_minor);
break;
default:
inode->i_rdev = 0;
break;
};
inode->i_mode = di->di_mode;
inode->i_nlink = di->di_nlink;
inode->i_uid = di->di_uid;
inode->i_gid = di->di_gid;
i_size_write(inode, di->di_size);
inode->i_atime.tv_sec = di->di_atime;
inode->i_mtime.tv_sec = di->di_mtime;
inode->i_ctime.tv_sec = di->di_ctime;
inode->i_atime.tv_nsec = 0;
inode->i_mtime.tv_nsec = 0;
inode->i_ctime.tv_nsec = 0;
inode->i_blocks = di->di_blocks <<
(GFS2_SB(inode)->sd_sb.sb_bsize_shift - GFS2_BASIC_BLOCK_SHIFT