| 336 | } |
| 337 | |
| 338 | int |
| 339 | quota_read(struct quotafile *qf, struct dqblk *dqb, int id) |
| 340 | { |
| 341 | int qcmd; |
| 342 | |
| 343 | if (qf->fd == -1) { |
| 344 | qcmd = QCMD(Q_GETQUOTA, qf->quotatype); |
| 345 | return (quotactl(qf->fsname, qcmd, id, dqb)); |
| 346 | } |
| 347 | switch (qf->wordsize) { |
| 348 | case 32: |
| 349 | return (quota_read32(qf, dqb, id)); |
| 350 | case 64: |
| 351 | return (quota_read64(qf, dqb, id)); |
| 352 | default: |
| 353 | errno = EINVAL; |
| 354 | return (-1); |
| 355 | } |
| 356 | /* not reached */ |
| 357 | } |
| 358 | |
| 359 | #define CLIP32(u64) ((u64) > UINT32_MAX ? UINT32_MAX : (uint32_t)(u64)) |
| 360 |
no test coverage detected