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
- lost #define changes from 1_6
[fs/lustre-release.git]
/
lustre
/
quota
/
quota_master.c
diff --git
a/lustre/quota/quota_master.c
b/lustre/quota/quota_master.c
index
86f4b72
..
f09b7c3
100644
(file)
--- a/
lustre/quota/quota_master.c
+++ b/
lustre/quota/quota_master.c
@@
-39,7
+39,7
@@
static struct list_head lustre_dquot_hash[NR_DQHASH];
static spinlock_t dquot_hash_lock = SPIN_LOCK_UNLOCKED;
static struct list_head lustre_dquot_hash[NR_DQHASH];
static spinlock_t dquot_hash_lock = SPIN_LOCK_UNLOCKED;
-
k
mem_cache_t *lustre_dquot_cachep;
+
cfs_
mem_cache_t *lustre_dquot_cachep;
int lustre_dquot_init(void)
{
int lustre_dquot_init(void)
{
@@
-47,9
+47,9
@@
int lustre_dquot_init(void)
ENTRY;
LASSERT(lustre_dquot_cachep == NULL);
ENTRY;
LASSERT(lustre_dquot_cachep == NULL);
- lustre_dquot_cachep =
k
mem_cache_create("lustre_dquot_cache",
- sizeof(struct lustre_dquot),
-
0, 0, NULL, NULL
);
+ lustre_dquot_cachep =
cfs_
mem_cache_create("lustre_dquot_cache",
+
sizeof(struct lustre_dquot),
+
0, 0
);
if (!lustre_dquot_cachep)
return (-ENOMEM);
if (!lustre_dquot_cachep)
return (-ENOMEM);
@@
-69,13
+69,9
@@
void lustre_dquot_exit(void)
LASSERT(list_empty(lustre_dquot_hash + i));
}
if (lustre_dquot_cachep) {
LASSERT(list_empty(lustre_dquot_hash + i));
}
if (lustre_dquot_cachep) {
-#ifdef HAVE_KMEM_CACHE_DESTROY_INT
int rc;
int rc;
- rc =
k
mem_cache_destroy(lustre_dquot_cachep);
+ rc =
cfs_
mem_cache_destroy(lustre_dquot_cachep);
LASSERTF(rc == 0,"couldn't destroy lustre_dquot_cachep slab\n");
LASSERTF(rc == 0,"couldn't destroy lustre_dquot_cachep slab\n");
-#else
- kmem_cache_destroy(lustre_dquot_cachep);
-#endif
lustre_dquot_cachep = NULL;
}
EXIT;
lustre_dquot_cachep = NULL;
}
EXIT;
@@
-116,7
+112,7
@@
static struct lustre_dquot *alloc_dquot(struct lustre_quota_info *lqi,
struct lustre_dquot *dquot = NULL;
ENTRY;
struct lustre_dquot *dquot = NULL;
ENTRY;
- OBD_SLAB_ALLOC(dquot, lustre_dquot_cachep,
SLAB_NOFS
, sizeof(*dquot));
+ OBD_SLAB_ALLOC(dquot, lustre_dquot_cachep,
CFS_ALLOC_IO
, sizeof(*dquot));
if (dquot == NULL)
RETURN(NULL);
if (dquot == NULL)
RETURN(NULL);
@@
-218,9
+214,6
@@
int dqacq_handler(struct obd_device *obd, struct qunit_data *qdata, int opc)
OBD_FAIL_RETURN(OBD_FAIL_OBD_DQACQ, -EIO);
OBD_FAIL_RETURN(OBD_FAIL_OBD_DQACQ, -EIO);
- /* slaves never acquires qunit for user root */
- LASSERT(qdata->qd_id || qdata_type);
-
dquot = lustre_dqget(obd, info, qdata->qd_id, qdata_type);
if (IS_ERR(dquot))
RETURN(PTR_ERR(dquot));
dquot = lustre_dqget(obd, info, qdata->qd_id, qdata_type);
if (IS_ERR(dquot))
RETURN(PTR_ERR(dquot));
@@
-305,7
+298,7
@@
int mds_quota_adjust(struct obd_device *obd, unsigned int qcids[],
int rc2 = 0;
ENTRY;
int rc2 = 0;
ENTRY;
- if (rc && rc != -EDQUOT
&& rc != ENOLCK
)
+ if (rc && rc != -EDQUOT)
RETURN(0);
switch (opc) {
RETURN(0);
switch (opc) {
@@
-655,31
+648,32
@@
static int mds_init_slave_ilimits(struct obd_device *obd,
/* XXX: for file limits only adjust local now */
unsigned int uid = 0, gid = 0;
struct obd_quotactl *ioqc = NULL;
/* XXX: for file limits only adjust local now */
unsigned int uid = 0, gid = 0;
struct obd_quotactl *ioqc = NULL;
+ int flag;
int rc;
ENTRY;
/* if we are going to set zero limit, needn't init slaves */
int rc;
ENTRY;
/* if we are going to set zero limit, needn't init slaves */
- if (!oqctl->qc_dqblk.dqb_ihardlimit && !oqctl->qc_dqblk.dqb_isoftlimit)
+ if (!oqctl->qc_dqblk.dqb_ihardlimit && !oqctl->qc_dqblk.dqb_isoftlimit &&
+ set)
RETURN(0);
RETURN(0);
-
- if (!set)
- goto acquire;
OBD_ALLOC_PTR(ioqc);
if (!ioqc)
RETURN(-ENOMEM);
OBD_ALLOC_PTR(ioqc);
if (!ioqc)
RETURN(-ENOMEM);
-
- ioqc->qc_cmd = Q_INITQUOTA;
+
+ flag = oqctl->qc_dqblk.dqb_ihardlimit ||
+ oqctl->qc_dqblk.dqb_isoftlimit || set;
+ ioqc->qc_cmd = flag ? Q_INITQUOTA : Q_SETQUOTA;
ioqc->qc_id = oqctl->qc_id;
ioqc->qc_type = oqctl->qc_type;
ioqc->qc_dqblk.dqb_valid = QIF_ILIMITS;
ioqc->qc_id = oqctl->qc_id;
ioqc->qc_type = oqctl->qc_type;
ioqc->qc_dqblk.dqb_valid = QIF_ILIMITS;
- ioqc->qc_dqblk.dqb_ihardlimit =
MIN_QLIMIT
;
+ ioqc->qc_dqblk.dqb_ihardlimit =
flag ? MIN_QLIMIT : 0
;
/* set local limit to MIN_QLIMIT */
rc = fsfilt_quotactl(obd, obd->u.obt.obt_sb, ioqc);
if (rc)
GOTO(out, rc);
/* set local limit to MIN_QLIMIT */
rc = fsfilt_quotactl(obd, obd->u.obt.obt_sb, ioqc);
if (rc)
GOTO(out, rc);
-acquire:
+
/* trigger local qunit pre-acquire */
if (oqctl->qc_type == USRQUOTA)
uid = oqctl->qc_id;
/* trigger local qunit pre-acquire */
if (oqctl->qc_type == USRQUOTA)
uid = oqctl->qc_id;
@@
-705,29
+699,30
@@
static int mds_init_slave_blimits(struct obd_device *obd,
struct mds_obd *mds = &obd->u.mds;
struct obd_quotactl *ioqc;
unsigned int uid = 0, gid = 0;
struct mds_obd *mds = &obd->u.mds;
struct obd_quotactl *ioqc;
unsigned int uid = 0, gid = 0;
+ int flag;
int rc;
ENTRY;
/* if we are going to set zero limit, needn't init slaves */
int rc;
ENTRY;
/* if we are going to set zero limit, needn't init slaves */
- if (!oqctl->qc_dqblk.dqb_bhardlimit && !oqctl->qc_dqblk.dqb_bsoftlimit)
+ if (!oqctl->qc_dqblk.dqb_bhardlimit && !oqctl->qc_dqblk.dqb_bsoftlimit &&
+ set)
RETURN(0);
OBD_ALLOC_PTR(ioqc);
if (!ioqc)
RETURN(-ENOMEM);
RETURN(0);
OBD_ALLOC_PTR(ioqc);
if (!ioqc)
RETURN(-ENOMEM);
- ioqc->qc_cmd = Q_INITQUOTA;
+ flag = oqctl->qc_dqblk.dqb_bhardlimit ||
+ oqctl->qc_dqblk.dqb_bsoftlimit || set;
+ ioqc->qc_cmd = flag ? Q_INITQUOTA : Q_SETQUOTA;
ioqc->qc_id = oqctl->qc_id;
ioqc->qc_type = oqctl->qc_type;
ioqc->qc_dqblk.dqb_valid = QIF_BLIMITS;
ioqc->qc_id = oqctl->qc_id;
ioqc->qc_type = oqctl->qc_type;
ioqc->qc_dqblk.dqb_valid = QIF_BLIMITS;
- ioqc->qc_dqblk.dqb_bhardlimit =
set
? MIN_QLIMIT : 0;
+ ioqc->qc_dqblk.dqb_bhardlimit =
flag
? MIN_QLIMIT : 0;
- /* set local limit to MIN_QLIMIT */
- if (set) {
- rc = fsfilt_quotactl(obd, obd->u.obt.obt_sb, ioqc);
- if (rc)
- GOTO(out, rc);
- }
+ rc = fsfilt_quotactl(obd, obd->u.obt.obt_sb, ioqc);
+ if (rc)
+ GOTO(out, rc);
/* trigger local qunit pre-acquire */
if (oqctl->qc_type == USRQUOTA)
/* trigger local qunit pre-acquire */
if (oqctl->qc_type == USRQUOTA)