Lines Matching refs:ui
70 const struct ubifs_inode *ui = ubifs_inode(inode); in validate_inode() local
78 if (ui->compr_type >= UBIFS_COMPR_TYPES_CNT) { in validate_inode()
79 ubifs_err(c, "unknown compression type %d", ui->compr_type); in validate_inode()
83 if (ui->xattr_names + ui->xattr_cnt > XATTR_LIST_MAX) in validate_inode()
86 if (ui->data_len < 0 || ui->data_len > UBIFS_MAX_INO_DATA) in validate_inode()
89 if (ui->xattr && !S_ISREG(inode->i_mode)) in validate_inode()
92 if (!ubifs_compr_present(ui->compr_type)) { in validate_inode()
94 inode->i_ino, ubifs_compr_name(ui->compr_type)); in validate_inode()
108 struct ubifs_inode *ui; in ubifs_iget() local
117 ui = ubifs_inode(inode); in ubifs_iget()
147 ui->data_len = le32_to_cpu(ino->data_len); in ubifs_iget()
148 ui->flags = le32_to_cpu(ino->flags); in ubifs_iget()
149 ui->compr_type = le16_to_cpu(ino->compr_type); in ubifs_iget()
150 ui->creat_sqnum = le64_to_cpu(ino->creat_sqnum); in ubifs_iget()
151 ui->xattr_cnt = le32_to_cpu(ino->xattr_cnt); in ubifs_iget()
152 ui->xattr_size = le32_to_cpu(ino->xattr_size); in ubifs_iget()
153 ui->xattr_names = le32_to_cpu(ino->xattr_names); in ubifs_iget()
154 ui->synced_i_size = ui->ui_size = inode->i_size; in ubifs_iget()
156 ui->xattr = (ui->flags & UBIFS_XATTR_FL) ? 1 : 0; in ubifs_iget()
167 if (ui->xattr) { in ubifs_iget()
168 ui->data = kmalloc(ui->data_len + 1, GFP_NOFS); in ubifs_iget()
169 if (!ui->data) { in ubifs_iget()
173 memcpy(ui->data, ino->data, ui->data_len); in ubifs_iget()
174 ((char *)ui->data)[ui->data_len] = '\0'; in ubifs_iget()
175 } else if (ui->data_len != 0) { in ubifs_iget()
183 if (ui->data_len != 0) { in ubifs_iget()
190 if (ui->data_len <= 0 || ui->data_len > UBIFS_MAX_INO_DATA) { in ubifs_iget()
194 ui->data = kmalloc(ui->data_len + 1, GFP_NOFS); in ubifs_iget()
195 if (!ui->data) { in ubifs_iget()
199 memcpy(ui->data, ino->data, ui->data_len); in ubifs_iget()
200 ((char *)ui->data)[ui->data_len] = '\0'; in ubifs_iget()
208 ui->data = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS); in ubifs_iget()
209 if (!ui->data) { in ubifs_iget()
215 if (ui->data_len == sizeof(dev->new)) in ubifs_iget()
217 else if (ui->data_len == sizeof(dev->huge)) in ubifs_iget()
223 memcpy(ui->data, ino->data, ui->data_len); in ubifs_iget()
232 if (ui->data_len != 0) { in ubifs_iget()
262 struct ubifs_inode *ui; in ubifs_alloc_inode() local
264 ui = kmem_cache_alloc(ubifs_inode_slab, GFP_NOFS); in ubifs_alloc_inode()
265 if (!ui) in ubifs_alloc_inode()
268 memset((void *)ui + sizeof(struct inode), 0, in ubifs_alloc_inode()
270 mutex_init(&ui->ui_mutex); in ubifs_alloc_inode()
271 spin_lock_init(&ui->ui_lock); in ubifs_alloc_inode()
272 return &ui->vfs_inode; in ubifs_alloc_inode()
278 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_i_callback() local
279 kmem_cache_free(ubifs_inode_slab, ui); in ubifs_i_callback()
284 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_destroy_inode() local
286 kfree(ui->data); in ubifs_destroy_inode()
297 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_write_inode() local
299 ubifs_assert(!ui->xattr); in ubifs_write_inode()
303 mutex_lock(&ui->ui_mutex); in ubifs_write_inode()
311 if (!ui->dirty) { in ubifs_write_inode()
312 mutex_unlock(&ui->ui_mutex); in ubifs_write_inode()
328 err = dbg_check_inode_size(c, inode, ui->ui_size); in ubifs_write_inode()
331 ui->dirty = 0; in ubifs_write_inode()
332 mutex_unlock(&ui->ui_mutex); in ubifs_write_inode()
333 ubifs_release_dirty_inode_budget(c, ui); in ubifs_write_inode()
341 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_evict_inode() local
343 if (ui->xattr) in ubifs_evict_inode()
362 ui->ui_size = inode->i_size = 0; in ubifs_evict_inode()
373 if (ui->dirty) in ubifs_evict_inode()
374 ubifs_release_dirty_inode_budget(c, ui); in ubifs_evict_inode()
387 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_dirty_inode() local
389 ubifs_assert(mutex_is_locked(&ui->ui_mutex)); in ubifs_dirty_inode()
390 if (!ui->dirty) { in ubifs_dirty_inode()
391 ui->dirty = 1; in ubifs_dirty_inode()
2202 struct ubifs_inode *ui = obj; in inode_slab_ctor() local
2203 inode_init_once(&ui->vfs_inode); in inode_slab_ctor()