Lines Matching full:de

534 static void cifs_fill_dirent_posix(struct cifs_dirent *de,  in cifs_fill_dirent_posix()  argument
545 de->name = parsed.name; in cifs_fill_dirent_posix()
546 de->namelen = parsed.name_len; in cifs_fill_dirent_posix()
547 de->resume_key = info->Ignored; in cifs_fill_dirent_posix()
548 de->ino = le64_to_cpu(info->Inode); in cifs_fill_dirent_posix()
551 static void cifs_fill_dirent_unix(struct cifs_dirent *de, in cifs_fill_dirent_unix() argument
554 de->name = &info->FileName[0]; in cifs_fill_dirent_unix()
556 de->namelen = cifs_unicode_bytelen(de->name); in cifs_fill_dirent_unix()
558 de->namelen = strnlen(de->name, PATH_MAX); in cifs_fill_dirent_unix()
559 de->resume_key = info->ResumeKey; in cifs_fill_dirent_unix()
560 de->ino = le64_to_cpu(info->basic.UniqueId); in cifs_fill_dirent_unix()
563 static void cifs_fill_dirent_dir(struct cifs_dirent *de, in cifs_fill_dirent_dir() argument
566 de->name = &info->FileName[0]; in cifs_fill_dirent_dir()
567 de->namelen = le32_to_cpu(info->FileNameLength); in cifs_fill_dirent_dir()
568 de->resume_key = info->FileIndex; in cifs_fill_dirent_dir()
571 static void cifs_fill_dirent_full(struct cifs_dirent *de, in cifs_fill_dirent_full() argument
574 de->name = &info->FileName[0]; in cifs_fill_dirent_full()
575 de->namelen = le32_to_cpu(info->FileNameLength); in cifs_fill_dirent_full()
576 de->resume_key = info->FileIndex; in cifs_fill_dirent_full()
579 static void cifs_fill_dirent_search(struct cifs_dirent *de, in cifs_fill_dirent_search() argument
582 de->name = &info->FileName[0]; in cifs_fill_dirent_search()
583 de->namelen = le32_to_cpu(info->FileNameLength); in cifs_fill_dirent_search()
584 de->resume_key = info->FileIndex; in cifs_fill_dirent_search()
585 de->ino = le64_to_cpu(info->UniqueId); in cifs_fill_dirent_search()
588 static void cifs_fill_dirent_both(struct cifs_dirent *de, in cifs_fill_dirent_both() argument
591 de->name = &info->FileName[0]; in cifs_fill_dirent_both()
592 de->namelen = le32_to_cpu(info->FileNameLength); in cifs_fill_dirent_both()
593 de->resume_key = info->FileIndex; in cifs_fill_dirent_both()
596 static void cifs_fill_dirent_std(struct cifs_dirent *de, in cifs_fill_dirent_std() argument
599 de->name = &info->FileName[0]; in cifs_fill_dirent_std()
601 de->namelen = info->FileNameLength; in cifs_fill_dirent_std()
602 de->resume_key = info->ResumeKey; in cifs_fill_dirent_std()
605 static int cifs_fill_dirent(struct cifs_dirent *de, const void *info, in cifs_fill_dirent() argument
608 memset(de, 0, sizeof(*de)); in cifs_fill_dirent()
612 cifs_fill_dirent_posix(de, info); in cifs_fill_dirent()
615 cifs_fill_dirent_unix(de, info, is_unicode); in cifs_fill_dirent()
618 cifs_fill_dirent_dir(de, info); in cifs_fill_dirent()
621 cifs_fill_dirent_full(de, info); in cifs_fill_dirent()
624 cifs_fill_dirent_search(de, info); in cifs_fill_dirent()
627 cifs_fill_dirent_both(de, info); in cifs_fill_dirent()
630 cifs_fill_dirent_std(de, info); in cifs_fill_dirent()
643 static int cifs_entry_is_dot(struct cifs_dirent *de, bool is_unicode) in cifs_entry_is_dot() argument
647 if (!de->name) in cifs_entry_is_dot()
651 __le16 *ufilename = (__le16 *)de->name; in cifs_entry_is_dot()
652 if (de->namelen == 2) { in cifs_entry_is_dot()
656 } else if (de->namelen == 4) { in cifs_entry_is_dot()
663 if (de->namelen == 1) { in cifs_entry_is_dot()
664 if (de->name[0] == '.') in cifs_entry_is_dot()
666 } else if (de->namelen == 2) { in cifs_entry_is_dot()
667 if (de->name[0] == '.' && de->name[1] == '.') in cifs_entry_is_dot()
692 struct cifs_dirent de; in cifs_save_resume_key() local
695 rc = cifs_fill_dirent(&de, current_entry, file_info->srch_inf.info_level, in cifs_save_resume_key()
698 file_info->srch_inf.presume_name = de.name; in cifs_save_resume_key()
699 file_info->srch_inf.resume_name_len = de.namelen; in cifs_save_resume_key()
700 file_info->srch_inf.resume_key = de.resume_key; in cifs_save_resume_key()
908 struct cached_dirent *de; in add_cached_dirent() local
918 de = kzalloc(sizeof(*de), GFP_ATOMIC); in add_cached_dirent()
919 if (de == NULL) { in add_cached_dirent()
923 de->namelen = namelen; in add_cached_dirent()
924 de->name = kstrndup(name, namelen, GFP_ATOMIC); in add_cached_dirent()
925 if (de->name == NULL) { in add_cached_dirent()
926 kfree(de); in add_cached_dirent()
930 de->pos = ctx->pos; in add_cached_dirent()
932 memcpy(&de->fattr, fattr, sizeof(struct cifs_fattr)); in add_cached_dirent()
934 list_add_tail(&de->entry, &cde->entries); in add_cached_dirent()
967 struct cifs_dirent de = { NULL, }; in cifs_filldir() local
972 rc = cifs_fill_dirent(&de, find_entry, file_info->srch_inf.info_level, in cifs_filldir()
977 if (de.namelen > max_len) { in cifs_filldir()
979 de.namelen); in cifs_filldir()
984 if (cifs_entry_is_dot(&de, file_info->srch_inf.unicode)) in cifs_filldir()
994 cifs_from_utf16((char *)name.name, (__le16 *)de.name, in cifs_filldir()
996 min_t(size_t, de.namelen, in cifs_filldir()
1000 name.name = de.name; in cifs_filldir()
1001 name.len = de.namelen; in cifs_filldir()
1034 if (de.ino && (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) { in cifs_filldir()
1035 fattr.cf_uniqueid = de.ino; in cifs_filldir()