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

Function quota_maxid

tools/libutil/quotafile.c:260–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260int
261quota_maxid(struct quotafile *qf)
262{
263 struct stat st;
264 int maxid;
265
266 if (stat(qf->qfname, &st) < 0)
267 return (0);
268 switch (qf->wordsize) {
269 case 32:
270 maxid = st.st_size / sizeof(struct dqblk32) - 1;
271 break;
272 case 64:
273 maxid = st.st_size / sizeof(struct dqblk64) - 2;
274 break;
275 default:
276 maxid = 0;
277 break;
278 }
279 return (maxid > 0 ? maxid : 0);
280}
281
282static int
283quota_read32(struct quotafile *qf, struct dqblk *dqb, int id)

Callers 1

quota_convertFunction · 0.85

Calls 1

statClass · 0.70

Tested by

no test coverage detected