コード例 #1
0
ファイル: set.c プロジェクト: tgockel/nvml
/*
 * util_poolset_files -- (internal) open or create all the part files
 *                       of a pool set and replica sets
 */
static int
util_poolset_files(struct pool_set *set, size_t minsize, int create)
{
	LOG(3, "set %p minsize %zu create %d", set, minsize, create);

	for (unsigned r = 0; r < set->nreplicas; r++) {
		struct pool_replica *rep = set->replica[r];
		for (unsigned p = 0; p < rep->nparts; p++) {
			if (util_poolset_file(&rep->part[p], minsize, create))
				return -1;

			rep->repsize +=
				(rep->part[p].filesize & ~(Pagesize - 1));
		}
	}

	return 0;
}
コード例 #2
0
ファイル: set.c プロジェクト: bgbhpe/nvml
/*
 * util_poolset_files -- (internal) open or create all the part files
 *                       of a pool set and replica sets
 */
static int
util_poolset_files(struct pool_set *set, size_t minsize, int create)
{
	LOG(3, "set %p minsize %zu create %d", set, minsize, create);

	for (unsigned r = 0; r < set->nreplicas; r++) {
		struct pool_replica *rep = set->replica[r];
		/*
		 * Skip remote replicas - they should be created
		 * by the upper layer.
		 */
		if (rep->remote) {
			LOG(3, "replica %d is a remote one - skipping...", r);
			continue;
		}
		for (unsigned p = 0; p < rep->nparts; p++) {
			if (util_poolset_file(&rep->part[p], minsize, create))
				return -1;
		}
	}

	return 0;
}