MCPcopy Create free account
hub / github.com/F-Stack/f-stack / quota_read32

Function quota_read32

tools/libutil/quotafile.c:282–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282static int
283quota_read32(struct quotafile *qf, struct dqblk *dqb, int id)
284{
285 struct dqblk32 dqb32;
286 off_t off;
287
288 off = id * sizeof(struct dqblk32);
289 if (lseek(qf->fd, off, SEEK_SET) == -1)
290 return (-1);
291 switch (read(qf->fd, &dqb32, sizeof(dqb32))) {
292 case 0:
293 memset(dqb, 0, sizeof(*dqb));
294 return (0);
295 case sizeof(dqb32):
296 dqb->dqb_bhardlimit = dqb32.dqb_bhardlimit;
297 dqb->dqb_bsoftlimit = dqb32.dqb_bsoftlimit;
298 dqb->dqb_curblocks = dqb32.dqb_curblocks;
299 dqb->dqb_ihardlimit = dqb32.dqb_ihardlimit;
300 dqb->dqb_isoftlimit = dqb32.dqb_isoftlimit;
301 dqb->dqb_curinodes = dqb32.dqb_curinodes;
302 dqb->dqb_btime = dqb32.dqb_btime;
303 dqb->dqb_itime = dqb32.dqb_itime;
304 return (0);
305 default:
306 return (-1);
307 }
308}
309
310static int
311quota_read64(struct quotafile *qf, struct dqblk *dqb, int id)

Callers 1

quota_readFunction · 0.85

Calls 2

memsetFunction · 0.85
readFunction · 0.50

Tested by

no test coverage detected