Lines Matching full:ui

72 	const struct ubifs_inode *ui = ubifs_inode(inode);  in validate_inode()  local
80 if (ui->compr_type >= UBIFS_COMPR_TYPES_CNT) { in validate_inode()
81 ubifs_err(c, "unknown compression type %d", ui->compr_type); in validate_inode()
85 if (ui->xattr_names + ui->xattr_cnt > XATTR_LIST_MAX) in validate_inode()
88 if (ui->data_len < 0 || ui->data_len > UBIFS_MAX_INO_DATA) in validate_inode()
91 if (ui->xattr && !S_ISREG(inode->i_mode)) in validate_inode()
94 if (!ubifs_compr_present(c, ui->compr_type)) { in validate_inode()
96 inode->i_ino, ubifs_compr_name(c, ui->compr_type)); in validate_inode()
110 struct ubifs_inode *ui; in ubifs_iget() local
119 ui = ubifs_inode(inode); in ubifs_iget()
150 ui->data_len = le32_to_cpu(ino->data_len); in ubifs_iget()
151 ui->flags = le32_to_cpu(ino->flags); in ubifs_iget()
152 ui->compr_type = le16_to_cpu(ino->compr_type); in ubifs_iget()
153 ui->creat_sqnum = le64_to_cpu(ino->creat_sqnum); in ubifs_iget()
154 ui->xattr_cnt = le32_to_cpu(ino->xattr_cnt); in ubifs_iget()
155 ui->xattr_size = le32_to_cpu(ino->xattr_size); in ubifs_iget()
156 ui->xattr_names = le32_to_cpu(ino->xattr_names); in ubifs_iget()
157 ui->synced_i_size = ui->ui_size = inode->i_size; in ubifs_iget()
159 ui->xattr = (ui->flags & UBIFS_XATTR_FL) ? 1 : 0; in ubifs_iget()
170 if (ui->xattr) { in ubifs_iget()
171 ui->data = kmalloc(ui->data_len + 1, GFP_NOFS); in ubifs_iget()
172 if (!ui->data) { in ubifs_iget()
176 memcpy(ui->data, ino->data, ui->data_len); in ubifs_iget()
177 ((char *)ui->data)[ui->data_len] = '\0'; in ubifs_iget()
178 } else if (ui->data_len != 0) { in ubifs_iget()
186 if (ui->data_len != 0) { in ubifs_iget()
193 if (ui->data_len <= 0 || ui->data_len > UBIFS_MAX_INO_DATA) { in ubifs_iget()
197 ui->data = kmalloc(ui->data_len + 1, GFP_NOFS); in ubifs_iget()
198 if (!ui->data) { in ubifs_iget()
202 memcpy(ui->data, ino->data, ui->data_len); in ubifs_iget()
203 ((char *)ui->data)[ui->data_len] = '\0'; in ubifs_iget()
211 ui->data = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS); in ubifs_iget()
212 if (!ui->data) { in ubifs_iget()
218 if (ui->data_len == sizeof(dev->new)) in ubifs_iget()
220 else if (ui->data_len == sizeof(dev->huge)) in ubifs_iget()
226 memcpy(ui->data, ino->data, ui->data_len); in ubifs_iget()
235 if (ui->data_len != 0) { in ubifs_iget()
265 struct ubifs_inode *ui; in ubifs_alloc_inode() local
267 ui = alloc_inode_sb(sb, ubifs_inode_slab, GFP_NOFS); in ubifs_alloc_inode()
268 if (!ui) in ubifs_alloc_inode()
271 memset((void *)ui + sizeof(struct inode), 0, in ubifs_alloc_inode()
273 mutex_init(&ui->ui_mutex); in ubifs_alloc_inode()
274 init_rwsem(&ui->xattr_sem); in ubifs_alloc_inode()
275 spin_lock_init(&ui->ui_lock); in ubifs_alloc_inode()
276 return &ui->vfs_inode; in ubifs_alloc_inode()
281 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_free_inode() local
283 kfree(ui->data); in ubifs_free_inode()
286 kmem_cache_free(ubifs_inode_slab, ui); in ubifs_free_inode()
296 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_write_inode() local
298 ubifs_assert(c, !ui->xattr); in ubifs_write_inode()
302 mutex_lock(&ui->ui_mutex); in ubifs_write_inode()
310 if (!ui->dirty) { in ubifs_write_inode()
311 mutex_unlock(&ui->ui_mutex); in ubifs_write_inode()
327 err = dbg_check_inode_size(c, inode, ui->ui_size); in ubifs_write_inode()
330 ui->dirty = 0; in ubifs_write_inode()
331 mutex_unlock(&ui->ui_mutex); in ubifs_write_inode()
332 ubifs_release_dirty_inode_budget(c, ui); in ubifs_write_inode()
350 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_evict_inode() local
352 if (ui->xattr) in ubifs_evict_inode()
371 ui->ui_size = inode->i_size = 0; in ubifs_evict_inode()
382 if (ui->dirty) in ubifs_evict_inode()
383 ubifs_release_dirty_inode_budget(c, ui); in ubifs_evict_inode()
397 struct ubifs_inode *ui = ubifs_inode(inode); in ubifs_dirty_inode() local
399 ubifs_assert(c, mutex_is_locked(&ui->ui_mutex)); in ubifs_dirty_inode()
400 if (!ui->dirty) { in ubifs_dirty_inode()
401 ui->dirty = 1; in ubifs_dirty_inode()
2372 struct ubifs_inode *ui = obj; in inode_slab_ctor() local
2373 inode_init_once(&ui->vfs_inode); in inode_slab_ctor()