subdir-m += osc
subdir-m += obdecho
subdir-m += mgc
-subdir-m += quota
-@SERVER_TRUE@subdir-m += mds obdfilter ost mgs mdt cmm mdd osd-ldiskfs
+@SERVER_TRUE@subdir-m += mds obdfilter ost mgs mdt cmm mdd osd-ldiskfs quota
@CLIENT_TRUE@subdir-m += mdc lmv llite fld
@INCLUDE_RULES@
ALWAYS_SUBDIRS := include lvfs obdclass ldlm ptlrpc osc lov obdecho \
mgc fid fld doc utils tests scripts autoconf contrib conf
-SERVER_SUBDIRS := obdfilter ost mds mgs mdt cmm mdd osd-ldiskfs
+SERVER_SUBDIRS := obdfilter ost mds mgs mdt cmm mdd osd-ldiskfs quota
CLIENT_SUBDIRS := mdc lmv llite lclient
-QUOTA_SUBDIRS := quota
-
LIBLUSTRE_SUBDIRS := liblustre
SUBDIRS := $(ALWAYS_SUBDIRS)
SUBDIRS += $(CLIENT_SUBDIRS)
endif
-SUBDIRS += $(QUOTA_SUBDIRS)
-
# this needs to be after the client subdirs
if LIBLUSTRE
if !CLIENT
endif
DIST_SUBDIRS := $(ALWAYS_SUBDIRS) $(SERVER_SUBDIRS) $(CLIENT_SUBDIRS) \
- $(LIBLUSTRE_SUBDIRS) $(QUOTA_SUBDIRS)
+ $(LIBLUSTRE_SUBDIRS)
EXTRA_DIST = BUGS FDL kernel_patches BUILDING
fi
])
-# whether to enable quota support(kernel modules)
-AC_DEFUN([LC_QUOTA_MODULE],
-[if test x$enable_quota != xno; then
- LB_LINUX_CONFIG([QUOTA],[
- enable_quota_module='yes'
- AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [Enable quota support])
- ],[
- enable_quota_module='no'
- AC_MSG_WARN([quota is not enabled because the kernel - lacks quota support])
- ])
-fi
+#
+# Quota support. The kernel must support CONFIG_QUOTA.
+#
+AC_DEFUN([LC_QUOTA_CONFIG],
+[LB_LINUX_CONFIG_IM([QUOTA],[AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [support quota])],[
+ AC_MSG_ERROR([Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.])
+])
])
# truncate_complete_page() was exported from RHEL5/SLES10, but not in SLES11 SP0 (2.6.27)
LC_CONFIG_LIBLUSTRE_RECOVERY
LC_CONFIG_HEALTH_CHECK_WRITE
LC_CONFIG_LRU_RESIZE
- LC_QUOTA_MODULE
LC_LLITE_LLOOP_MODULE
# RHEL4 patches
LC_FUNC_DEV_SET_RDONLY
LC_STACK_SIZE
LC_QUOTA64
+ LC_QUOTA_CONFIG
fi
])
AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
-AM_CONDITIONAL(QUOTA, test x$enable_quota_module = xyes)
AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
$(top_builddir)/lustre/obdclass/liblustreclass.a \
$(top_builddir)/lustre/lvfs/liblvfs.a
-if LIBLUSTRE
-QUOTA_LIBS = $(top_builddir)/lustre/quota/libquota.a
-endif
-
LND_LIBS =
if BUILD_USOCKLND
LND_LIBS += $(top_builddir)/lnet/ulnds/socklnd/libsocklnd.a
liblustre_a_SOURCES = llite_lib.c super.c namei.c rw.c file.c dir.c \
llite_lib.h llite_cl.c
-liblustre.a : $(LUSTRE_LIBS) $(LND_LIBS) $(LNET_LIBS) $(SYSIO_LIBS) $(QUOTA_LIBS)
- sh $(srcdir)/genlib.sh "$(SYSIO)" "$(LIBS)" "$(LND_LIBS)" "$(PTHREAD_LIBS)" "$(QUOTA_LIBS)" "$(CAP_LIBS)" "$(ZLIB)"
+liblustre.a : $(LUSTRE_LIBS) $(LND_LIBS) $(LNET_LIBS) $(SYSIO_LIBS)
+ sh $(srcdir)/genlib.sh "$(SYSIO)" "$(LIBS)" "$(LND_LIBS)" "$(PTHREAD_LIBS)" "$(CAP_LIBS)" "$(ZLIB)"
EXTRA_DIST = genlib.sh
LIBS=$2
LND_LIBS=$3
PTHREAD_LIBS=$4
-QUOTA_LIBS=$5
-CAP_LIBS=$6
-ZLIB=$7
+CAP_LIBS=$5
+ZLIB=$6
if [ ! -f $SYSIO/lib/libsysio.a ]; then
echo "ERROR: $SYSIO/lib/libsysio.a dosen't exist"
fi
build_obj_list ../../lnet/lnet liblnet.a
-if [ "x$QUOTA_LIBS" != "x" ]; then
- build_obj_list ../quota libquota.a
-fi
-
# create static lib lsupport
rm -f $CWD/liblsupport.a
$AR -cru $CWD/liblsupport.a $ALL_OBJS
MODULES := lvfs
@SERVER_TRUE@MODULES += fsfilt_ldiskfs
-@QUOTA_TRUE@MODULES += quotafmt_test
+@SERVER_TRUE@MODULES += quotafmt_test
lvfs-objs := lvfs_common.o lvfs_linux.o fsfilt.o lvfs_lib.o
-@QUOTA_TRUE@quotafmt-objs := quotafmt_test.o
+@SERVER_TRUE@quotafmt-objs := quotafmt_test.o
fsfilt_ldiskfs-objs := fsfilt-ldiskfs.o
-@QUOTA_TRUE@fsfilt_ldiskfs-objs += lustre_quota_fmt.o
+@SERVER_TRUE@fsfilt_ldiskfs-objs += lustre_quota_fmt.o
$(obj)/fsfilt-%.c: $(obj)/fsfilt_%.c
ln -s $< $@
const char *name = lname->ln_name;
struct lu_attr *la = &mdd_env_info(env)->mti_la_for_fix;
struct mdd_object *mdd_obj = md2mdd_obj(pobj);
- struct mdd_device *mdd = mdo2mdd(pobj);
struct dynlock_handle *dlh;
struct thandle *handle;
int is_dir = S_ISDIR(ma->ma_attr.la_mode);
#ifdef HAVE_QUOTA_SUPPORT
+ struct mdd_device *mdd = mdo2mdd(pobj);
struct md_ucred *uc = md_ucred(env);
struct obd_device *obd = mdd->mdd_obd_dev;
struct obd_export *exp = md_quota(env)->mq_exp;
struct llog_cookie *logcookies = NULL;
int rc, lmm_size = 0, cookie_size = 0;
struct lu_attr *la_copy = &mdd_env_info(env)->mti_la_for_fix;
+#ifdef HAVE_QUOTA_SUPPORT
struct obd_device *obd = mdd->mdd_obd_dev;
struct mds_obd *mds = &obd->u.mds;
-#ifdef HAVE_QUOTA_SUPPORT
unsigned int qnids[MAXQUOTAS] = { 0, 0 };
unsigned int qoids[MAXQUOTAS] = { 0, 0 };
int quota_opc = 0, block_count = 0;
# Lustre is a trademark of Sun Microsystems, Inc.
#
-if LIBLUSTRE
-noinst_LIBRARIES = libquota.a
-libquota_a_SOURCES = quota_check.c quota_ctl.c quota_interface.c quota_adjust_qunit.c
-libquota_a_CPPFLAGS = $(LLCPPFLAGS)
-libquota_a_CFLAGS = $(LLCFLAGS)
-endif
-
-if QUOTA
modulefs_DATA = lquota$(KMODEXT)
-endif
MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
#include "quota_internal.h"
-#ifdef HAVE_QUOTA_SUPPORT
-
#ifdef LPROCFS
int lprocfs_quota_rd_bunit(char *page, char **start, off_t off, int count,
int *eof, void *data)
}
#endif /* LPROCFS */
-#endif
#include <linux/lustre_quota.h>
#include "quota_internal.h"
-#ifdef HAVE_QUOTA_SUPPORT
-
#ifdef __KERNEL__
/**
* This function is charge of recording lqs_ino_rec and
RETURN(rc);
}
#endif /* __KERNEL__ */
-#endif
#include <lustre_quota.h>
#include "quota_internal.h"
-#ifdef HAVE_QUOTA_SUPPORT
#ifdef __KERNEL__
static int target_quotacheck_callback(struct obd_export *exp,
struct obd_quotactl *oqctl)
}
#endif /* __KERNEL__ */
-#endif /* HAVE_QUOTA_SUPPORT */
CFS_MODULE_PARM(hash_lqs_cur_bits, "i", int, 0444,
"the current bits of lqs hash");
-#ifdef HAVE_QUOTA_SUPPORT
-
static cfs_hash_ops_t lqs_hash_ops;
unsigned long default_bunit_sz = 128 * 1024 * 1024; /* 128M bytes */
.hs_put_locked = lqs_put_locked,
.hs_exit = lqs_exit
};
-#endif /* HAVE_QUOTA_SUPPORT */
#include <lustre_quota.h>
#include "quota_internal.h"
-#ifdef HAVE_QUOTA_SUPPORT
#ifdef __KERNEL__
int mds_quota_ctl(struct obd_device *obd, struct obd_export *unused,
RETURN(rc);
}
#endif /* __KERNEL__ */
-#endif
#ifdef __KERNEL__
-#ifdef HAVE_QUOTA_SUPPORT
-
static cfs_time_t last_print = 0;
static cfs_spinlock_t last_print_lock = CFS_SPIN_LOCK_UNLOCKED;
RETURN(rc);
}
-#endif /* HAVE_QUOTA_SUPPORT */
-#endif /* __KERNEL__ */
-
-#ifdef __KERNEL__
-#ifdef HAVE_QUOTA_SUPPORT
quota_interface_t mds_quota_interface = {
.quota_init = mds_quota_init,
.quota_exit = mds_quota_exit,
.quota_adjust_qunit = filter_quota_adjust_qunit,
.quota_pending_commit = quota_pending_commit,
};
-#endif
-#endif /* __KERNEL__ */
-
-#ifdef __KERNEL__
cfs_proc_dir_entry_t *lquota_type_proc_dir = NULL;
static int __init init_lustre_quota(void)
{
-#ifdef HAVE_QUOTA_SUPPORT
int rc = 0;
lquota_type_proc_dir = lprocfs_register(OBD_LQUOTA_DEVICENAME,
PORTAL_SYMBOL_REGISTER(filter_quota_interface);
PORTAL_SYMBOL_REGISTER(mds_quota_interface);
-#endif
+
return 0;
}
static void /*__exit*/ exit_lustre_quota(void)
{
-#ifdef HAVE_QUOTA_SUPPORT
PORTAL_SYMBOL_UNREGISTER(filter_quota_interface);
PORTAL_SYMBOL_UNREGISTER(mds_quota_interface);
if (lquota_type_proc_dir)
lprocfs_remove(&lquota_type_proc_dir);
-#endif
}
MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
cfs_module(lquota, "1.0.0", init_lustre_quota, exit_lustre_quota);
-#ifdef HAVE_QUOTA_SUPPORT
EXPORT_SYMBOL(mds_quota_interface);
EXPORT_SYMBOL(filter_quota_interface);
-#endif
#endif /* __KERNEL */
#include <lustre_quota.h>
-#ifdef HAVE_QUOTA_SUPPORT
-
/* QUSG covnert bytes to blocks when counting block quota */
#define QUSG(count, isblk) (isblk ? toqb(count) : count)
#define QUOTA_REQ_RETURNED 1
#endif
-int client_quota_adjust_qunit(struct obd_export *exp,
- struct quota_adjust_qunit *oqaq,
- struct lustre_quota_ctxt *qctxt,
- struct ptlrpc_request_set *set);
-
-int lov_quota_adjust_qunit(struct obd_export *exp,
- struct quota_adjust_qunit *oqaq,
- struct lustre_quota_ctxt *qctxt,
- struct ptlrpc_request_set *rqset);
-int client_quota_ctl(struct obd_device *unused, struct obd_export *exp,
- struct obd_quotactl *oqctl);
-int lmv_quota_ctl(struct obd_device *unused, struct obd_export *exp,
- struct obd_quotactl *oqctl);
-int lov_quota_ctl(struct obd_device *unused, struct obd_export *exp,
- struct obd_quotactl *oqctl);
-int client_quota_check(struct obd_device *unused, struct obd_export *exp,
- struct obd_quotactl *oqctl);
-int lmv_quota_check(struct obd_device *unused, struct obd_export *exp,
- struct obd_quotactl *oqctl);
-int lov_quota_check(struct obd_device *unused, struct obd_export *exp,
- struct obd_quotactl *oqctl);
-int client_quota_poll_check(struct obd_export *exp, struct if_quotacheck *qchk);
-
-#endif
#include "quota_internal.h"
-#ifdef HAVE_QUOTA_SUPPORT
-
/* lock ordering: mds->mds_qonoff_sem > dquot->dq_mutex > lqs->lqs_lock */
static cfs_list_t lustre_dquot_hash[NR_DQHASH];
static cfs_rwlock_t dquot_hash_lock = CFS_RW_LOCK_UNLOCKED;
cfs_wait_for_completion(&data.comp);
RETURN(rc);
}
-
-#endif /* HAVE_QUOTA_SUPPORT */
load_module obdclass/obdclass
load_module ptlrpc/ptlrpc
load_module ptlrpc/gss/ptlrpc_gss
- [ "$USE_QUOTA" = "yes" -a "$LQUOTA" != "no" ] && load_module quota/lquota $LQUOTAOPTS
load_module fld/fld
load_module fid/fid
load_module lmv/lmv
{ modprobe exportfs 2> /dev/null || true; }
load_module ../ldiskfs/ldiskfs/ldiskfs
fi
+ [ "$USE_QUOTA" = "yes" -a "$LQUOTA" != "no" ] && load_module quota/lquota $LQUOTAOPTS
load_module mgs/mgs
load_module mds/mds
load_module mdd/mdd