1/* 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ffs_subr.c 8.5 (Berkeley) 3/21/95 |
34 * $FreeBSD: head/sys/ufs/ffs/ffs_subr.c 108315 2002-12-27 10:23:03Z phk $ |
35 */ 36 37#include <sys/param.h> 38 39#ifndef _KERNEL 40#include <ufs/ufs/dinode.h> 41#include <ufs/ffs/fs.h> 42#include "fsck.h" --- 57 unchanged lines hidden (view full) --- 100 return (0); 101} 102 103/* 104 * Load up the contents of an inode and copy the appropriate pieces 105 * to the incore copy. 106 */ 107void |
108ffs_load_inode(bp, ip, fs, ino) |
109 struct buf *bp; 110 struct inode *ip; |
111 struct fs *fs; 112 ino_t ino; 113{ 114 115 if (ip->i_ump->um_fstype == UFS1) { |
116 *ip->i_din1 = 117 *((struct ufs1_dinode *)bp->b_data + ino_to_fsbo(fs, ino)); 118 ip->i_mode = ip->i_din1->di_mode; 119 ip->i_nlink = ip->i_din1->di_nlink; 120 ip->i_size = ip->i_din1->di_size; 121 ip->i_flags = ip->i_din1->di_flags; 122 ip->i_gen = ip->i_din1->di_gen; 123 ip->i_uid = ip->i_din1->di_uid; 124 ip->i_gid = ip->i_din1->di_gid; 125 } else { |
126 *ip->i_din2 = 127 *((struct ufs2_dinode *)bp->b_data + ino_to_fsbo(fs, ino)); 128 ip->i_mode = ip->i_din2->di_mode; 129 ip->i_nlink = ip->i_din2->di_nlink; 130 ip->i_size = ip->i_din2->di_size; 131 ip->i_flags = ip->i_din2->di_flags; 132 ip->i_gen = ip->i_din2->di_gen; 133 ip->i_uid = ip->i_din2->di_uid; --- 158 unchanged lines hidden --- |