• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sbin/hastctl/

Lines Matching defs:res

93 create_one(struct hast_resource *res, intmax_t mediasize, intmax_t extentsize,
101 pjdlog_prefix_set("[%s] ", res->hr_name);
103 if (provinfo(res, true) == -1) {
108 mediasize = res->hr_local_mediasize;
109 else if (mediasize > res->hr_local_mediasize) {
111 res->hr_localpath);
115 if (!powerof2(res->hr_local_sectorsize)) {
117 res->hr_localpath, res->hr_local_sectorsize);
123 if (extentsize < res->hr_local_sectorsize) {
125 (intmax_t)extentsize, res->hr_local_sectorsize);
129 if ((extentsize % res->hr_local_sectorsize) != 0) {
131 (intmax_t)extentsize, res->hr_local_sectorsize);
136 extentsize, res->hr_local_sectorsize);
139 res->hr_datasize = mediasize - METADATA_SIZE - mapsize;
140 res->hr_extentsize = extentsize;
141 res->hr_keepdirty = keepdirty;
143 res->hr_localoff = METADATA_SIZE + mapsize;
145 if (metadata_write(res) == -1) {
156 if (pwrite(res->hr_localfd, buf, mapsize, METADATA_SIZE) !=
159 res->hr_localpath);
166 if (res->hr_localfd >= 0)
167 close(res->hr_localfd);
176 struct hast_resource *res;
184 TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) {
185 if (strcmp(argv[ii], res->hr_name) == 0)
188 if (res == NULL) {
194 ret = create_one(res, mediasize, extentsize, keepdirty);
202 dump_one(struct hast_resource *res)
206 ret = metadata_read(res, false);
210 printf("resource: %s\n", res->hr_name);
211 printf(" datasize: %ju (%NB)\n", (uintmax_t)res->hr_datasize,
212 (intmax_t)res->hr_datasize);
213 printf(" extentsize: %d (%NB)\n", res->hr_extentsize,
214 (intmax_t)res->hr_extentsize);
215 printf(" keepdirty: %d\n", res->hr_keepdirty);
216 printf(" localoff: %ju\n", (uintmax_t)res->hr_localoff);
217 printf(" resuid: %ju\n", (uintmax_t)res->hr_resuid);
218 printf(" localcnt: %ju\n", (uintmax_t)res->hr_primary_localcnt);
219 printf(" remotecnt: %ju\n", (uintmax_t)res->hr_primary_remotecnt);
220 printf(" prevrole: %s\n", role2str(res->hr_previous_role));
228 struct hast_resource *res;
235 TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) {
236 ret = dump_one(res);
244 TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) {
245 if (strcmp(argv[ii], res->hr_name) == 0)
248 if (res == NULL) {
254 ret = dump_one(res);
265 const char *res, *oldrole;
272 res = nv_get_string(nv, "resource%u", ii);
273 if (res == NULL)
275 pjdlog_prefix_set("[%s] ", res);