Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-6245 libcfs: remove prim wrappers for libcfs
[fs/lustre-release.git]
/
lustre
/
osd-ldiskfs
/
osd_quota_fmt.c
diff --git
a/lustre/osd-ldiskfs/osd_quota_fmt.c
b/lustre/osd-ldiskfs/osd_quota_fmt.c
index
45f3e08
..
482f817
100644
(file)
--- a/
lustre/osd-ldiskfs/osd_quota_fmt.c
+++ b/
lustre/osd-ldiskfs/osd_quota_fmt.c
@@
-21,7
+21,7
@@
* GPL HEADER END
*/
/*
* GPL HEADER END
*/
/*
- * Copyright (c) 201
1, 2012, Whamcloud, Inc
.
+ * Copyright (c) 201
2, 2014, Intel Corporation
.
* Use is subject to license terms.
*
* Lustre administrative quota format.
* Use is subject to license terms.
*
* Lustre administrative quota format.
@@
-40,7
+40,7
@@
static const union
static inline dqbuf_t getdqbuf(void)
{
static inline dqbuf_t getdqbuf(void)
{
- dqbuf_t buf =
cfs_alloc(LUSTRE_DQBLKSIZE, CFS_ALLOC_IO
);
+ dqbuf_t buf =
kmalloc(LUSTRE_DQBLKSIZE, GFP_NOFS
);
if (!buf)
CWARN("Not enough memory for quota buffers.\n");
return buf;
if (!buf)
CWARN("Not enough memory for quota buffers.\n");
return buf;
@@
-48,7
+48,7
@@
static inline dqbuf_t getdqbuf(void)
static inline void freedqbuf(dqbuf_t buf)
{
static inline void freedqbuf(dqbuf_t buf)
{
-
cfs_
free(buf);
+
k
free(buf);
}
/**
}
/**
@@
-65,7
+65,7
@@
static ssize_t quota_read_blk(const struct lu_env *env,
memset(buf, 0, LUSTRE_DQBLKSIZE);
memset(buf, 0, LUSTRE_DQBLKSIZE);
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2,
7,50,
0)
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2,
7, 53,
0)
/* type is set as -1 when reading old admin quota file */
if (type != USRQUOTA && type != GRPQUOTA) {
struct lu_buf lu_buffer;
/* type is set as -1 when reading old admin quota file */
if (type != USRQUOTA && type != GRPQUOTA) {
struct lu_buf lu_buffer;
@@
-180,7
+180,7
@@
loff_t find_tree_dqentry(const struct lu_env *env,
if (!buf)
RETURN(-ENOMEM);
if (!buf)
RETURN(-ENOMEM);
- ret = quota_read_blk(env, obj,
0
, blk, buf);
+ ret = quota_read_blk(env, obj,
type
, blk, buf);
if (ret < 0) {
CERROR("Can't read quota tree block %u.\n", blk);
GOTO(out_buf, ret);
if (ret < 0) {
CERROR("Can't read quota tree block %u.\n", blk);
GOTO(out_buf, ret);
@@
-218,7
+218,7
@@
int walk_block_dqentry(const struct lu_env *env, struct osd_object *obj,
int type, uint blk, uint index,
struct osd_it_quota *it)
{
int type, uint blk, uint index,
struct osd_it_quota *it)
{
- dqbuf_t buf
= getdqbuf()
;
+ dqbuf_t buf;
loff_t ret = 0;
struct lustre_disk_dqdbheader *dqhead;
int i, dqblk_sz;
loff_t ret = 0;
struct lustre_disk_dqdbheader *dqhead;
int i, dqblk_sz;
@@
-227,11
+227,12
@@
int walk_block_dqentry(const struct lu_env *env, struct osd_object *obj,
ENTRY;
/* check if the leaf block has been processed before */
ENTRY;
/* check if the leaf block has been processed before */
-
cfs_
list_for_each_entry(leaf, &it->oiq_list, oql_link) {
+ list_for_each_entry(leaf, &it->oiq_list, oql_link) {
if (leaf->oql_blk == blk)
RETURN(1);
}
if (leaf->oql_blk == blk)
RETURN(1);
}
+ buf = getdqbuf();
dqhead = (struct lustre_disk_dqdbheader *)buf;
dqblk_sz = sizeof(struct lustre_disk_dqblk_v2);
if (!buf)
dqhead = (struct lustre_disk_dqdbheader *)buf;
dqblk_sz = sizeof(struct lustre_disk_dqblk_v2);
if (!buf)
@@
-243,7
+244,7
@@
int walk_block_dqentry(const struct lu_env *env, struct osd_object *obj,
}
ret = 1;
}
ret = 1;
- if (!le
32
_to_cpu(dqhead->dqdh_entries))
+ if (!le
16
_to_cpu(dqhead->dqdh_entries))
GOTO(out_buf, ret);
ddquot = (struct lustre_disk_dqblk_v2 *)GETENTRIES(buf);
GOTO(out_buf, ret);
ddquot = (struct lustre_disk_dqblk_v2 *)GETENTRIES(buf);