#define QFILE_WR_DQUOT 6
/* admin quotafile operations */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
int lustre_check_quota_file(struct lustre_quota_info *lqi, int type);
int lustre_read_quota_info(struct lustre_quota_info *lqi, int type);
int lustre_write_quota_info(struct lustre_quota_info *lqi, int type);
int lustre_init_quota_info(struct lustre_quota_info *lqi, int type);
int lustre_get_qids(struct file *file, struct inode *inode, int type,
struct list_head *list);
-#else
-
-#ifndef DQ_FAKE_B
-#define DQ_FAKE_B 6
-#endif
-
-static inline int lustre_check_quota_file(struct lustre_quota_info *lqi,
- int type)
-{
- return 0;
-}
-static inline int lustre_read_quota_info(struct lustre_quota_info *lqi,
- int type)
-{
- return 0;
-}
-static inline int lustre_write_quota_info(struct lustre_quota_info *lqi,
- int type)
-{
- return 0;
-}
-static inline int lustre_read_dquot(struct lustre_dquot *dquot)
-{
- return 0;
-}
-static inline int lustre_commit_dquot(struct lustre_dquot *dquot)
-{
- return 0;
-}
-static inline int lustre_init_quota_info(struct lustre_quota_info *lqi,
- int type)
-{
- return 0;
-}
-#endif /* KERNEL_VERSION(2,5,0) */
#define LL_DQUOT_OFF(sb) DQUOT_OFF(sb)
/* For quota slave, acquire/release quota from master if needed */
int (*quota_acquire) (struct obd_device *, unsigned int, unsigned int);
+ /* For quota slave, check whether specified uid/gid's remaining quota
+ * can finish a write rpc */
+ int (*quota_chkquota) (struct obd_device *, unsigned int, unsigned int,
+ int);
+
/* For quota client, poll if the quota check done */
int (*quota_poll_check) (struct obd_export *, struct if_quotacheck *);
}
static inline int lquota_setup(quota_interface_t *interface,
- struct obd_device *obd)
+ struct obd_device *obd)
{
int rc;
ENTRY;
RETURN(rc);
}
+static inline int lquota_chkquota(quota_interface_t *interface,
+ struct obd_device *obd,
+ unsigned int uid, unsigned int gid,
+ int npage)
+{
+ int rc;
+ ENTRY;
+
+ QUOTA_CHECK_OP(interface, chkquota);
+ rc = QUOTA_OP(interface, chkquota)(obd, uid, gid, npage);
+ RETURN(rc);
+}
+
int lprocfs_rd_bunit(char *page, char **start, off_t off, int count,
int *eof, void *data);
int lprocfs_rd_iunit(char *page, char **start, off_t off, int count,