- struct getquota_args gq_args;
- struct getquota_rslt gq_rslt;
- struct timeval tv;
- char *hostpath;
-
- /* figure out the host and path */
- if ((hostpath = strchr(vol->v_gvs, ':')) == NULL) {
- syslog(LOG_ERR, "can't find hostname for %s", vol->v_gvs);
- return AFPERR_PARAM;
- }
-
- if (*(hostpath + 1) != '/')
- return AFPERR_PARAM;
-
- /* separate host from hostpath */
- *hostpath = '\0';
-
- gq_args.gqa_pathp = hostpath + 1;
- gq_args.gqa_uid = uid;
-
- if(callaurpc(vol, RQUOTAPROG, RQUOTAVERS, RQUOTAPROC_GETQUOTA,
- (xdrproc_t) xdr_getquota_args, (char *) &gq_args,
- (xdrproc_t) xdr_getquota_rslt, (char *) &gq_rslt) != 0) {
- syslog(LOG_INFO, "nfsquota: can't retrieve nfs quota information. \
-make sure that rpc.rquotad is running on %s.", vol->v_gvs);
- *hostpath = ':';
- return AFPERR_PARAM;
- }
-
- switch (gq_rslt.GQR_STATUS) {
- case Q_NOQUOTA:
- break;
-
- case Q_EPERM:
- syslog(LOG_ERR, "nfsquota: quota permission error, host: %s\n",
- vol->v_gvs);
- break;
-
- case Q_OK: /* we only copy the bits that we need. */
- gettimeofday(&tv, NULL);
-
-#ifdef __svr4__
- /* why doesn't using bsize work? */
-#define NFS_BSIZE (gq_rslt.GQR_RQUOTA.rq_bsize / DEV_BSIZE)
-#else
- /* NOTE: linux' rquotad program doesn't currently report the
- * correct rq_bsize. */
-#define NFS_BSIZE (gq_rslt.GQR_RQUOTA.rq_bsize / bsize)
-#endif
-
- dqp->dqb_bhardlimit =
- gq_rslt.GQR_RQUOTA.rq_bhardlimit*NFS_BSIZE;
- dqp->dqb_bsoftlimit =
- gq_rslt.GQR_RQUOTA.rq_bsoftlimit*NFS_BSIZE;
- dqp->dqb_curblocks =
- gq_rslt.GQR_RQUOTA.rq_curblocks*NFS_BSIZE;
+ struct getquota_args gq_args;
+ struct getquota_rslt gq_rslt;
+ struct timeval tv;
+ char *hostpath;
+
+ /* figure out the host and path */
+ if ((hostpath = strchr(vol->v_gvs, ':')) == NULL) {
+ LOG(log_error, logtype_afpd, "can't find hostname for %s", vol->v_gvs);
+ return AFPERR_PARAM;
+ }
+
+ if (*(hostpath + 1) != '/')
+ return AFPERR_PARAM;
+
+ /* separate host from hostpath */
+ *hostpath = '\0';
+
+ gq_args.gqa_pathp = hostpath + 1;
+ gq_args.gqa_uid = uid;
+
+ if(callaurpc(vol, RQUOTAPROG, RQUOTAVERS, RQUOTAPROC_GETQUOTA,
+ (xdrproc_t) xdr_getquota_args, (char *) &gq_args,
+ (xdrproc_t) xdr_getquota_rslt, (char *) &gq_rslt) != 0) {
+ LOG(log_info, logtype_afpd, "nfsquota: can't retrieve nfs quota information. \
+ make sure that rpc.rquotad is running on %s.", vol->v_gvs);
+ *hostpath = ':';
+ return AFPERR_PARAM;
+ }
+
+ switch (gq_rslt.GQR_STATUS) {
+ case Q_NOQUOTA:
+ break;
+
+ case Q_EPERM:
+ LOG(log_error, logtype_afpd, "nfsquota: quota permission error, host: %s",
+ vol->v_gvs);
+ break;
+
+ case Q_OK: /* we only copy the bits that we need. */
+ gettimeofday(&tv, NULL);
+
+#if defined(__svr4__) || defined(TRU64)
+ /* why doesn't using bsize work? */
+#define NFS_BSIZE gq_rslt.GQR_RQUOTA.rq_bsize / DEV_BSIZE
+#else /* __svr4__ || TRU64 */
+ /* NOTE: linux' rquotad program doesn't currently report the
+ * correct rq_bsize. */
+ /* NOTE: This is integer division and can introduce rounding errors */
+#define NFS_BSIZE gq_rslt.GQR_RQUOTA.rq_bsize / bsize
+#endif /* __svr4__ || TRU64 */
+
+ dqp->dqb_bhardlimit =
+ gq_rslt.GQR_RQUOTA.rq_bhardlimit*NFS_BSIZE;
+ dqp->dqb_bsoftlimit =
+ gq_rslt.GQR_RQUOTA.rq_bsoftlimit*NFS_BSIZE;
+ dqp->dqb_curblocks =
+ gq_rslt.GQR_RQUOTA.rq_curblocks*NFS_BSIZE;