26 block = __adfs_block_map(inode->
i_sb, inode->
i_ino, block);
28 map_bh(bh, inode->
i_sb, block);
49 loff_t
pos,
unsigned len,
unsigned flags,
50 struct page **pagep,
void **fsdata)
57 &ADFS_I(mapping->
host)->mmu_private);
59 loff_t isize = mapping->
host->i_size;
60 if (pos + len > isize)
73 .readpage = adfs_readpage,
74 .writepage = adfs_writepage,
75 .write_begin = adfs_write_begin,
86 unsigned int attr = ADFS_I(inode)->attr;
95 switch (ADFS_I(inode)->filetype) {
128 adfs_mode2atts(
struct super_block *sb,
struct inode *inode)
136 return ADFS_I(inode)->attr;
165 adfs_adfs2unix_time(
struct timespec *tv,
struct inode *inode)
171 static const s64 nsec_unix_epoch_diff_risc_os_epoch =
172 2208988800000000000
LL;
175 if (ADFS_I(inode)->stamped == 0)
178 high = ADFS_I(inode)->loadaddr & 0xFF;
179 low = ADFS_I(inode)->execaddr;
184 nsec = (((
s64) high << 32) | (
s64) low) * 10000000;
187 if (nsec < nsec_unix_epoch_diff_risc_os_epoch)
191 nsec -= nsec_unix_epoch_diff_risc_os_epoch;
210 adfs_unix2adfs_time(
struct inode *inode,
unsigned int secs)
214 if (ADFS_I(inode)->stamped) {
216 low = (secs & 255) * 100;
217 high = (secs / 256) * 100 + (low >> 8) + 0x336e996a;
219 ADFS_I(inode)->loadaddr = (high >> 24) |
220 (ADFS_I(inode)->loadaddr & ~0xff);
221 ADFS_I(inode)->execaddr = (low & 255) | (high << 8);
246 inode->
i_uid = ADFS_SB(sb)->s_uid;
247 inode->
i_gid = ADFS_SB(sb)->s_gid;
260 ADFS_I(inode)->parent_id = obj->
parent_id;
261 ADFS_I(inode)->loadaddr = obj->
loadaddr;
262 ADFS_I(inode)->execaddr = obj->
execaddr;
263 ADFS_I(inode)->attr = obj->
attr;
264 ADFS_I(inode)->filetype = obj->
filetype;
265 ADFS_I(inode)->stamped = ((obj->
loadaddr & 0xfff00000) == 0xfff00000);
267 inode->
i_mode = adfs_atts2mode(sb, inode);
268 adfs_adfs2unix_time(&inode->
i_mtime, inode);
279 ADFS_I(inode)->mmu_private = inode->
i_size;
282 insert_inode_hash(inode);
296 struct inode *inode = dentry->
d_inode;
298 unsigned int ia_valid = attr->
ia_valid;
307 if ((ia_valid &
ATTR_UID && !uid_eq(attr->
ia_uid, ADFS_SB(sb)->s_uid)) ||
308 (ia_valid &
ATTR_GID && !gid_eq(attr->
ia_gid, ADFS_SB(sb)->s_gid)))
320 adfs_unix2adfs_time(inode, attr->
ia_mtime.tv_sec);
331 ADFS_I(inode)->attr = adfs_mode2atts(sb, inode);
332 inode->
i_mode = adfs_atts2mode(sb, inode);
339 if (ia_valid & (ATTR_SIZE | ATTR_MTIME | ATTR_MODE))
340 mark_inode_dirty(inode);
358 obj.
parent_id = ADFS_I(inode)->parent_id;
359 obj.
loadaddr = ADFS_I(inode)->loadaddr;
360 obj.
execaddr = ADFS_I(inode)->execaddr;
361 obj.
attr = ADFS_I(inode)->attr;