• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/src/router/busybox-1.x/e2fsprogs/old_e2fsprogs/

Lines Matching refs:refcount

915 static void ea_refcount_free(ext2_refcount_t refcount)
917 if (!refcount)
920 ext2fs_free_mem(&refcount->list);
921 ext2fs_free_mem(&refcount);
956 ea_refcount_free(ctx->refcount);
957 ctx->refcount = 0;
1020 * reference counts. Once the refcount has dropped to zero, it is
1028 ext2_refcount_t refcount;
1032 retval = ext2fs_get_mem(sizeof(struct ea_refcount), &refcount);
1035 memset(refcount, 0, sizeof(struct ea_refcount));
1039 refcount->size = size;
1043 refcount->size, bytes);
1045 retval = ext2fs_get_mem(bytes, &refcount->list);
1048 memset(refcount->list, 0, bytes);
1050 refcount->count = 0;
1051 refcount->cursor = 0;
1053 *ret = refcount;
1057 ea_refcount_free(refcount);
1062 * collapse_refcount() --- go through the refcount array, and get rid
1065 static void refcount_collapse(ext2_refcount_t refcount)
1070 list = refcount->list;
1071 for (i = 0, j = 0; i < refcount->count; i++) {
1080 refcount->count, j);
1082 refcount->count = j;
1090 static struct ea_refcount_el *insert_refcount_el(ext2_refcount_t refcount,
1098 if (refcount->count >= refcount->size) {
1099 new_size = refcount->size + 100;
1101 printf("Reallocating refcount %d entries...\n", new_size);
1103 retval = ext2fs_resize_mem((size_t) refcount->size *
1107 &refcount->list);
1110 refcount->size = new_size;
1112 num = (int) refcount->count - pos;
1116 memmove(&refcount->list[pos+1], &refcount->list[pos],
1119 refcount->count++;
1120 el = &refcount->list[pos];
1128 * get_refcount_el() --- given an block number, try to find refcount
1132 static struct ea_refcount_el *get_refcount_el(ext2_refcount_t refcount,
1139 if (!refcount || !refcount->list)
1143 high = (int) refcount->count-1;
1144 if (create && ((refcount->count == 0) ||
1145 (blk > refcount->list[high].ea_blk))) {
1146 if (refcount->count >= refcount->size)
1147 refcount_collapse(refcount);
1149 return insert_refcount_el(refcount, blk,
1150 (unsigned) refcount->count);
1152 if (refcount->count == 0)
1155 if (refcount->cursor >= refcount->count)
1156 refcount->cursor = 0;
1157 if (blk == refcount->list[refcount->cursor].ea_blk)
1158 return &refcount->list[refcount->cursor++];
1167 lowval = refcount->list[low].ea_blk;
1168 highval = refcount->list[high].ea_blk;
1180 if (blk == refcount->list[mid].ea_blk) {
1181 refcount->cursor = mid+1;
1182 return &refcount->list[mid];
1184 if (blk < refcount->list[mid].ea_blk)
1194 if (refcount->count >= refcount->size) {
1195 refcount_collapse(refcount);
1196 if (refcount->count < refcount->size)
1199 return insert_refcount_el(refcount, blk, low);
1205 ea_refcount_increment(ext2_refcount_t refcount, blk_t blk, int *ret)
1209 el = get_refcount_el(refcount, blk, 1);
1220 ea_refcount_decrement(ext2_refcount_t refcount, blk_t blk, int *ret)
1224 el = get_refcount_el(refcount, blk, 0);
1236 ea_refcount_store(ext2_refcount_t refcount, blk_t blk, int count)
1241 * Get the refcount element
1243 el = get_refcount_el(refcount, blk, count ? 1 : 0);
1250 static inline void ea_refcount_intr_begin(ext2_refcount_t refcount)
1252 refcount->cursor = 0;
1256 static blk_t ea_refcount_intr_next(ext2_refcount_t refcount, int *ret)
1261 if (refcount->cursor >= refcount->count)
1263 list = refcount->list;
1264 if (list[refcount->cursor].ea_count) {
1266 *ret = list[refcount->cursor].ea_count;
1267 return list[refcount->cursor++].ea_blk;
1269 refcount->cursor++;
2863 static void adjust_extattr_refcount(e2fsck_t ctx, ext2_refcount_t refcount,
3598 * (ctx->refcount), then fix them.
3600 if (ctx->refcount) {
3601 adjust_extattr_refcount(ctx, ctx->refcount, block_buf, -1);
3602 ea_refcount_free(ctx->refcount);
3603 ctx->refcount = 0;
3826 * are still referenced in ctx->refcount, or by adding references for
3830 static void adjust_extattr_refcount(e2fsck_t ctx, ext2_refcount_t refcount,
3842 ea_refcount_intr_begin(refcount);
3844 if ((blk = ea_refcount_intr_next(refcount, &count)) == 0)
3915 /* Create the EA refcount structure if necessary */
3916 if (!ctx->refcount) {
3917 pctx->errcode = ea_refcount_create(0, &ctx->refcount);
3928 if (ea_refcount_decrement(ctx->refcount, blk, 0) == 0)
4014 ea_refcount_store(ctx->refcount, blk, count);
5046 * Drop the refcount on the dup_block structure, and clear the entry
8715 /* Error allocating refcount structure */
8717 N_("@A refcount structure (%N): %m\n"),
8730 /* Error reading Extended Attribute block while fixing refcount */
8740 /* Error writing Extended Attribute block while fixing refcount */
8898 /* Error adjusting EA refcount */
8900 N_("Error adjusting refcount for @a @b %b (@i %i): %m\n"),
9214 /* Error adjusting EA refcount */
9216 N_("Error adjusting refcount for @a @b %b (@i %i): %m\n"),