Lines Matching defs:name
88 if (na->type == AT_DATA && na->name == AT_UNNAMED)
95 if (na->type == AT_DATA && na->name == AT_UNNAMED)
104 if (na->type == AT_DATA && na->name == AT_UNNAMED)
328 * @name: attribute name in little endian Unicode or NULL
329 * @name_len: length of attribute @name in Unicode characters (if @name given)
331 * Initialize the ntfs attribute @na with @ni, @type, @name, and @name_len.
334 const ATTR_TYPES type, ntfschar *name, const u32 name_len)
339 na->name = name;
340 if (name)
399 * @name: attribute name in little endian Unicode or AT_UNNAMED or NULL
400 * @name_len: length of attribute @name in Unicode characters (if @name given)
403 * @name, and @name_len, then return it. Return NULL on error with
406 * If @name is AT_UNNAMED look specifically for an unnamed attribute. If you
407 * do not care whether the attribute is named or not set @name to NULL. In
411 ntfschar *name, u32 name_len)
430 name = (ntfschar*)NULL;
431 if (name && name != AT_UNNAMED && name != NTFS_INDEX_I30) {
432 /* A null char leads to a short name and unallocated bytes */
433 if (ntfs_ucsnlen(name, name_len) != name_len) {
434 ntfs_log_error("Null character in attribute name"
438 name = ntfs_ucsndup(name, name_len);
439 if (!name)
441 newname = name;
448 if (ntfs_attr_lookup(type, name, name_len, 0, 0, NULL, 0, ctx))
453 if (!name) {
463 " name in inode %lld\n",
467 name = ntfs_ucsndup(attr_name, a->name_length);
468 if (!name)
470 newname = name;
473 name = AT_UNNAMED;
478 __ntfs_attr_init(na, ni, type, name, name_len);
512 if (na->type == AT_DATA && na->name == AT_UNNAMED &&
596 if (na->name != AT_UNNAMED && na->name != NTFS_INDEX_I30
597 && na->name != STREAM_SDS)
598 free(na->name);
628 if (!ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE,
685 if (!ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE,
781 if (ntfs_attr_lookup(na->type, na->name, na->name_len,
1051 if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0,
1969 if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0,
2052 if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0,
2083 ? na->type == AT_INDEX_ROOT && na->name == NTFS_INDEX_I30
2084 : na->type == AT_DATA && na->name == AT_UNNAMED) {
2356 err = ntfs_attr_lookup(na->type, na->name,
2572 ? na->type == AT_INDEX_ROOT && na->name == NTFS_INDEX_I30
2573 : na->type == AT_DATA && na->name == AT_UNNAMED) {
2758 * @name: attribute name to find (optional, i.e. NULL means don't care)
2759 * @name_len: attribute name length (only needed if @name present)
2760 * @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present)
2769 * attribute of @type, optionally @name and @val. If found, ntfs_attr_find()
2795 * If @name is AT_UNNAMED search for an unnamed attribute. If @name is present
2796 * but not AT_UNNAMED search for a named attribute matching @name. Otherwise,
2799 * If @ic is IGNORE_CASE, the @name comparison is not case sensitive and
2803 * sensitive. When @name is present, @name_len is the @name length in Unicode
2806 * If @name is not present (NULL), we assume that the unnamed attribute is
2825 static int ntfs_attr_find(const ATTR_TYPES type, const ntfschar *name,
2843 if (name && name != AT_UNNAMED) {
2890 * If @name is AT_UNNAMED we want an unnamed attribute.
2891 * If @name is present, compare the two names.
2894 if (name == AT_UNNAMED) {
2907 ntfs_log_error("Corrupt attribute name"
2912 if (name && ((rc = ntfs_names_full_collate(name,
2918 * If @name collates before a->name,
2930 * The names match or @name not present and attribute is
2968 void ntfs_attr_name_free(char **name)
2970 if (*name) {
2971 free(*name);
2972 *name = NULL;
2978 char *name = NULL;
2981 name_len = ntfs_ucstombs(uname, uname_len, &name, 0);
2987 return name;
2989 ntfs_attr_name_free(&name);
2996 * @name: attribute name to find (optional, i.e. NULL means don't care)
2997 * @name_len: attribute name length (only needed if @name present)
2998 * @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present)
3025 * If @name is AT_UNNAMED search for an unnamed attribute. If @name is present
3026 * but not AT_UNNAMED search for a named attribute matching @name. Otherwise,
3063 static int ntfs_external_attr_find(ATTR_TYPES type, const ntfschar *name,
3118 < (long)offsetof(ATTR_LIST_ENTRY, name))
3121 < offsetof(ATTR_LIST_ENTRY, name)))
3130 < (long)offsetof(ATTR_LIST_ENTRY, name))
3146 if (name || name_len || val || val_len || lowest_vcn) {
3195 if ((((u8*)al_entry + offsetof(ATTR_LIST_ENTRY, name)) > al_end)
3223 * If @name is AT_UNNAMED we want an unnamed attribute.
3224 * If @name is present, compare the two names.
3227 if (name == AT_UNNAMED) {
3233 if (name && ((rc = ntfs_names_full_collate(name,
3238 * If @name collates before al_name,
3248 * The names match or @name not present and attribute is
3335 * If the type and/or the name are/is mismatched between the
3382 return ntfs_attr_find(AT_END, name, name_len, ic, val, val_len,
3417 ret = ntfs_attr_find(type, name, name_len, ic, val,
3446 * record, now make sure its relevant parts (name, runlist,
3516 ntfs_log_error("Corrupt file name"
3611 * @name: attribute name to find (optional, i.e. NULL means don't care)
3612 * @name_len: attribute name length (only needed if @name present)
3613 * @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present)
3640 * If @name is AT_UNNAMED search for an unnamed attribute. If @name is present
3641 * but not AT_UNNAMED search for a named attribute matching @name. Otherwise,
3675 int ntfs_attr_lookup(const ATTR_TYPES type, const ntfschar *name,
3686 if (!ctx || !ctx->mrec || !ctx->attr || (name && name != AT_UNNAMED &&
3699 ret = ntfs_attr_find(type, name, name_len, ic, val, val_len, ctx);
3701 ret = ntfs_external_attr_find(type, name, name_len, ic,
3918 * volume name attribute, but in reality Windows sets it to 0 when
3919 * clearing the volume name. If we want to be able to clear the volume
3920 * name we must also accept 0 as min_size, despite the $AttrDef
3940 * @name: attribute name to check
3941 * @name_len: attribute name length
3943 * Check whether the attribute of @type and @name with name length @name_len on
3956 const ntfschar *name, int name_len)
3963 * name of $TXF_DATA must be resident despite the entry for
3970 && name
3971 && ntfs_names_are_equal(TXF_DATA, 9, name, name_len,
4084 * @name: name of the new attribute
4085 * @name_len: name length of the new attribute
4094 * EEXIST - Attribute of such type and with same name already exists.
4098 const ntfschar *name, u8 name_len, const u8 *val,
4111 if (!ni || (!name && name_len)) {
4133 if (!ntfs_attr_find(type, name, name_len, CASE_SENSITIVE, val, size,
4179 name, sizeof(ntfschar) * name_len);
4196 ? type == AT_INDEX_ROOT && name == NTFS_INDEX_I30
4197 : type == AT_DATA && name == AT_UNNAMED) {
4215 * @name: name of the new attribute extent
4216 * @name_len: name length of the new attribute extent
4226 * name already exists.
4230 const ntfschar *name, u8 name_len, VCN lowest_vcn, int dataruns_size,
4245 if (!ni || dataruns_size <= 0 || (!name && name_len)) {
4250 if (ntfs_attr_can_be_non_resident(ni->vol, type, name, name_len)) {
4267 if (!ntfs_attr_find(type, name, name_len, CASE_SENSITIVE, NULL, 0,
4318 name, sizeof(ntfschar) * name_len);
4340 if (ntfs_attr_lookup(type, name, name_len, CASE_SENSITIVE,
4490 * @name: name in unicode of the new attribute
4491 * @name_len: name length in unicode characters of the new attribute
4513 ntfschar *name, u8 name_len, const u8 *val, s64 size)
4544 if (ntfs_attr_can_be_non_resident(ni->vol, type, name, name_len)) {
4620 return ntfs_attr_add(ni, type, name, name_len, val, size);
4636 || ((type == AT_INDEX_ROOT) && (name == NTFS_INDEX_I30))))
4642 offset = ntfs_resident_attr_record_add(attr_ni, type, name,
4656 offset = ntfs_non_resident_attr_record_add(attr_ni, type, name,
4669 na = ntfs_attr_open(ni, type, name, name_len);
4708 int ntfs_attr_set_flags(ntfs_inode *ni, ATTR_TYPES type, const ntfschar *name,
4718 if (!ntfs_attr_lookup(type, name, name_len,
4770 while (!ntfs_attr_lookup(na->type, na->name, na->name_len,
4960 ntfs_log_trace("Attribute of such type, with same name already "
5126 if (ntfs_attr_can_be_non_resident(vol, na->type, na->name, na->name_len))
5191 /* Calculate new offsets for the name and the mapping pairs array. */
5216 /* Move the attribute name if it exists and update the offset. */
5316 if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0, 0, NULL, 0,
5350 ? na->type == AT_INDEX_ROOT && na->name == NTFS_INDEX_I30
5351 : na->type == AT_DATA && na->name == AT_UNNAMED) {
5436 * to all name attributes and directory indexes
5485 if (ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE,
5668 /* Move the attribute name if it exists and update the offset. */
5882 if (na->type == AT_DATA && na->name == AT_UNNAMED) {
6003 while (!ntfs_attr_lookup(na->type, na->name, na->name_len,
6166 if (!ntfs_attr_lookup(na->type, na->name, na->name_len,
6177 if ((na->type == AT_DATA) && (na->name == AT_UNNAMED)) {
6194 while (!ntfs_attr_lookup(na->type, na->name, na->name_len,
6252 na->name, na->name_len, stop_vcn, mp_size,
6432 if (ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE,
6451 if (na->type == AT_INDEX_ROOT && na->name == NTFS_INDEX_I30) {
6457 if (na->type == AT_DATA && na->name == AT_UNNAMED) {
6665 if (ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE,
6683 if (na->type == AT_INDEX_ROOT && na->name == NTFS_INDEX_I30) {
6689 if (na->type == AT_DATA && na->name == AT_UNNAMED) {
6958 * @name: attribute name in little endian Unicode or AT_UNNAMED or NULL
6959 * @name_len: length of attribute @name in Unicode characters (if @name given)
6963 * If @name is AT_UNNAMED then look specifically for an unnamed attribute.
6964 * If @name is NULL then the attribute could be either named or not.
6974 ntfschar *name, u32 name_len, s64 *data_size)
6982 na = ntfs_attr_open(ni, type, name, name_len);
7142 int ntfs_attr_exist(ntfs_inode *ni, const ATTR_TYPES type, const ntfschar *name,
7154 ret = ntfs_attr_lookup(type, name, name_len, CASE_SENSITIVE, 0, NULL, 0,
7162 int ntfs_attr_remove(ntfs_inode *ni, const ATTR_TYPES type, ntfschar *name,
7176 na = ntfs_attr_open(ni, type, name, name_len);