|
@@ -365,22 +365,15 @@ static __be64 *gfs2_dir_get_hash_table(struct gfs2_inode *ip)
|
|
|
|
|
|
ret = gfs2_dir_read_data(ip, hc, hsize);
|
|
ret = gfs2_dir_read_data(ip, hc, hsize);
|
|
if (ret < 0) {
|
|
if (ret < 0) {
|
|
- if (is_vmalloc_addr(hc))
|
|
|
|
- vfree(hc);
|
|
|
|
- else
|
|
|
|
- kfree(hc);
|
|
|
|
|
|
+ kvfree(hc);
|
|
return ERR_PTR(ret);
|
|
return ERR_PTR(ret);
|
|
}
|
|
}
|
|
|
|
|
|
spin_lock(&inode->i_lock);
|
|
spin_lock(&inode->i_lock);
|
|
- if (ip->i_hash_cache) {
|
|
|
|
- if (is_vmalloc_addr(hc))
|
|
|
|
- vfree(hc);
|
|
|
|
- else
|
|
|
|
- kfree(hc);
|
|
|
|
- } else {
|
|
|
|
|
|
+ if (ip->i_hash_cache)
|
|
|
|
+ kvfree(hc);
|
|
|
|
+ else
|
|
ip->i_hash_cache = hc;
|
|
ip->i_hash_cache = hc;
|
|
- }
|
|
|
|
spin_unlock(&inode->i_lock);
|
|
spin_unlock(&inode->i_lock);
|
|
|
|
|
|
return ip->i_hash_cache;
|
|
return ip->i_hash_cache;
|
|
@@ -396,10 +389,7 @@ void gfs2_dir_hash_inval(struct gfs2_inode *ip)
|
|
{
|
|
{
|
|
__be64 *hc = ip->i_hash_cache;
|
|
__be64 *hc = ip->i_hash_cache;
|
|
ip->i_hash_cache = NULL;
|
|
ip->i_hash_cache = NULL;
|
|
- if (is_vmalloc_addr(hc))
|
|
|
|
- vfree(hc);
|
|
|
|
- else
|
|
|
|
- kfree(hc);
|
|
|
|
|
|
+ kvfree(hc);
|
|
}
|
|
}
|
|
|
|
|
|
static inline int gfs2_dirent_sentinel(const struct gfs2_dirent *dent)
|
|
static inline int gfs2_dirent_sentinel(const struct gfs2_dirent *dent)
|
|
@@ -1168,10 +1158,7 @@ fail:
|
|
gfs2_dinode_out(dip, dibh->b_data);
|
|
gfs2_dinode_out(dip, dibh->b_data);
|
|
brelse(dibh);
|
|
brelse(dibh);
|
|
out_kfree:
|
|
out_kfree:
|
|
- if (is_vmalloc_addr(hc2))
|
|
|
|
- vfree(hc2);
|
|
|
|
- else
|
|
|
|
- kfree(hc2);
|
|
|
|
|
|
+ kvfree(hc2);
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1302,14 +1289,6 @@ static void *gfs2_alloc_sort_buffer(unsigned size)
|
|
return ptr;
|
|
return ptr;
|
|
}
|
|
}
|
|
|
|
|
|
-static void gfs2_free_sort_buffer(void *ptr)
|
|
|
|
-{
|
|
|
|
- if (is_vmalloc_addr(ptr))
|
|
|
|
- vfree(ptr);
|
|
|
|
- else
|
|
|
|
- kfree(ptr);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int gfs2_dir_read_leaf(struct inode *inode, struct dir_context *ctx,
|
|
static int gfs2_dir_read_leaf(struct inode *inode, struct dir_context *ctx,
|
|
int *copied, unsigned *depth,
|
|
int *copied, unsigned *depth,
|
|
u64 leaf_no)
|
|
u64 leaf_no)
|
|
@@ -1393,7 +1372,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, struct dir_context *ctx,
|
|
out_free:
|
|
out_free:
|
|
for(i = 0; i < leaf; i++)
|
|
for(i = 0; i < leaf; i++)
|
|
brelse(larr[i]);
|
|
brelse(larr[i]);
|
|
- gfs2_free_sort_buffer(larr);
|
|
|
|
|
|
+ kvfree(larr);
|
|
out:
|
|
out:
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|
|
@@ -2004,10 +1983,7 @@ out_rlist:
|
|
gfs2_rlist_free(&rlist);
|
|
gfs2_rlist_free(&rlist);
|
|
gfs2_quota_unhold(dip);
|
|
gfs2_quota_unhold(dip);
|
|
out:
|
|
out:
|
|
- if (is_vmalloc_addr(ht))
|
|
|
|
- vfree(ht);
|
|
|
|
- else
|
|
|
|
- kfree(ht);
|
|
|
|
|
|
+ kvfree(ht);
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|
|
|
|
|