Lines Matching refs:dsc
2791 static void yaffsfs_SetDirRewound(struct yaffsfs_DirSearchContxt *dsc) in yaffsfs_SetDirRewound() argument
2793 if (dsc && in yaffsfs_SetDirRewound()
2794 dsc->dirObj && in yaffsfs_SetDirRewound()
2795 dsc->dirObj->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY) { in yaffsfs_SetDirRewound()
2797 dsc->offset = 0; in yaffsfs_SetDirRewound()
2799 if (list_empty(&dsc->dirObj->variant.dir_variant.children)) in yaffsfs_SetDirRewound()
2800 dsc->nextReturn = NULL; in yaffsfs_SetDirRewound()
2802 dsc->nextReturn = in yaffsfs_SetDirRewound()
2803 list_entry(dsc->dirObj->variant.dir_variant. in yaffsfs_SetDirRewound()
2811 static void yaffsfs_DirAdvance(struct yaffsfs_DirSearchContxt *dsc) in yaffsfs_DirAdvance() argument
2813 if (dsc && in yaffsfs_DirAdvance()
2814 dsc->dirObj && in yaffsfs_DirAdvance()
2815 dsc->dirObj->variant_type == YAFFS_OBJECT_TYPE_DIRECTORY) { in yaffsfs_DirAdvance()
2817 if (dsc->nextReturn == NULL || in yaffsfs_DirAdvance()
2818 list_empty(&dsc->dirObj->variant.dir_variant.children)) in yaffsfs_DirAdvance()
2819 dsc->nextReturn = NULL; in yaffsfs_DirAdvance()
2821 struct list_head *next = dsc->nextReturn->siblings.next; in yaffsfs_DirAdvance()
2823 if (next == &dsc->dirObj->variant.dir_variant.children) in yaffsfs_DirAdvance()
2824 dsc->nextReturn = NULL; /* end of list */ in yaffsfs_DirAdvance()
2826 dsc->nextReturn = list_entry(next, in yaffsfs_DirAdvance()
2839 struct yaffsfs_DirSearchContxt *dsc; in yaffsfs_RemoveObjectCallback() local
2850 dsc = list_entry(i, struct yaffsfs_DirSearchContxt, others); in yaffsfs_RemoveObjectCallback()
2851 if (dsc->nextReturn == obj) in yaffsfs_RemoveObjectCallback()
2852 yaffsfs_DirAdvance(dsc); in yaffsfs_RemoveObjectCallback()
2861 struct yaffsfs_DirSearchContxt *dsc = NULL; in yaffs_opendir() local
2890 for (i = 0, dsc = NULL; i < YAFFSFS_N_DSC && !dsc; i++) { in yaffs_opendir()
2892 dsc = &yaffsfs_dsc[i]; in yaffs_opendir()
2895 dir = (yaffs_DIR *) dsc; in yaffs_opendir()
2897 if (dsc) { in yaffs_opendir()
2898 memset(dsc, 0, sizeof(struct yaffsfs_DirSearchContxt)); in yaffs_opendir()
2899 dsc->inUse = 1; in yaffs_opendir()
2900 dsc->dirObj = obj; in yaffs_opendir()
2901 yaffs_strncpy(dsc->name, dirname, NAME_MAX); in yaffs_opendir()
2902 INIT_LIST_HEAD(&dsc->others); in yaffs_opendir()
2907 list_add(&dsc->others, &search_contexts); in yaffs_opendir()
2908 yaffsfs_SetDirRewound(dsc); in yaffs_opendir()
2920 struct yaffsfs_DirSearchContxt *dsc; in yaffs_readdir() local
2923 dsc = (struct yaffsfs_DirSearchContxt *) dirp; in yaffs_readdir()
2926 if (dsc && dsc->inUse) { in yaffs_readdir()
2928 if (dsc->nextReturn) { in yaffs_readdir()
2929 dsc->de.d_ino = in yaffs_readdir()
2930 yaffs_get_equivalent_obj(dsc->nextReturn)->obj_id; in yaffs_readdir()
2931 dsc->de.d_dont_use = (unsigned)dsc->nextReturn; in yaffs_readdir()
2932 dsc->de.d_off = dsc->offset++; in yaffs_readdir()
2933 yaffs_get_obj_name(dsc->nextReturn, in yaffs_readdir()
2934 dsc->de.d_name, NAME_MAX); in yaffs_readdir()
2935 if (yaffs_strnlen(dsc->de.d_name, NAME_MAX + 1) == 0) { in yaffs_readdir()
2937 yaffs_strcpy(dsc->de.d_name, _Y("zz")); in yaffs_readdir()
2939 dsc->de.d_reclen = sizeof(struct yaffs_dirent); in yaffs_readdir()
2940 retVal = &dsc->de; in yaffs_readdir()
2941 yaffsfs_DirAdvance(dsc); in yaffs_readdir()
2955 struct yaffsfs_DirSearchContxt *dsc; in yaffs_rewinddir() local
2957 dsc = (struct yaffsfs_DirSearchContxt *) dirp; in yaffs_rewinddir()
2961 yaffsfs_SetDirRewound(dsc); in yaffs_rewinddir()
2968 struct yaffsfs_DirSearchContxt *dsc; in yaffs_closedir() local
2970 dsc = (struct yaffsfs_DirSearchContxt *) dirp; in yaffs_closedir()
2972 if (!dsc) { in yaffs_closedir()
2978 dsc->inUse = 0; in yaffs_closedir()
2979 list_del(&dsc->others); /* unhook from list */ in yaffs_closedir()