Changeset df22c36 in mainline
- Timestamp:
- 2011-03-17T22:24:50Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cfff7a8f
- Parents:
- f213ae7
- Location:
- uspace/srv/fs/minixfs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs.h
rf213ae7 rdf22c36 108 108 109 109 /*mfs_inode.c*/ 110 extern 110 111 struct mfs_inode *mfs_read_inode_raw(const struct mfs_instance *instance, 112 uint16_t inum); 113 extern 114 struct mfs2_inode *mfs2_read_inode_raw(const struct mfs_instance *instance, 111 115 uint32_t inum); 116 112 117 113 118 #endif -
uspace/srv/fs/minixfs/mfs_inode.c
rf213ae7 rdf22c36 5 5 6 6 struct mfs_inode *mfs_read_inode_raw(const struct mfs_instance *instance, 7 uint 32_t inum)7 uint16_t inum) 8 8 { 9 9 struct mfs_inode *ino; … … 24 24 BLOCK_FLAGS_NONE); 25 25 26 memcpy(ino, (struct mfs_ino *) (((uint8_t *) b->data) + 27 inum * ino_size), ino_size); 26 memcpy(ino, ((uint8_t *) b->data) + inum * ino_size, ino_size); 28 27 29 28 ino->i_mode = conv16(sbi->native, ino->i_mode); … … 43 42 } 44 43 44 struct mfs2_inode *mfs2_read_inode_raw(const struct mfs_instance *instance, 45 uint32_t inum) 46 { 47 struct mfs2_inode *ino; 48 struct mfs_sb_info *sbi; 49 block_t *b; 50 int i; 51 52 const size_t ino_size = sizeof(struct mfs2_inode); 53 54 ino = (struct mfs2_inode *) malloc(ino_size); 55 56 if (!ino) 57 return NULL; 58 59 sbi = instance->sbi; 60 61 block_get(&b, instance->handle, 62 2 + inum / V3_INODES_PER_BLOCK(sbi->block_size), 63 BLOCK_FLAGS_NONE); 64 65 memcpy(ino, ((uint8_t *)b->data) + inum * ino_size, ino_size); 66 67 ino->i_mode = conv16(sbi->native, ino->i_mode); 68 ino->i_nlinks = conv16(sbi->native, ino->i_nlinks); 69 ino->i_uid = conv16(sbi->native, ino->i_uid); 70 ino->i_gid = conv16(sbi->native, ino->i_gid); 71 ino->i_size = conv32(sbi->native, ino->i_size); 72 ino->i_atime = conv32(sbi->native, ino->i_atime); 73 ino->i_mtime = conv32(sbi->native, ino->i_mtime); 74 ino->i_ctime = conv32(sbi->native, ino->i_ctime); 75 76 for (i = 0; i < V2_NR_DIRECT_ZONES; ++i) 77 ino->i_dzone[i] = conv32(sbi->native, ino->i_dzone[i]); 78 79 for (i = 0; i < V2_NR_INDIRECT_ZONES; ++i) 80 ino->i_izone[i] = conv32(sbi->native, ino->i_izone[i]); 81 82 block_put(b); 83 84 return ino; 85 } 86
Note:
See TracChangeset
for help on using the changeset viewer.