Commit 7d9056ba authored by Jan Kara's avatar Jan Kara Committed by Mark Fasheh

quota: Export dquot_alloc() and dquot_destroy() functions

These are default functions for creating and destroying quota structures
and they should be used from filesystems.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarMark Fasheh <mfasheh@suse.com>
parent 5cd9d5bb
...@@ -413,10 +413,11 @@ int dquot_release(struct dquot *dquot) ...@@ -413,10 +413,11 @@ int dquot_release(struct dquot *dquot)
return ret; return ret;
} }
static void dquot_destroy(struct dquot *dquot) void dquot_destroy(struct dquot *dquot)
{ {
kmem_cache_free(dquot_cachep, dquot); kmem_cache_free(dquot_cachep, dquot);
} }
EXPORT_SYMBOL(dquot_destroy);
static inline void do_destroy_dquot(struct dquot *dquot) static inline void do_destroy_dquot(struct dquot *dquot)
{ {
...@@ -668,10 +669,11 @@ void dqput(struct dquot *dquot) ...@@ -668,10 +669,11 @@ void dqput(struct dquot *dquot)
spin_unlock(&dq_list_lock); spin_unlock(&dq_list_lock);
} }
static struct dquot *dquot_alloc(struct super_block *sb, int type) struct dquot *dquot_alloc(struct super_block *sb, int type)
{ {
return kmem_cache_zalloc(dquot_cachep, GFP_NOFS); return kmem_cache_zalloc(dquot_cachep, GFP_NOFS);
} }
EXPORT_SYMBOL(dquot_alloc);
static struct dquot *get_empty_dquot(struct super_block *sb, int type) static struct dquot *get_empty_dquot(struct super_block *sb, int type)
{ {
......
...@@ -31,6 +31,8 @@ int dquot_is_cached(struct super_block *sb, unsigned int id, int type); ...@@ -31,6 +31,8 @@ int dquot_is_cached(struct super_block *sb, unsigned int id, int type);
int dquot_scan_active(struct super_block *sb, int dquot_scan_active(struct super_block *sb,
int (*fn)(struct dquot *dquot, unsigned long priv), int (*fn)(struct dquot *dquot, unsigned long priv),
unsigned long priv); unsigned long priv);
struct dquot *dquot_alloc(struct super_block *sb, int type);
void dquot_destroy(struct dquot *dquot);
int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc);
int dquot_alloc_inode(const struct inode *inode, qsize_t number); int dquot_alloc_inode(const struct inode *inode, qsize_t number);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment