Lines Matching refs:ui
76 const struct ubifs_inode *ui = ubifs_inode(inode); in validate_inode() local
84 if (ui->compr_type >= UBIFS_COMPR_TYPES_CNT) { in validate_inode()
85 ubifs_err(c, "unknown compression type %d", ui->compr_type); in validate_inode()
89 if (ui->xattr_names + ui->xattr_cnt > XATTR_LIST_MAX) in validate_inode()
92 if (ui->data_len < 0 || ui->data_len > UBIFS_MAX_INO_DATA) in validate_inode()
95 if (ui->xattr && !S_ISREG(inode->i_mode)) in validate_inode()
98 if (!ubifs_compr_present(c, ui->compr_type)) { in validate_inode()
100 inode->i_ino, ubifs_compr_name(c, ui->compr_type)); in validate_inode()
114 struct ubifs_inode *ui; in ubifs_iget() local
123 ui = ubifs_inode(inode); in ubifs_iget()
154 ui->data_len = le32_to_cpu(ino->data_len); in ubifs_iget()
155 ui->flags = le32_to_cpu(ino->flags); in ubifs_iget()
156 ui->compr_type = le16_to_cpu(ino->compr_type); in ubifs_iget()
157 ui->creat_sqnum = le64_to_cpu(ino->creat_sqnum); in ubifs_iget()
158 ui->xattr_cnt = le32_to_cpu(ino->xattr_cnt); in ubifs_iget()
159 ui->xattr_size = le32_to_cpu(ino->xattr_size); in ubifs_iget()
160 ui->xattr_names = le32_to_cpu(ino->xattr_names); in ubifs_iget()
161 ui->synced_i_size = ui->ui_size = inode->i_size; in ubifs_iget()
163 ui->xattr = (ui->flags & UBIFS_XATTR_FL) ? 1 : 0; in ubifs_iget()
174 if (ui->xattr) { in ubifs_iget()
175 ui->data = kmalloc(ui->data_len + 1, GFP_NOFS); in ubifs_iget()
176 if (!ui->data) { in ubifs_iget()
180 memcpy(ui->data, ino->data, ui->data_len); in ubifs_iget()
181 ((char *)ui->data)[ui->data_len] = '\0'; in ubifs_iget()
182 } else if (ui->data_len != 0) { in ubifs_iget()
190 if (ui->data_len != 0) { in ubifs_iget()
197 if (ui->data_len <= 0 || ui->data_len > UBIFS_MAX_INO_DATA) { in ubifs_iget()
201 ui->data = kmalloc(ui->data_len + 1, GFP_NOFS); in ubifs_iget()
202 if (!ui->data) { in ubifs_iget()
206 memcpy(ui->data, ino->data, ui->data_len); in ubifs_iget()
207 ((char *)ui->data)[ui->data_len] = '\0'; in ubifs_iget()
215 ui->data = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS); in ubifs_iget()
216 if (!ui->data) { in ubifs_iget()
222 if (ui->data_len == sizeof(dev->new)) in ubifs_iget()
224 else if (ui->data_len == sizeof(dev->huge)) in ubifs_iget()
230 memcpy(ui->data, ino->data, ui->data_len); in ubifs_iget()
239 if (ui->data_len != 0) { in ubifs_iget()
269 struct ubifs_inode *ui; in ubifs_alloc_inode() local
271 ui = kmem_cache_alloc(ubifs_inode_slab, GFP_NOFS); in ubifs_alloc_inode()
272 if (!ui) in ubifs_alloc_inode()
275 memset((void *)ui + sizeof(struct inode), 0, in ubifs_alloc_inode()
277 mutex_init(&ui->ui_mutex); in ubifs_alloc_inode()
278 init_rwsem(&ui->xattr_sem); in ubifs_alloc_inode()
279 spin_lock_init(&ui->ui_lock); in ubifs_alloc_inode()
280 return &ui->vfs_inode; in ubifs_alloc_inode()
285 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_free_inode() local
287 kfree(ui->data); in ubifs_free_inode()
290 kmem_cache_free(ubifs_inode_slab, ui); in ubifs_free_inode()
300 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_write_inode() local
302 ubifs_assert(c, !ui->xattr); in ubifs_write_inode()
306 mutex_lock(&ui->ui_mutex); in ubifs_write_inode()
314 if (!ui->dirty) { in ubifs_write_inode()
315 mutex_unlock(&ui->ui_mutex); in ubifs_write_inode()
331 err = dbg_check_inode_size(c, inode, ui->ui_size); in ubifs_write_inode()
334 ui->dirty = 0; in ubifs_write_inode()
335 mutex_unlock(&ui->ui_mutex); in ubifs_write_inode()
336 ubifs_release_dirty_inode_budget(c, ui); in ubifs_write_inode()
354 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_evict_inode() local
356 if (ui->xattr) in ubifs_evict_inode()
375 ui->ui_size = inode->i_size = 0; in ubifs_evict_inode()
386 if (ui->dirty) in ubifs_evict_inode()
387 ubifs_release_dirty_inode_budget(c, ui); in ubifs_evict_inode()
401 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_dirty_inode() local
403 ubifs_assert(c, mutex_is_locked(&ui->ui_mutex)); in ubifs_dirty_inode()
404 if (!ui->dirty) { in ubifs_dirty_inode()
405 ui->dirty = 1; in ubifs_dirty_inode()
2357 struct ubifs_inode *ui = obj; in inode_slab_ctor() local
2358 inode_init_once(&ui->vfs_inode); in inode_slab_ctor()