Lines Matching defs:buf

21 #define freedqbuf(buf)		quota_free_mem(&buf)
25 dqbuf_t buf;
26 if (quota_get_memzero(QT_BLKSIZE, &buf)) {
31 return buf;
62 static void read_blk(struct quota_handle *h, unsigned int blk, dqbuf_t buf)
66 err = h->read(&h->qh_qf, blk << QT_BLKSIZE_BITS, buf,
71 memset(buf + err, 0, QT_BLKSIZE - err);
75 static int write_blk(struct quota_handle *h, unsigned int blk, dqbuf_t buf)
79 err = h->write(&h->qh_qf, blk << QT_BLKSIZE_BITS, buf,
91 dqbuf_t buf = getdqbuf();
92 struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
96 if (!buf)
101 read_blk(h, blk, buf);
104 memset(buf, 0, QT_BLKSIZE);
106 if (write_blk(h, info->dqi_blocks, buf) < 0) {
107 freedqbuf(buf);
115 freedqbuf(buf);
120 static void put_free_dqblk(struct quota_handle *h, dqbuf_t buf,
123 struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
131 write_blk(h, blk, buf);
135 static void remove_free_dqentry(struct quota_handle *h, dqbuf_t buf,
139 struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
163 write_blk(h, blk, buf); /* No matter whether write succeeds
168 static void insert_free_dqentry(struct quota_handle *h, dqbuf_t buf,
172 struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
180 write_blk(h, blk, buf);
200 dqbuf_t buf;
203 buf = getdqbuf();
204 if (!buf) {
209 dh = (struct qt_disk_dqdbheader *)buf;
212 read_blk(h, blk, buf);
216 freedqbuf(buf);
220 memset(buf, 0, QT_BLKSIZE);
228 remove_free_dqentry(h, buf, blk);
233 ddquot = buf + sizeof(struct qt_disk_dqdbheader);
242 write_blk(h, blk, buf);
246 freedqbuf(buf);
254 dqbuf_t buf;
261 buf = getdqbuf();
262 if (!buf)
270 memset(buf, 0, QT_BLKSIZE);
273 read_blk(h, *treeblk, buf);
276 ref = (__le32 *) buf;
293 ret = write_blk(h, *treeblk, buf);
297 put_free_dqblk(h, buf, *treeblk);
301 freedqbuf(buf);
368 dqbuf_t buf = getdqbuf();
370 if (!buf)
379 read_blk(h, blk, buf);
380 dh = (struct qt_disk_dqdbheader *)buf;
385 remove_free_dqentry(h, buf, blk);
386 put_free_dqblk(h, buf, blk);
388 memset(buf + (dquot->dq_dqb.u.v2_mdqb.dqb_off &
396 insert_free_dqentry(h, buf, blk);
398 write_blk(h, blk, buf);
401 freedqbuf(buf);
408 dqbuf_t buf = getdqbuf();
410 __le32 *ref = (__le32 *) buf;
412 if (!buf)
415 read_blk(h, *blk, buf);
430 for (i = 0; i < QT_BLKSIZE && !buf[i]; i++);
434 put_free_dqblk(h, buf, *blk);
437 write_blk(h, *blk, buf);
440 freedqbuf(buf);
458 dqbuf_t buf = getdqbuf();
460 char *ddquot = buf + sizeof(struct qt_disk_dqdbheader);
462 if (!buf)
465 read_blk(h, blk, buf);
474 freedqbuf(buf);
484 dqbuf_t buf = getdqbuf();
486 __le32 *ref = (__le32 *) buf;
488 if (!buf)
491 read_blk(h, blk, buf);
501 freedqbuf(buf);
564 dqbuf_t buf = getdqbuf();
569 if (!buf)
573 read_blk(dquot->dq_h, blk, buf);
574 dh = (struct qt_disk_dqdbheader *)buf;
575 ddata = buf + sizeof(struct qt_disk_dqdbheader);
588 freedqbuf(buf);
611 dqbuf_t buf = getdqbuf();
612 __le32 *ref = (__le32 *) buf;
614 if (!buf)
617 read_blk(dquot->dq_h, blk, buf);
640 freedqbuf(buf);