Lines Matching refs:buf
52 char *buf = kmalloc(size, GFP_NOFS); in getdqbuf() local
53 if (!buf) in getdqbuf()
56 return buf; in getdqbuf()
59 static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf) in read_blk() argument
63 memset(buf, 0, info->dqi_usable_bs); in read_blk()
64 return sb->s_op->quota_read(sb, info->dqi_type, buf, in read_blk()
68 static ssize_t write_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf) in write_blk() argument
73 ret = sb->s_op->quota_write(sb, info->dqi_type, buf, in write_blk()
115 char *buf = getdqbuf(info->dqi_usable_bs); in get_free_dqblk() local
116 struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf; in get_free_dqblk()
119 if (!buf) in get_free_dqblk()
123 ret = read_blk(info, blk, buf); in get_free_dqblk()
132 memset(buf, 0, info->dqi_usable_bs); in get_free_dqblk()
134 ret = write_blk(info, info->dqi_blocks, buf); in get_free_dqblk()
142 kfree(buf); in get_free_dqblk()
147 static int put_free_dqblk(struct qtree_mem_dqinfo *info, char *buf, uint blk) in put_free_dqblk() argument
149 struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf; in put_free_dqblk()
155 err = write_blk(info, blk, buf); in put_free_dqblk()
164 static int remove_free_dqentry(struct qtree_mem_dqinfo *info, char *buf, in remove_free_dqentry() argument
168 struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf; in remove_free_dqentry()
201 if (write_blk(info, blk, buf) < 0) in remove_free_dqentry()
211 static int insert_free_dqentry(struct qtree_mem_dqinfo *info, char *buf, in insert_free_dqentry() argument
215 struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf; in insert_free_dqentry()
222 err = write_blk(info, blk, buf); in insert_free_dqentry()
262 char *buf = getdqbuf(info->dqi_usable_bs); in find_free_dqentry() local
266 if (!buf) { in find_free_dqentry()
270 dh = (struct qt_disk_dqdbheader *)buf; in find_free_dqentry()
273 *err = read_blk(info, blk, buf); in find_free_dqentry()
283 kfree(buf); in find_free_dqentry()
286 memset(buf, 0, info->dqi_usable_bs); in find_free_dqentry()
294 *err = remove_free_dqentry(info, buf, blk); in find_free_dqentry()
303 ddquot = buf + sizeof(struct qt_disk_dqdbheader); in find_free_dqentry()
316 *err = write_blk(info, blk, buf); in find_free_dqentry()
325 kfree(buf); in find_free_dqentry()
328 kfree(buf); in find_free_dqentry()
336 char *buf = getdqbuf(info->dqi_usable_bs); in do_insert_tree() local
341 if (!buf) in do_insert_tree()
348 memset(buf, 0, info->dqi_usable_bs); in do_insert_tree()
351 ret = read_blk(info, *treeblk, buf); in do_insert_tree()
358 ref = (__le32 *)buf; in do_insert_tree()
380 ret = write_blk(info, *treeblk, buf); in do_insert_tree()
382 put_free_dqblk(info, buf, *treeblk); in do_insert_tree()
385 kfree(buf); in do_insert_tree()
452 char *buf = getdqbuf(info->dqi_usable_bs); in free_dqentry() local
455 if (!buf) in free_dqentry()
464 ret = read_blk(info, blk, buf); in free_dqentry()
470 dh = (struct qt_disk_dqdbheader *)buf; in free_dqentry()
476 ret = remove_free_dqentry(info, buf, blk); in free_dqentry()
478 ret = put_free_dqblk(info, buf, blk); in free_dqentry()
485 memset(buf + in free_dqentry()
491 ret = insert_free_dqentry(info, buf, blk); in free_dqentry()
498 ret = write_blk(info, blk, buf); in free_dqentry()
508 kfree(buf); in free_dqentry()
516 char *buf = getdqbuf(info->dqi_usable_bs); in remove_tree() local
519 __le32 *ref = (__le32 *)buf; in remove_tree()
521 if (!buf) in remove_tree()
523 ret = read_blk(info, *blk, buf); in remove_tree()
552 put_free_dqblk(info, buf, *blk); in remove_tree()
555 ret = write_blk(info, *blk, buf); in remove_tree()
563 kfree(buf); in remove_tree()
582 char *buf = getdqbuf(info->dqi_usable_bs); in find_block_dqentry() local
587 if (!buf) in find_block_dqentry()
589 ret = read_blk(info, blk, buf); in find_block_dqentry()
595 ddquot = buf + sizeof(struct qt_disk_dqdbheader); in find_block_dqentry()
612 kfree(buf); in find_block_dqentry()
620 char *buf = getdqbuf(info->dqi_usable_bs); in find_tree_dqentry() local
622 __le32 *ref = (__le32 *)buf; in find_tree_dqentry()
624 if (!buf) in find_tree_dqentry()
626 ret = read_blk(info, blk, buf); in find_tree_dqentry()
648 kfree(buf); in find_tree_dqentry()
735 char *buf = getdqbuf(info->dqi_usable_bs); in find_next_id() local
736 __le32 *ref = (__le32 *)buf; in find_next_id()
742 if (!buf) in find_next_id()
748 ret = read_blk(info, blk, buf); in find_next_id()
772 kfree(buf); in find_next_id()