Lines Matching refs:ino

100 int ntfs_new_attr(ntfs_inode *ino, int type, void *name, int namelen,  in ntfs_new_attr()  argument
107 for (i = 0; i < ino->attr_count; i++) in ntfs_new_attr()
109 a = ino->attrs + i; in ntfs_new_attr()
119 1 /* ignore case*/, ino->vol->upcase, in ntfs_new_attr()
120 ino->vol->upcase_length)) { in ntfs_new_attr()
123 rc = ntfs_collate_names(ino->vol->upcase, in ntfs_new_attr()
124 ino->vol->upcase_length, a->name, in ntfs_new_attr()
133 rc = ntfs_collate_names(ino->vol->upcase, in ntfs_new_attr()
134 ino->vol->upcase_length, a->name, in ntfs_new_attr()
176 if (ino->attr_count % 8 == 0) in ntfs_new_attr()
179 new = (ntfs_attribute*)ntfs_malloc((ino->attr_count + 8) * in ntfs_new_attr()
183 if (ino->attrs) { in ntfs_new_attr()
184 ntfs_memcpy(new, ino->attrs, ino->attr_count * in ntfs_new_attr()
186 ntfs_free(ino->attrs); in ntfs_new_attr()
188 ino->attrs = new; in ntfs_new_attr()
191 ntfs_memmove(ino->attrs + i + 1, ino->attrs + i, in ntfs_new_attr()
192 (ino->attr_count - i) * sizeof(ntfs_attribute)); in ntfs_new_attr()
193 ino->attr_count++; in ntfs_new_attr()
194 ino->attrs[i].type = type; in ntfs_new_attr()
195 ino->attrs[i].namelen = namelen; in ntfs_new_attr()
196 ino->attrs[i].name = name; in ntfs_new_attr()
202 int ntfs_make_attr_resident(ntfs_inode *ino, ntfs_attribute *attr) in ntfs_make_attr_resident() argument
269 int ntfs_extend_attr(ntfs_inode *ino, ntfs_attribute *attr, const __s64 len) in ntfs_extend_attr() argument
276 ino->record_count > 1) in ntfs_extend_attr()
283 err = ntfs_make_attr_nonresident(ino, attr); in ntfs_extend_attr()
300 clen = (len - attr->allocated + ino->vol->cluster_size - 1) >> in ntfs_extend_attr()
301 ino->vol->cluster_size_bits; in ntfs_extend_attr()
304 err = ntfs_allocate_clusters(ino->vol, &cluster, &clen, &rl2, in ntfs_extend_attr()
308 attr->allocated += (__s64)clen << ino->vol->cluster_size_bits; in ntfs_extend_attr()
325 int ntfs_make_attr_nonresident(ntfs_inode *ino, ntfs_attribute *attr) in ntfs_make_attr_nonresident() argument
340 error = ntfs_extend_attr(ino, attr, len); in ntfs_make_attr_nonresident()
348 return ntfs_readwrite_attr(ino, attr, 0, &io); in ntfs_make_attr_nonresident()
351 int ntfs_attr_allnonresident(ntfs_inode *ino) in ntfs_attr_allnonresident() argument
354 ntfs_volume *vol = ino->vol; in ntfs_attr_allnonresident()
356 for (i = 0; !error && i < ino->attr_count; i++) in ntfs_attr_allnonresident()
358 if (ino->attrs[i].type != vol->at_security_descriptor && in ntfs_attr_allnonresident()
359 ino->attrs[i].type != vol->at_data) in ntfs_attr_allnonresident()
361 error = ntfs_make_attr_nonresident(ino, ino->attrs + i); in ntfs_attr_allnonresident()
371 int ntfs_resize_attr(ntfs_inode *ino, ntfs_attribute *attr, __s64 newsize) in ntfs_resize_attr() argument
375 int clustersizebits = ino->vol->cluster_size_bits; in ntfs_resize_attr()
385 if (newsize > ino->vol->mft_record_size) { in ntfs_resize_attr()
386 error = ntfs_make_attr_nonresident(ino, attr); in ntfs_resize_attr()
389 return ntfs_resize_attr(ino, attr, newsize); in ntfs_resize_attr()
434 rounded = (rounded + ino->vol->cluster_size - 1) >> in ntfs_resize_attr()
436 error = ntfs_deallocate_cluster_run(ino->vol, in ntfs_resize_attr()
446 error = ntfs_deallocate_clusters(ino->vol, rl + i, in ntfs_resize_attr()
469 error = ntfs_extend_attr(ino, attr, newsize); in ntfs_resize_attr()
472 newcount = (newsize + ino->vol->cluster_size - 1) >> in ntfs_resize_attr()
481 error = ntfs_make_attr_resident(ino, attr); in ntfs_resize_attr()
485 int ntfs_create_attr(ntfs_inode *ino, int anum, char *aname, void *data, in ntfs_create_attr() argument
494 if (dsize > ino->vol->mft_record_size) in ntfs_create_attr()
507 error = ntfs_new_attr(ino, anum, name, namelen, data, dsize, &i, in ntfs_create_attr()
513 *rattr = attr = ino->attrs + i; in ntfs_create_attr()
517 error = ntfs_allocate_attr_number(ino, &i); in ntfs_create_attr()
521 if (attr->attrno + 1 != NTFS_GETU16(ino->attr + 0x28)) in ntfs_create_attr()
524 NTFS_GETU16(ino->attr + 0x28)); in ntfs_create_attr()
533 if (anum == ino->vol->at_file_name) in ntfs_create_attr()
550 static int ntfs_process_runs(ntfs_inode *ino, ntfs_attribute* attr, in ntfs_process_runs() argument
575 "vcn = 0x%x, cnum = 0x%x\n", ino->i_number, attr->type, in ntfs_process_runs()
588 endvcn >>= ino->vol->cluster_size_bits; in ntfs_process_runs()
605 ino->i_number); in ntfs_process_runs()
625 int ntfs_insert_attribute(ntfs_inode *ino, unsigned char *attrdata) in ntfs_insert_attribute() argument
638 "attr type 0x%x\n", ino->i_number, type); in ntfs_insert_attribute()
652 error = ntfs_new_attr(ino, type, name, namelen, in ntfs_insert_attribute()
656 error = ntfs_new_attr(ino, type, name, namelen, NULL, 0, &i, in ntfs_insert_attribute()
667 if (!ino->attrs[i].resident) { in ntfs_insert_attribute()
671 ntfs_process_runs(ino, ino->attrs + i, attrdata); in ntfs_insert_attribute()
675 attr = ino->attrs + i; in ntfs_insert_attribute()
699 ino->attrs[i].d.r.runlist = 0; in ntfs_insert_attribute()
700 ino->attrs[i].d.r.len = 0; in ntfs_insert_attribute()
704 ntfs_process_runs(ino, attr, attrdata); in ntfs_insert_attribute()
727 int ntfs_read_compressed(ntfs_inode *ino, ntfs_attribute *attr, __s64 offset, in ntfs_read_compressed() argument
741 clustersizebits = ino->vol->cluster_size_bits; in ntfs_read_compressed()
804 error = ntfs_getput_clusters(ino->vol, cl1, 0, in ntfs_read_compressed()
867 int ntfs_write_compressed(ntfs_inode *ino, ntfs_attribute *attr, __s64 offset, in ntfs_write_compressed() argument