Lines Matching refs:ri
37 struct jffs2_raw_inode *ri; in jffs2_do_setattr() local
78 ri = jffs2_alloc_raw_inode(); in jffs2_do_setattr()
79 if (!ri) { in jffs2_do_setattr()
85 ret = jffs2_reserve_space(c, sizeof(*ri) + mdatalen, &alloclen, in jffs2_do_setattr()
88 jffs2_free_raw_inode(ri); in jffs2_do_setattr()
96 ri->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); in jffs2_do_setattr()
97 ri->nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE); in jffs2_do_setattr()
98 ri->totlen = cpu_to_je32(sizeof(*ri) + mdatalen); in jffs2_do_setattr()
99 ri->hdr_crc = cpu_to_je32(crc32(0, ri, sizeof(struct jffs2_unknown_node)-4)); in jffs2_do_setattr()
101 ri->ino = cpu_to_je32(inode->i_ino); in jffs2_do_setattr()
102 ri->version = cpu_to_je32(++f->highest_version); in jffs2_do_setattr()
104 ri->uid = cpu_to_je16((ivalid & ATTR_UID)? in jffs2_do_setattr()
106 ri->gid = cpu_to_je16((ivalid & ATTR_GID)? in jffs2_do_setattr()
110 ri->mode = cpu_to_jemode(iattr->ia_mode); in jffs2_do_setattr()
112 ri->mode = cpu_to_jemode(inode->i_mode); in jffs2_do_setattr()
115 ri->isize = cpu_to_je32((ivalid & ATTR_SIZE)?iattr->ia_size:inode->i_size); in jffs2_do_setattr()
116 ri->atime = cpu_to_je32(I_SEC((ivalid & ATTR_ATIME)?iattr->ia_atime:inode->i_atime)); in jffs2_do_setattr()
117 ri->mtime = cpu_to_je32(I_SEC((ivalid & ATTR_MTIME)?iattr->ia_mtime:inode->i_mtime)); in jffs2_do_setattr()
118 ri->ctime = cpu_to_je32(I_SEC((ivalid & ATTR_CTIME)?iattr->ia_ctime:inode->i_ctime)); in jffs2_do_setattr()
120 ri->offset = cpu_to_je32(0); in jffs2_do_setattr()
121 ri->csize = ri->dsize = cpu_to_je32(mdatalen); in jffs2_do_setattr()
122 ri->compr = JFFS2_COMPR_NONE; in jffs2_do_setattr()
125 ri->compr = JFFS2_COMPR_ZERO; in jffs2_do_setattr()
126 ri->dsize = cpu_to_je32(iattr->ia_size - inode->i_size); in jffs2_do_setattr()
127 ri->offset = cpu_to_je32(inode->i_size); in jffs2_do_setattr()
133 ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8)); in jffs2_do_setattr()
135 ri->data_crc = cpu_to_je32(crc32(0, mdata, mdatalen)); in jffs2_do_setattr()
137 ri->data_crc = cpu_to_je32(0); in jffs2_do_setattr()
139 new_metadata = jffs2_write_dnode(c, f, ri, mdata, mdatalen, alloc_type); in jffs2_do_setattr()
145 jffs2_free_raw_inode(ri); in jffs2_do_setattr()
150 inode->i_atime = ITIME(je32_to_cpu(ri->atime)); in jffs2_do_setattr()
151 inode->i_ctime = ITIME(je32_to_cpu(ri->ctime)); in jffs2_do_setattr()
152 inode->i_mtime = ITIME(je32_to_cpu(ri->mtime)); in jffs2_do_setattr()
153 inode->i_mode = jemode_to_cpu(ri->mode); in jffs2_do_setattr()
154 i_uid_write(inode, je16_to_cpu(ri->uid)); in jffs2_do_setattr()
155 i_gid_write(inode, je16_to_cpu(ri->gid)); in jffs2_do_setattr()
175 jffs2_free_raw_inode(ri); in jffs2_do_setattr()
423 struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, struct jffs2_raw_inode *ri) in jffs2_new_inode() argument
445 memset(ri, 0, sizeof(*ri)); in jffs2_new_inode()
447 ri->uid = cpu_to_je16(from_kuid(&init_user_ns, current_fsuid())); in jffs2_new_inode()
450 ri->gid = cpu_to_je16(i_gid_read(dir_i)); in jffs2_new_inode()
454 ri->gid = cpu_to_je16(from_kgid(&init_user_ns, current_fsgid())); in jffs2_new_inode()
466 ret = jffs2_do_new_inode (c, f, mode, ri); in jffs2_new_inode()
474 inode->i_ino = je32_to_cpu(ri->ino); in jffs2_new_inode()
475 inode->i_mode = jemode_to_cpu(ri->mode); in jffs2_new_inode()
476 i_gid_write(inode, je16_to_cpu(ri->gid)); in jffs2_new_inode()
477 i_uid_write(inode, je16_to_cpu(ri->uid)); in jffs2_new_inode()
479 ri->atime = ri->mtime = ri->ctime = cpu_to_je32(I_SEC(inode->i_mtime)); in jffs2_new_inode()