/* quota proc file handling functions */
#ifdef LPROCFS
int lprocfs_rd_bunit(char *page, char **start, off_t off, int count,
/* quota proc file handling functions */
#ifdef LPROCFS
int lprocfs_rd_bunit(char *page, char **start, off_t off, int count,
struct super_block *sb, int is_master)
{
struct obd_quotactl *oqctl;
struct super_block *sb, int is_master)
{
struct obd_quotactl *oqctl;
CDEBUG(rc == -ENOENT ? D_QUOTA : D_ERROR,
"auto-enable local quota failed. rc=%d\n", rc);
if (is_master)
CDEBUG(rc == -ENOENT ? D_QUOTA : D_ERROR,
"auto-enable local quota failed. rc=%d\n", rc);
if (is_master)
int lprocfs_wr_type(struct file *file, const char *buffer,
unsigned long count, void *data)
{
int lprocfs_wr_type(struct file *file, const char *buffer,
unsigned long count, void *data)
{
oa->o_valid |= (cnt == USRQUOTA) ?
OBD_MD_FLUSRQUOTA : OBD_MD_FLGRPQUOTA;
if (oqctl->qc_dqblk.dqb_bhardlimit &&
oa->o_valid |= (cnt == USRQUOTA) ?
OBD_MD_FLUSRQUOTA : OBD_MD_FLGRPQUOTA;
if (oqctl->qc_dqblk.dqb_bhardlimit &&
/* check whether the left quota of certain uid and uid can satisfy a write rpc
* when need to acquire quota, return QUOTA_RET_ACQUOTA */
static int filter_quota_check(struct obd_device *obd, unsigned int uid,
/* check whether the left quota of certain uid and uid can satisfy a write rpc
* when need to acquire quota, return QUOTA_RET_ACQUOTA */
static int filter_quota_check(struct obd_device *obd, unsigned int uid,
/* caller must hold qinfo_list_lock */
static inline void insert_qinfo_hash(struct osc_quota_info *oqi)
{
/* caller must hold qinfo_list_lock */
static inline void insert_qinfo_hash(struct osc_quota_info *oqi)
{
hashfn(oqi->oqi_cli, oqi->oqi_id, oqi->oqi_type);
LASSERT_SPIN_LOCKED(&qinfo_list_lock);
hashfn(oqi->oqi_cli, oqi->oqi_id, oqi->oqi_type);
LASSERT_SPIN_LOCKED(&qinfo_list_lock);
unsigned int uid, unsigned int gid,
obd_flag valid, obd_flag flags)
{
unsigned int uid, unsigned int gid,
obd_flag valid, obd_flag flags)
{
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
struct osc_quota_info *oqi, *old;
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
struct osc_quota_info *oqi, *old;
(flags & OBD_FL_NO_USRQUOTA) : (flags & OBD_FL_NO_GRPQUOTA);
oqi = alloc_qinfo(cli, id, cnt);
(flags & OBD_FL_NO_USRQUOTA) : (flags & OBD_FL_NO_GRPQUOTA);
oqi = alloc_qinfo(cli, id, cnt);