@@ -47,15 +47,6 @@ static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
47
47
/ info -> dqi_entry_size ;
48
48
}
49
49
50
- static char * getdqbuf (size_t size )
51
- {
52
- char * buf = kmalloc (size , GFP_NOFS );
53
- if (!buf )
54
- printk (KERN_WARNING
55
- "VFS: Not enough memory for quota buffers.\n" );
56
- return buf ;
57
- }
58
-
59
50
static ssize_t read_blk (struct qtree_mem_dqinfo * info , uint blk , char * buf )
60
51
{
61
52
struct super_block * sb = info -> dqi_sb ;
@@ -83,7 +74,7 @@ static ssize_t write_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
83
74
/* Remove empty block from list and return it */
84
75
static int get_free_dqblk (struct qtree_mem_dqinfo * info )
85
76
{
86
- char * buf = getdqbuf (info -> dqi_usable_bs );
77
+ char * buf = kmalloc (info -> dqi_usable_bs , GFP_NOFS );
87
78
struct qt_disk_dqdbheader * dh = (struct qt_disk_dqdbheader * )buf ;
88
79
int ret , blk ;
89
80
@@ -132,7 +123,7 @@ static int put_free_dqblk(struct qtree_mem_dqinfo *info, char *buf, uint blk)
132
123
static int remove_free_dqentry (struct qtree_mem_dqinfo * info , char * buf ,
133
124
uint blk )
134
125
{
135
- char * tmpbuf = getdqbuf (info -> dqi_usable_bs );
126
+ char * tmpbuf = kmalloc (info -> dqi_usable_bs , GFP_NOFS );
136
127
struct qt_disk_dqdbheader * dh = (struct qt_disk_dqdbheader * )buf ;
137
128
uint nextblk = le32_to_cpu (dh -> dqdh_next_free );
138
129
uint prevblk = le32_to_cpu (dh -> dqdh_prev_free );
@@ -179,7 +170,7 @@ static int remove_free_dqentry(struct qtree_mem_dqinfo *info, char *buf,
179
170
static int insert_free_dqentry (struct qtree_mem_dqinfo * info , char * buf ,
180
171
uint blk )
181
172
{
182
- char * tmpbuf = getdqbuf (info -> dqi_usable_bs );
173
+ char * tmpbuf = kmalloc (info -> dqi_usable_bs , GFP_NOFS );
183
174
struct qt_disk_dqdbheader * dh = (struct qt_disk_dqdbheader * )buf ;
184
175
int err ;
185
176
@@ -227,7 +218,7 @@ static uint find_free_dqentry(struct qtree_mem_dqinfo *info,
227
218
{
228
219
uint blk , i ;
229
220
struct qt_disk_dqdbheader * dh ;
230
- char * buf = getdqbuf (info -> dqi_usable_bs );
221
+ char * buf = kmalloc (info -> dqi_usable_bs , GFP_NOFS );
231
222
char * ddquot ;
232
223
233
224
* err = 0 ;
@@ -298,7 +289,7 @@ static uint find_free_dqentry(struct qtree_mem_dqinfo *info,
298
289
static int do_insert_tree (struct qtree_mem_dqinfo * info , struct dquot * dquot ,
299
290
uint * treeblk , int depth )
300
291
{
301
- char * buf = getdqbuf (info -> dqi_usable_bs );
292
+ char * buf = kmalloc (info -> dqi_usable_bs , GFP_NOFS );
302
293
int ret = 0 , newson = 0 , newact = 0 ;
303
294
__le32 * ref ;
304
295
uint newblk ;
@@ -375,7 +366,7 @@ int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
375
366
int type = dquot -> dq_id .type ;
376
367
struct super_block * sb = dquot -> dq_sb ;
377
368
ssize_t ret ;
378
- char * ddquot = getdqbuf (info -> dqi_entry_size );
369
+ char * ddquot = kmalloc (info -> dqi_entry_size , GFP_NOFS );
379
370
380
371
if (!ddquot )
381
372
return - ENOMEM ;
@@ -414,7 +405,7 @@ static int free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot,
414
405
uint blk )
415
406
{
416
407
struct qt_disk_dqdbheader * dh ;
417
- char * buf = getdqbuf (info -> dqi_usable_bs );
408
+ char * buf = kmalloc (info -> dqi_usable_bs , GFP_NOFS );
418
409
int ret = 0 ;
419
410
420
411
if (!buf )
@@ -474,7 +465,7 @@ static int free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot,
474
465
static int remove_tree (struct qtree_mem_dqinfo * info , struct dquot * dquot ,
475
466
uint * blk , int depth )
476
467
{
477
- char * buf = getdqbuf (info -> dqi_usable_bs );
468
+ char * buf = kmalloc (info -> dqi_usable_bs , GFP_NOFS );
478
469
int ret = 0 ;
479
470
uint newblk ;
480
471
__le32 * ref = (__le32 * )buf ;
@@ -533,7 +524,7 @@ EXPORT_SYMBOL(qtree_delete_dquot);
533
524
static loff_t find_block_dqentry (struct qtree_mem_dqinfo * info ,
534
525
struct dquot * dquot , uint blk )
535
526
{
536
- char * buf = getdqbuf (info -> dqi_usable_bs );
527
+ char * buf = kmalloc (info -> dqi_usable_bs , GFP_NOFS );
537
528
loff_t ret = 0 ;
538
529
int i ;
539
530
char * ddquot ;
@@ -571,7 +562,7 @@ static loff_t find_block_dqentry(struct qtree_mem_dqinfo *info,
571
562
static loff_t find_tree_dqentry (struct qtree_mem_dqinfo * info ,
572
563
struct dquot * dquot , uint blk , int depth )
573
564
{
574
- char * buf = getdqbuf (info -> dqi_usable_bs );
565
+ char * buf = kmalloc (info -> dqi_usable_bs , GFP_NOFS );
575
566
loff_t ret = 0 ;
576
567
__le32 * ref = (__le32 * )buf ;
577
568
@@ -635,7 +626,7 @@ int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
635
626
}
636
627
dquot -> dq_off = offset ;
637
628
}
638
- ddquot = getdqbuf (info -> dqi_entry_size );
629
+ ddquot = kmalloc (info -> dqi_entry_size , GFP_NOFS );
639
630
if (!ddquot )
640
631
return - ENOMEM ;
641
632
ret = sb -> s_op -> quota_read (sb , type , ddquot , info -> dqi_entry_size ,
@@ -679,7 +670,7 @@ EXPORT_SYMBOL(qtree_release_dquot);
679
670
static int find_next_id (struct qtree_mem_dqinfo * info , qid_t * id ,
680
671
unsigned int blk , int depth )
681
672
{
682
- char * buf = getdqbuf (info -> dqi_usable_bs );
673
+ char * buf = kmalloc (info -> dqi_usable_bs , GFP_NOFS );
683
674
__le32 * ref = (__le32 * )buf ;
684
675
ssize_t ret ;
685
676
unsigned int epb = info -> dqi_usable_bs >> 2 ;
0 commit comments