#include "lustre_quota_fmt.h"
+#ifdef HAVE_QUOTA_SUPPORT
+
char *test_quotafile[2] = { "usrquota_test", "grpquota_test" };
static int quotfmt_initialize(struct lustre_quota_info *lqi,
{
struct lustre_disk_dqheader dqhead;
static const uint quota_magics[] = LUSTRE_INITQMAGICS;
- static const uint quota_versions[] = LUSTRE_INITQVERSIONS;
+ static const uint quota_versions[] = LUSTRE_INITQVERSIONS_V2;
struct file *fp;
struct inode *parent_inode = tgt->obd_lvfs_ctxt.pwd->d_inode;
size_t size;
int namelen = strlen(name);
/* remove the stale test quotafile */
- LOCK_INODE_MUTEX(parent_inode);
+ LOCK_INODE_MUTEX_PARENT(parent_inode);
de = lookup_one_len(name, tgt->obd_lvfs_ctxt.pwd, namelen);
if (!IS_ERR(de) && de->d_inode)
- ll_vfs_unlink(parent_inode, de,
+ ll_vfs_unlink(parent_inode, de,
tgt->obd_lvfs_ctxt.pwdmnt);
if (!IS_ERR(de))
dput(de);
sizeof(struct lustre_disk_dqheader),
&offset);
if (size != sizeof(struct lustre_disk_dqheader)) {
- CERROR("error writing quoafile header %s (rc = %d)\n",
+ CERROR("error writing quotafile header %s (rc = %d)\n",
name, rc);
rc = size;
break;
filp_close(lqi->qi_files[i], 0);
/* unlink quota file */
- LOCK_INODE_MUTEX(parent_inode);
+ LOCK_INODE_MUTEX_PARENT(parent_inode);
de = lookup_one_len(name, tgt->obd_lvfs_ctxt.pwd, namelen);
if (IS_ERR(de) || de->d_inode == NULL) {
ENTRY;
for (i = 0; i < MAXQUOTAS; i++) {
- if (!lustre_check_quota_file(lqi, i))
+ if (lustre_check_quota_file(lqi, i))
RETURN(-EINVAL);
}
RETURN(0);
static int write_check_dquot(struct lustre_quota_info *lqi)
{
struct lustre_dquot *dquot;
- struct mem_dqblk dqblk;
+ struct lustre_mem_dqblk dqblk;
int rc = 0;
ENTRY;
static int quotfmt_test_5(struct lustre_quota_info *lqi)
{
-#ifndef KERNEL_SUPPORTS_QUOTA_READ
+#ifndef KERNEL_SUPPORTS_QUOTA_READ
int i, rc = 0;
for (i = USRQUOTA; i < MAXQUOTAS && !rc; i++) {
module_init(quotfmt_test_init);
module_exit(quotfmt_test_exit);
+
+#endif /* HAVE_QUOTA_SUPPORT */