Lines Matching refs:inode
28 adfs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh, in adfs_get_block() argument
35 if (block >= inode->i_blocks) in adfs_get_block()
38 block = __adfs_block_map(inode->i_sb, inode->i_ino, block); in adfs_get_block()
40 map_bh(bh, inode->i_sb, block); in adfs_get_block()
47 adfs_error(inode->i_sb, "block %d < 0", block); in adfs_get_block()
89 adfs_filetype(struct inode *inode) in adfs_filetype() argument
93 if (ADFS_I(inode)->stamped) in adfs_filetype()
94 type = (ADFS_I(inode)->loadaddr >> 8) & 0xfff; in adfs_filetype()
105 adfs_atts2mode(struct super_block *sb, struct inode *inode) in adfs_atts2mode() argument
107 unsigned int filetype, attr = ADFS_I(inode)->attr; in adfs_atts2mode()
116 filetype = adfs_filetype(inode); in adfs_atts2mode()
151 adfs_mode2atts(struct super_block *sb, struct inode *inode) in adfs_mode2atts() argument
158 if (S_ISLNK(inode->i_mode)) in adfs_mode2atts()
159 return ADFS_I(inode)->attr; in adfs_mode2atts()
161 if (S_ISDIR(inode->i_mode)) in adfs_mode2atts()
166 mode = inode->i_mode & asb->s_owner_mask; in adfs_mode2atts()
172 mode = inode->i_mode & asb->s_other_mask; in adfs_mode2atts()
187 adfs_adfs2unix_time(struct timespec *tv, struct inode *inode) in adfs_adfs2unix_time() argument
191 if (ADFS_I(inode)->stamped == 0) in adfs_adfs2unix_time()
194 high = ADFS_I(inode)->loadaddr << 24; in adfs_adfs2unix_time()
195 low = ADFS_I(inode)->execaddr; in adfs_adfs2unix_time()
235 adfs_unix2adfs_time(struct inode *inode, unsigned int secs) in adfs_unix2adfs_time() argument
239 if (ADFS_I(inode)->stamped) { in adfs_unix2adfs_time()
244 ADFS_I(inode)->loadaddr = (high >> 24) | in adfs_unix2adfs_time()
245 (ADFS_I(inode)->loadaddr & ~0xff); in adfs_unix2adfs_time()
246 ADFS_I(inode)->execaddr = (low & 255) | (high << 8); in adfs_unix2adfs_time()
262 struct inode *
265 struct inode *inode; in adfs_iget() local
267 inode = new_inode(sb); in adfs_iget()
268 if (!inode) in adfs_iget()
271 inode->i_uid = ADFS_SB(sb)->s_uid; in adfs_iget()
272 inode->i_gid = ADFS_SB(sb)->s_gid; in adfs_iget()
273 inode->i_ino = obj->file_id; in adfs_iget()
274 inode->i_size = obj->size; in adfs_iget()
275 inode->i_nlink = 2; in adfs_iget()
276 inode->i_blocks = (inode->i_size + sb->s_blocksize - 1) >> in adfs_iget()
285 ADFS_I(inode)->parent_id = obj->parent_id; in adfs_iget()
286 ADFS_I(inode)->loadaddr = obj->loadaddr; in adfs_iget()
287 ADFS_I(inode)->execaddr = obj->execaddr; in adfs_iget()
288 ADFS_I(inode)->attr = obj->attr; in adfs_iget()
289 ADFS_I(inode)->stamped = ((obj->loadaddr & 0xfff00000) == 0xfff00000); in adfs_iget()
291 inode->i_mode = adfs_atts2mode(sb, inode); in adfs_iget()
292 adfs_adfs2unix_time(&inode->i_mtime, inode); in adfs_iget()
293 inode->i_atime = inode->i_mtime; in adfs_iget()
294 inode->i_ctime = inode->i_mtime; in adfs_iget()
296 if (S_ISDIR(inode->i_mode)) { in adfs_iget()
297 inode->i_op = &adfs_dir_inode_operations; in adfs_iget()
298 inode->i_fop = &adfs_dir_operations; in adfs_iget()
299 } else if (S_ISREG(inode->i_mode)) { in adfs_iget()
300 inode->i_op = &adfs_file_inode_operations; in adfs_iget()
301 inode->i_fop = &adfs_file_operations; in adfs_iget()
302 inode->i_mapping->a_ops = &adfs_aops; in adfs_iget()
303 ADFS_I(inode)->mmu_private = inode->i_size; in adfs_iget()
306 insert_inode_hash(inode); in adfs_iget()
309 return inode; in adfs_iget()
320 struct inode *inode = dentry->d_inode; in adfs_notify_change() local
321 struct super_block *sb = inode->i_sb; in adfs_notify_change()
327 error = inode_change_ok(inode, attr); in adfs_notify_change()
341 error = vmtruncate(inode, attr->ia_size); in adfs_notify_change()
347 inode->i_mtime = attr->ia_mtime; in adfs_notify_change()
348 adfs_unix2adfs_time(inode, attr->ia_mtime.tv_sec); in adfs_notify_change()
355 inode->i_atime = attr->ia_atime; in adfs_notify_change()
357 inode->i_ctime = attr->ia_ctime; in adfs_notify_change()
359 ADFS_I(inode)->attr = adfs_mode2atts(sb, inode); in adfs_notify_change()
360 inode->i_mode = adfs_atts2mode(sb, inode); in adfs_notify_change()
368 mark_inode_dirty(inode); in adfs_notify_change()
379 int adfs_write_inode(struct inode *inode, int unused) in adfs_write_inode() argument
381 struct super_block *sb = inode->i_sb; in adfs_write_inode()
386 obj.file_id = inode->i_ino; in adfs_write_inode()
388 obj.parent_id = ADFS_I(inode)->parent_id; in adfs_write_inode()
389 obj.loadaddr = ADFS_I(inode)->loadaddr; in adfs_write_inode()
390 obj.execaddr = ADFS_I(inode)->execaddr; in adfs_write_inode()
391 obj.attr = ADFS_I(inode)->attr; in adfs_write_inode()
392 obj.size = inode->i_size; in adfs_write_inode()