From 1738e70fe6aaf1e07b78a6b89eb11ea115135e69 Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Thu, 7 May 2015 02:54:20 -0400 Subject: [PATCH] LU-5975 quota: remove obsolete quota code Remove the obsolete quotacheck, quotaon and quotaoff, which were retained for the interoprability with old (< 2.4) client and server. Some other obsolete quota code related to LL_IOC_QUOTACTL_18, Q_INVLIDATE and Q_FINVALIDATE are removed as well. Signed-off-by: Niu Yawei Change-Id: I21cd14d9fb783c1bfa09668b318189a24bf72224 Reviewed-on: http://review.whamcloud.com/14705 Tested-by: Jenkins Reviewed-by: Fan Yong Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/include/lustre/lustre_idl.h | 6 +- lustre/include/lustre/lustre_user.h | 13 +- lustre/include/lustre/lustreapi.h | 2 - lustre/include/lustre_ioctl.h | 4 +- lustre/include/lustre_req_layout.h | 3 - lustre/include/obd.h | 9 -- lustre/include/obd_class.h | 13 -- lustre/include/obd_support.h | 6 +- lustre/ldlm/ldlm_lib.c | 2 - lustre/ldlm/ldlm_lockd.c | 24 ---- lustre/llite/dir.c | 120 ------------------ lustre/llite/llite_internal.h | 16 --- lustre/lmv/lmv_obd.c | 31 +---- lustre/lov/lov_obd.c | 57 +-------- lustre/mdc/mdc_request.c | 51 -------- lustre/mdt/mdt_handler.c | 8 -- lustre/obdclass/lprocfs_status_server.c | 1 - lustre/ofd/ofd_dev.c | 5 - lustre/osc/osc_internal.h | 3 - lustre/osc/osc_quota.c | 46 ------- lustre/osc/osc_request.c | 4 - lustre/ptlrpc/layout.c | 15 --- lustre/quota/qmt_handler.c | 7 -- lustre/target/tgt_handler.c | 6 - lustre/utils/lfs.c | 213 -------------------------------- lustre/utils/liblustreapi.c | 46 ------- 26 files changed, 16 insertions(+), 695 deletions(-) diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 6a7b8a5..d758c8c 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -1483,7 +1483,7 @@ typedef enum { OST_STATFS = 13, OST_SYNC = 16, OST_SET_INFO = 17, - OST_QUOTACHECK = 18, + OST_QUOTACHECK = 18, /* not used since 2.4 */ OST_QUOTACTL = 19, OST_QUOTA_ADJUST_QUNIT = 20, /* not used since 2.4 */ OST_LAST_OPC @@ -2102,7 +2102,7 @@ typedef enum { MDS_SYNC = 44, MDS_DONE_WRITING = 45, /* obsolete since 2.8.0 */ MDS_SET_INFO = 46, - MDS_QUOTACHECK = 47, + MDS_QUOTACHECK = 47, /* not used since 2.4 */ MDS_QUOTACTL = 48, MDS_GETXATTR = 49, MDS_SETXATTR = 50, /* obsolete, now it's MDS_REINT op */ @@ -3121,7 +3121,7 @@ extern void lustre_swab_cfg_marker(struct cfg_marker *marker, typedef enum { OBD_PING = 400, OBD_LOG_CANCEL, - OBD_QC_CALLBACK, + OBD_QC_CALLBACK, /* not used since 2.4 */ OBD_IDX_READ, OBD_LAST_OPC } obd_cmd_t; diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index 1e8468d..9efe5ff 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -569,23 +569,18 @@ static inline __u64 lustre_stoqb(size_t space) #define Q_FINVALIDATE 0x800104 /* deprecated as of 2.4 */ /* these must be explicitly translated into linux Q_* in ll_dir_ioctl */ -#define LUSTRE_Q_QUOTAON 0x800002 /* turn quotas on */ -#define LUSTRE_Q_QUOTAOFF 0x800003 /* turn quotas off */ +#define LUSTRE_Q_QUOTAON 0x800002 /* deprecated as of 2.4 */ +#define LUSTRE_Q_QUOTAOFF 0x800003 /* deprecated as of 2.4 */ #define LUSTRE_Q_GETINFO 0x800005 /* get information about quota files */ #define LUSTRE_Q_SETINFO 0x800006 /* set information about quota files */ #define LUSTRE_Q_GETQUOTA 0x800007 /* get user quota structure */ #define LUSTRE_Q_SETQUOTA 0x800008 /* set user quota structure */ /* lustre-specific control commands */ -#define LUSTRE_Q_INVALIDATE 0x80000b /* invalidate quota data */ -#define LUSTRE_Q_FINVALIDATE 0x80000c /* invalidate filter quota data */ +#define LUSTRE_Q_INVALIDATE 0x80000b /* deprecated as of 2.4 */ +#define LUSTRE_Q_FINVALIDATE 0x80000c /* deprecated as of 2.4 */ #define UGQUOTA 2 /* set both USRQUOTA and GRPQUOTA */ -struct if_quotacheck { - char obd_type[16]; - struct obd_uuid obd_uuid; -}; - #define IDENTITY_DOWNCALL_MAGIC 0x6d6dd629 /* permission */ diff --git a/lustre/include/lustre/lustreapi.h b/lustre/include/lustre/lustreapi.h index f62ec17..9fcccfe 100644 --- a/lustre/include/lustre/lustreapi.h +++ b/lustre/include/lustre/lustreapi.h @@ -273,8 +273,6 @@ struct mntent; #define HAVE_LLAPI_IS_LUSTRE_MNT extern int llapi_is_lustre_mnt(struct mntent *mnt); extern int llapi_quotachown(char *path, int flag); -extern int llapi_quotacheck(char *mnt, int check_type); -extern int llapi_poll_quotacheck(char *mnt, struct if_quotacheck *qchk); extern int llapi_quotactl(char *mnt, struct if_quotactl *qctl); extern int llapi_target_iterate(int type_num, char **obd_type, void *args, llapi_cb_t cb); diff --git a/lustre/include/lustre_ioctl.h b/lustre/include/lustre_ioctl.h index 0b2cc82..83ef428 100644 --- a/lustre/include/lustre_ioctl.h +++ b/lustre/include/lustre_ioctl.h @@ -357,8 +357,8 @@ obd_ioctl_unpack(struct obd_ioctl_data *data, char *pbuf, int max_len) /* OBD_IOC_LOV_GETSTRIPE 155 LL_IOC_LOV_GETSTRIPE */ /* OBD_IOC_LOV_SETEA 156 LL_IOC_LOV_SETEA */ /* lustre/lustre_user.h 157-159 */ -#define OBD_IOC_QUOTACHECK _IOW ('f', 160, int) -#define OBD_IOC_POLL_QUOTACHECK _IOR ('f', 161, struct if_quotacheck *) +/* OBD_IOC_QUOTACHECK _IOW ('f', 160, int) */ +/* OBD_IOC_POLL_QUOTACHECK _IOR ('f', 161, struct if_quotacheck *) */ #define OBD_IOC_QUOTACTL _IOWR('f', 162, struct if_quotactl) /* lustre/lustre_user.h 163-176 */ #define OBD_IOC_CHANGELOG_REG _IOW ('f', 177, struct obd_ioctl_data) diff --git a/lustre/include/lustre_req_layout.h b/lustre/include/lustre_req_layout.h index 8ad58d9..e9c093e 100644 --- a/lustre/include/lustre_req_layout.h +++ b/lustre/include/lustre_req_layout.h @@ -182,9 +182,7 @@ extern struct req_format RQF_MDS_REINT_LINK; extern struct req_format RQF_MDS_REINT_RENAME; extern struct req_format RQF_MDS_REINT_SETATTR; extern struct req_format RQF_MDS_REINT_SETXATTR; -extern struct req_format RQF_MDS_QUOTACHECK; extern struct req_format RQF_MDS_QUOTACTL; -extern struct req_format RQF_QC_CALLBACK; extern struct req_format RQF_QUOTA_DQACQ; extern struct req_format RQF_MDS_SWAP_LAYOUTS; /* MDS hsm formats */ @@ -198,7 +196,6 @@ extern struct req_format RQF_MDS_HSM_REQUEST; /* OST req_format */ extern struct req_format RQF_OST_CONNECT; extern struct req_format RQF_OST_DISCONNECT; -extern struct req_format RQF_OST_QUOTACHECK; extern struct req_format RQF_OST_QUOTACTL; extern struct req_format RQF_OST_GETATTR; extern struct req_format RQF_OST_SETATTR; diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 71f1662..f83454f 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -352,13 +352,6 @@ struct client_obd { /* also protected by the poorly named _loi_list_lock lock above */ struct osc_async_rc cl_ar; - /* used by quotacheck when the servers are older than 2.4 */ - int cl_qchk_stat; /* quotacheck stat of the peer */ -#define CL_NOT_QUOTACHECKED 1 /* client->cl_qchk_stat init value */ -#if LUSTRE_VERSION_CODE >= OBD_OCD_VERSION(2, 7, 53, 0) -#warning "please consider removing quotacheck compatibility code" -#endif - /* sequence manager */ struct lu_client_seq *cl_seq; @@ -989,8 +982,6 @@ struct obd_ops { struct obd_uuid *(*o_get_uuid) (struct obd_export *exp); /* quota methods */ - int (*o_quotacheck)(struct obd_device *, struct obd_export *, - struct obd_quotactl *); int (*o_quotactl)(struct obd_device *, struct obd_export *, struct obd_quotactl *); diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index bfb5e9e..e6b388b 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -1277,19 +1277,6 @@ static inline int obd_notify_observer(struct obd_device *observer, return rc1 ? rc1 : rc2; } -static inline int obd_quotacheck(struct obd_export *exp, - struct obd_quotactl *oqctl) -{ - int rc; - ENTRY; - - EXP_CHECK_DT_OP(exp, quotacheck); - EXP_COUNTER_INCREMENT(exp, quotacheck); - - rc = OBP(exp->exp_obd, quotacheck)(exp->exp_obd, exp, oqctl); - RETURN(rc); -} - static inline int obd_quotactl(struct obd_export *exp, struct obd_quotactl *oqctl) { diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index e124dfab..7063ab3 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -204,7 +204,7 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type, #define OBD_FAIL_MDS_STATFS_LCW_SLEEP 0x12a #define OBD_FAIL_MDS_OPEN_CREATE 0x12b #define OBD_FAIL_MDS_OST_SETATTR 0x12c -#define OBD_FAIL_MDS_QUOTACHECK_NET 0x12d +/* OBD_FAIL_MDS_QUOTACHECK_NET 0x12d obsolete since 2.4 */ #define OBD_FAIL_MDS_QUOTACTL_NET 0x12e #define OBD_FAIL_MDS_CLIENT_ADD 0x12f #define OBD_FAIL_MDS_GETXATTR_NET 0x130 @@ -296,7 +296,7 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type, #define OBD_FAIL_OST_ENOSPC 0x215 #define OBD_FAIL_OST_EROFS 0x216 #define OBD_FAIL_OST_ENOENT 0x217 -#define OBD_FAIL_OST_QUOTACHECK_NET 0x218 +/* OBD_FAIL_OST_QUOTACHECK_NET 0x218 obsolete since 2.4 */ #define OBD_FAIL_OST_QUOTACTL_NET 0x219 #define OBD_FAIL_OST_CHECKSUM_RECEIVE 0x21a #define OBD_FAIL_OST_CHECKSUM_SEND 0x21b @@ -409,7 +409,7 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type, #define OBD_FAIL_OBD_PING_NET 0x600 #define OBD_FAIL_OBD_LOG_CANCEL_NET 0x601 #define OBD_FAIL_OBD_LOGD_NET 0x602 -#define OBD_FAIL_OBD_QC_CALLBACK_NET 0x603 +/* OBD_FAIL_OBD_QC_CALLBACK_NET 0x603 obsolete since 2.4 */ #define OBD_FAIL_OBD_DQACQ 0x604 #define OBD_FAIL_OBD_LLOG_SETUP 0x605 #define OBD_FAIL_OBD_LOG_CANCEL_REP 0x606 diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index d747a18..f8e7f26 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -465,8 +465,6 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) GOTO(err_import, rc = -ENOMEM); } - cli->cl_qchk_stat = CL_NOT_QUOTACHECKED; - RETURN(rc); err_import: diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index df40380..9e31e16 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -2112,23 +2112,6 @@ static inline void ldlm_callback_errmsg(struct ptlrpc_request *req, CWARN("Send reply failed, maybe cause bug 21636.\n"); } -static int ldlm_handle_qc_callback(struct ptlrpc_request *req) -{ - struct obd_quotactl *oqctl; - struct client_obd *cli = &req->rq_export->exp_obd->u.cli; - - oqctl = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL); - if (oqctl == NULL) { - CERROR("Can't unpack obd_quotactl\n"); - RETURN(-EPROTO); - } - - oqctl->qc_stat = ptlrpc_status_ntoh(oqctl->qc_stat); - - cli->cl_qchk_stat = oqctl->qc_stat; - return 0; -} - /* TODO: handle requests in a similar way as MDT: see mdt_handle_common() */ static int ldlm_callback_handler(struct ptlrpc_request *req) { @@ -2208,13 +2191,6 @@ static int ldlm_callback_handler(struct ptlrpc_request *req) rc = llog_origin_handle_close(req); ldlm_callback_reply(req, rc); RETURN(0); - case OBD_QC_CALLBACK: - req_capsule_set(&req->rq_pill, &RQF_QC_CALLBACK); - if (OBD_FAIL_CHECK(OBD_FAIL_OBD_QC_CALLBACK_NET)) - RETURN(0); - rc = ldlm_handle_qc_callback(req); - ldlm_callback_reply(req, rc); - RETURN(0); default: CERROR("unknown opcode %u\n", lustre_msg_get_opc(req->rq_reqmsg)); diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 7c3a108..dbf82b8 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -919,10 +919,6 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl) ENTRY; switch (cmd) { - case LUSTRE_Q_INVALIDATE: - case LUSTRE_Q_FINVALIDATE: - case Q_QUOTAON: - case Q_QUOTAOFF: case Q_SETQUOTA: case Q_SETINFO: if (!cfs_capable(CFS_CAP_SYS_ADMIN) || @@ -992,10 +988,6 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl) QCTL_COPY(oqctl, qctl); rc = obd_quotactl(sbi->ll_md_exp, oqctl); if (rc) { - if (rc != -EALREADY && cmd == Q_QUOTAON) { - oqctl->qc_cmd = Q_QUOTAOFF; - obd_quotactl(sbi->ll_md_exp, oqctl); - } OBD_FREE_PTR(oqctl); RETURN(rc); } @@ -1430,118 +1422,6 @@ out_rmdir: ll_putname(filename); return rc; } - case OBD_IOC_QUOTACHECK: { - struct obd_quotactl *oqctl; - int error = 0; - - if (!cfs_capable(CFS_CAP_SYS_ADMIN) || - sbi->ll_flags & LL_SBI_RMT_CLIENT) - RETURN(-EPERM); - - OBD_ALLOC_PTR(oqctl); - if (!oqctl) - RETURN(-ENOMEM); - oqctl->qc_type = arg; - rc = obd_quotacheck(sbi->ll_md_exp, oqctl); - if (rc < 0) { - CDEBUG(D_INFO, "md_quotacheck failed: rc %d\n", rc); - error = rc; - } - - rc = obd_quotacheck(sbi->ll_dt_exp, oqctl); - if (rc < 0) - CDEBUG(D_INFO, "obd_quotacheck failed: rc %d\n", rc); - - OBD_FREE_PTR(oqctl); - return error ?: rc; - } - case OBD_IOC_POLL_QUOTACHECK: { - struct if_quotacheck *check; - - if (!cfs_capable(CFS_CAP_SYS_ADMIN) || - sbi->ll_flags & LL_SBI_RMT_CLIENT) - RETURN(-EPERM); - - OBD_ALLOC_PTR(check); - if (!check) - RETURN(-ENOMEM); - - rc = obd_iocontrol(cmd, sbi->ll_md_exp, 0, (void *)check, - NULL); - if (rc) { - CDEBUG(D_QUOTA, "mdc ioctl %d failed: %d\n", cmd, rc); - if (copy_to_user((void __user *)arg, check, - sizeof(*check))) - CDEBUG(D_QUOTA, "copy_to_user failed\n"); - GOTO(out_poll, rc); - } - - rc = obd_iocontrol(cmd, sbi->ll_dt_exp, 0, (void *)check, - NULL); - if (rc) { - CDEBUG(D_QUOTA, "osc ioctl %d failed: %d\n", cmd, rc); - if (copy_to_user((void __user *)arg, check, - sizeof(*check))) - CDEBUG(D_QUOTA, "copy_to_user failed\n"); - GOTO(out_poll, rc); - } - out_poll: - OBD_FREE_PTR(check); - RETURN(rc); - } -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0) - case LL_IOC_QUOTACTL_18: { - /* copy the old 1.x quota struct for internal use, then copy - * back into old format struct. For 1.8 compatibility. */ - struct if_quotactl_18 *qctl_18; - struct if_quotactl *qctl_20; - - OBD_ALLOC_PTR(qctl_18); - if (!qctl_18) - RETURN(-ENOMEM); - - OBD_ALLOC_PTR(qctl_20); - if (!qctl_20) - GOTO(out_quotactl_18, rc = -ENOMEM); - - if (copy_from_user(qctl_18, (void __user *)arg, - sizeof(*qctl_18))) - GOTO(out_quotactl_20, rc = -ENOMEM); - - QCTL_COPY(qctl_20, qctl_18); - qctl_20->qc_idx = 0; - - /* XXX: dqb_valid was borrowed as a flag to mark that - * only mds quota is wanted */ - if (qctl_18->qc_cmd == Q_GETQUOTA && - qctl_18->qc_dqblk.dqb_valid) { - qctl_20->qc_valid = QC_MDTIDX; - qctl_20->qc_dqblk.dqb_valid = 0; - } else if (qctl_18->obd_uuid.uuid[0] != '\0') { - qctl_20->qc_valid = QC_UUID; - qctl_20->obd_uuid = qctl_18->obd_uuid; - } else { - qctl_20->qc_valid = QC_GENERAL; - } - - rc = quotactl_ioctl(sbi, qctl_20); - - if (rc == 0) { - QCTL_COPY(qctl_18, qctl_20); - qctl_18->obd_uuid = qctl_20->obd_uuid; - - if (copy_to_user((void __user *)arg, qctl_18, - sizeof(*qctl_18))) - rc = -EFAULT; - } - - out_quotactl_20: - OBD_FREE_PTR(qctl_20); - out_quotactl_18: - OBD_FREE_PTR(qctl_18); - RETURN(rc); - } -#endif /* LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0) */ case OBD_IOC_QUOTACTL: { struct if_quotactl *qctl; diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index a1e9f80..2a1a259 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -1480,22 +1480,6 @@ static inline void d_lustre_revalidate(struct dentry *dentry) spin_unlock(&dentry->d_lock); } -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0) -/* Compatibility for old (1.8) compiled userspace quota code */ -struct if_quotactl_18 { - __u32 qc_cmd; - __u32 qc_type; - __u32 qc_id; - __u32 qc_stat; - struct obd_dqinfo qc_dqinfo; - struct obd_dqblk qc_dqblk; - char obd_type[16]; - struct obd_uuid obd_uuid; -}; -#define LL_IOC_QUOTACTL_18 _IOWR('f', 162, struct if_quotactl_18 *) -/* End compatibility for old (1.8) compiled userspace quota code */ -#endif /* LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0) */ - int ll_layout_conf(struct inode *inode, const struct cl_object_conf *conf); int ll_layout_refresh(struct inode *inode, __u32 *gen); int ll_layout_restore(struct inode *inode, loff_t start, __u64 length); diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index ad304b6..29550e6 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -1175,9 +1175,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp, mdc_obd = class_exp2obd(tgt->ltd_exp); mdc_obd->obd_force = obddev->obd_force; err = obd_iocontrol(cmd, tgt->ltd_exp, len, karg, uarg); - if (err == -ENODATA && cmd == OBD_IOC_POLL_QUOTACHECK) { - RETURN(err); - } else if (err) { + if (err) { if (tgt->ltd_active) { CERROR("error: iocontrol MDC %s on MDT" " idx %d cmd %x: err = %d\n", @@ -3448,32 +3446,6 @@ int lmv_quotactl(struct obd_device *unused, struct obd_export *exp, RETURN(rc); } -int lmv_quotacheck(struct obd_device *unused, struct obd_export *exp, - struct obd_quotactl *oqctl) -{ - struct obd_device *obd = class_exp2obd(exp); - struct lmv_obd *lmv = &obd->u.lmv; - struct lmv_tgt_desc *tgt; - __u32 i; - int rc = 0; - ENTRY; - - for (i = 0; i < lmv->desc.ld_tgt_count; i++) { - int err; - tgt = lmv->tgts[i]; - if (tgt == NULL || tgt->ltd_exp == NULL || !tgt->ltd_active) { - CERROR("lmv idx %d inactive\n", i); - RETURN(-EIO); - } - - err = obd_quotacheck(tgt->ltd_exp, oqctl); - if (err && !rc) - rc = err; - } - - RETURN(rc); -} - static int lmv_merge_attr(struct obd_export *exp, const struct lmv_stripe_md *lsm, struct cl_attr *attr, @@ -3533,7 +3505,6 @@ struct obd_ops lmv_obd_ops = { .o_notify = lmv_notify, .o_get_uuid = lmv_get_uuid, .o_iocontrol = lmv_iocontrol, - .o_quotacheck = lmv_quotacheck, .o_quotactl = lmv_quotactl }; diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index c535557..1d93581 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -1283,9 +1283,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len, osc_obd->obd_force = obddev->obd_force; err = obd_iocontrol(cmd, lov->lov_tgts[i]->ltd_exp, len, karg, uarg); - if (err == -ENODATA && cmd == OBD_IOC_POLL_QUOTACHECK) { - RETURN(err); - } else if (err) { + if (err) { if (lov->lov_tgts[i]->ltd_active) { CDEBUG(err == -ENOTTY ? D_IOCTL : D_WARNING, @@ -1427,12 +1425,8 @@ static int lov_quotactl(struct obd_device *obd, struct obd_export *exp, int i, rc = 0; ENTRY; - if (oqctl->qc_cmd != LUSTRE_Q_QUOTAON && - oqctl->qc_cmd != LUSTRE_Q_QUOTAOFF && - oqctl->qc_cmd != Q_GETOQUOTA && - oqctl->qc_cmd != Q_INITQUOTA && - oqctl->qc_cmd != LUSTRE_Q_SETQUOTA && - oqctl->qc_cmd != Q_FINVALIDATE) { + if (oqctl->qc_cmd != Q_GETOQUOTA && + oqctl->qc_cmd != LUSTRE_Q_SETQUOTA) { CERROR("%s: bad quota opc %x for lov obd\n", obd->obd_name, oqctl->qc_cmd); RETURN(-EFAULT); @@ -1480,50 +1474,6 @@ static int lov_quotactl(struct obd_device *obd, struct obd_export *exp, RETURN(rc); } -static int lov_quotacheck(struct obd_device *obd, struct obd_export *exp, - struct obd_quotactl *oqctl) -{ - struct lov_obd *lov = &obd->u.lov; - int i, rc = 0; - ENTRY; - - obd_getref(obd); - - for (i = 0; i < lov->desc.ld_tgt_count; i++) { - if (!lov->lov_tgts[i]) - continue; - - /* Skip quota check on the administratively disabled OSTs. */ - if (!lov->lov_tgts[i]->ltd_activate) { - CWARN("lov idx %d was administratively disabled, " - "skip quotacheck on it.\n", i); - continue; - } - - if (!lov->lov_tgts[i]->ltd_active) { - CERROR("lov idx %d inactive\n", i); - rc = -EIO; - goto out; - } - } - - for (i = 0; i < lov->desc.ld_tgt_count; i++) { - int err; - - if (!lov->lov_tgts[i] || !lov->lov_tgts[i]->ltd_activate) - continue; - - err = obd_quotacheck(lov->lov_tgts[i]->ltd_exp, oqctl); - if (err && !rc) - rc = err; - } - -out: - obd_putref(obd); - - RETURN(rc); -} - static struct obd_ops lov_obd_ops = { .o_owner = THIS_MODULE, .o_setup = lov_setup, @@ -1546,7 +1496,6 @@ static struct obd_ops lov_obd_ops = { .o_getref = lov_getref, .o_putref = lov_putref, .o_quotactl = lov_quotactl, - .o_quotacheck = lov_quotacheck, }; struct kmem_cache *lov_oinfo_slab; diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 56fcc0d..808abbe 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -2040,53 +2040,6 @@ static int mdc_ioc_changelog_send(struct obd_device *obd, static int mdc_ioc_hsm_ct_start(struct obd_export *exp, struct lustre_kernelcomm *lk); -static int mdc_quotacheck(struct obd_device *unused, struct obd_export *exp, - struct obd_quotactl *oqctl) -{ - struct client_obd *cli = &exp->exp_obd->u.cli; - struct ptlrpc_request *req; - struct obd_quotactl *body; - int rc; - ENTRY; - - req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), - &RQF_MDS_QUOTACHECK, LUSTRE_MDS_VERSION, - MDS_QUOTACHECK); - if (req == NULL) - RETURN(-ENOMEM); - - body = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL); - *body = *oqctl; - - ptlrpc_request_set_replen(req); - - /* the next poll will find -ENODATA, that means quotacheck is - * going on */ - cli->cl_qchk_stat = -ENODATA; - rc = ptlrpc_queue_wait(req); - if (rc) - cli->cl_qchk_stat = rc; - ptlrpc_req_finished(req); - RETURN(rc); -} - -static int mdc_quota_poll_check(struct obd_export *exp, - struct if_quotacheck *qchk) -{ - struct client_obd *cli = &exp->exp_obd->u.cli; - int rc; - ENTRY; - - qchk->obd_uuid = cli->cl_target_uuid; - memcpy(qchk->obd_type, LUSTRE_MDS_NAME, strlen(LUSTRE_MDS_NAME)); - - rc = cli->cl_qchk_stat; - /* the client is not the previous one */ - if (rc == CL_NOT_QUOTACHECKED) - rc = -EINTR; - RETURN(rc); -} - static int mdc_quotactl(struct obd_device *unused, struct obd_export *exp, struct obd_quotactl *oqctl) { @@ -2242,9 +2195,6 @@ static int mdc_iocontrol(unsigned int cmd, struct obd_export *exp, int len, case IOC_OSC_SET_ACTIVE: rc = ptlrpc_set_import_active(imp, data->ioc_offset); GOTO(out, rc); - case OBD_IOC_POLL_QUOTACHECK: - rc = mdc_quota_poll_check(exp, (struct if_quotacheck *)karg); - GOTO(out, rc); case OBD_IOC_PING_TARGET: rc = ptlrpc_obd_ping(obd); GOTO(out, rc); @@ -3023,7 +2973,6 @@ static struct obd_ops mdc_obd_ops = { .o_process_config = mdc_process_config, .o_get_uuid = mdc_get_uuid, .o_quotactl = mdc_quotactl, - .o_quotacheck = mdc_quotacheck }; static struct md_ops mdc_md_ops = { diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index e5552a1..9b03bd8 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1933,14 +1933,6 @@ static int mdt_quotactl(struct tgt_session_info *tsi) RETURN(err_serious(rc)); switch (oqctl->qc_cmd) { - case Q_QUOTACHECK: - case LUSTRE_Q_INVALIDATE: - case LUSTRE_Q_FINVALIDATE: - case Q_QUOTAON: - case Q_QUOTAOFF: - case Q_INITQUOTA: - /* deprecated, not used any more */ - RETURN(-EOPNOTSUPP); /* master quotactl */ case Q_SETINFO: case Q_SETQUOTA: diff --git a/lustre/obdclass/lprocfs_status_server.c b/lustre/obdclass/lprocfs_status_server.c index 2f8d21c..5e30671 100644 --- a/lustre/obdclass/lprocfs_status_server.c +++ b/lustre/obdclass/lprocfs_status_server.c @@ -446,7 +446,6 @@ void lprocfs_init_ops_stats(int num_private_stats, struct lprocfs_stats *stats) LPROCFS_OBD_OP_INIT(num_private_stats, stats, notify); LPROCFS_OBD_OP_INIT(num_private_stats, stats, health_check); LPROCFS_OBD_OP_INIT(num_private_stats, stats, get_uuid); - LPROCFS_OBD_OP_INIT(num_private_stats, stats, quotacheck); LPROCFS_OBD_OP_INIT(num_private_stats, stats, quotactl); LPROCFS_OBD_OP_INIT(num_private_stats, stats, ping); LPROCFS_OBD_OP_INIT(num_private_stats, stats, pool_new); diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index e6cfb21..80c6087 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -2121,11 +2121,6 @@ static int ofd_quotactl(struct tgt_session_info *tsi) if (repoqc == NULL) RETURN(err_serious(-ENOMEM)); - /* report success for quota on/off for interoperability with current MDT - * stack */ - if (oqctl->qc_cmd == Q_QUOTAON || oqctl->qc_cmd == Q_QUOTAOFF) - RETURN(0); - *repoqc = *oqctl; id = repoqc->qc_id; diff --git a/lustre/osc/osc_internal.h b/lustre/osc/osc_internal.h index 9985e72..7663bff 100644 --- a/lustre/osc/osc_internal.h +++ b/lustre/osc/osc_internal.h @@ -206,9 +206,6 @@ int osc_quota_setdq(struct client_obd *cli, const unsigned int qid[], int osc_quota_chkdq(struct client_obd *cli, const unsigned int qid[]); int osc_quotactl(struct obd_device *unused, struct obd_export *exp, struct obd_quotactl *oqctl); -int osc_quotacheck(struct obd_device *unused, struct obd_export *exp, - struct obd_quotactl *oqctl); -int osc_quota_poll_check(struct obd_export *exp, struct if_quotacheck *qchk); void osc_inc_unstable_pages(struct ptlrpc_request *req); void osc_dec_unstable_pages(struct ptlrpc_request *req); bool osc_over_unstable_soft_limit(struct client_obd *cli); diff --git a/lustre/osc/osc_quota.c b/lustre/osc/osc_quota.c index 7ba8864..1524ea7 100644 --- a/lustre/osc/osc_quota.c +++ b/lustre/osc/osc_quota.c @@ -281,49 +281,3 @@ int osc_quotactl(struct obd_device *unused, struct obd_export *exp, RETURN(rc); } - -int osc_quotacheck(struct obd_device *unused, struct obd_export *exp, - struct obd_quotactl *oqctl) -{ - struct client_obd *cli = &exp->exp_obd->u.cli; - struct ptlrpc_request *req; - struct obd_quotactl *body; - int rc; - ENTRY; - - req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), - &RQF_OST_QUOTACHECK, LUSTRE_OST_VERSION, - OST_QUOTACHECK); - if (req == NULL) - RETURN(-ENOMEM); - - body = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL); - *body = *oqctl; - - ptlrpc_request_set_replen(req); - - /* the next poll will find -ENODATA, that means quotacheck is - * going on */ - cli->cl_qchk_stat = -ENODATA; - rc = ptlrpc_queue_wait(req); - if (rc) - cli->cl_qchk_stat = rc; - ptlrpc_req_finished(req); - RETURN(rc); -} - -int osc_quota_poll_check(struct obd_export *exp, struct if_quotacheck *qchk) -{ - struct client_obd *cli = &exp->exp_obd->u.cli; - int rc; - ENTRY; - - qchk->obd_uuid = cli->cl_target_uuid; - memcpy(qchk->obd_type, LUSTRE_OST_NAME, strlen(LUSTRE_OST_NAME)); - - rc = cli->cl_qchk_stat; - /* the client is not the previous one */ - if (rc == CL_NOT_QUOTACHECKED) - rc = -EINTR; - RETURN(rc); -} diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 8234389..9b321b4 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -2429,9 +2429,6 @@ static int osc_iocontrol(unsigned int cmd, struct obd_export *exp, int len, err = ptlrpc_set_import_active(obd->u.cli.cl_import, data->ioc_offset); GOTO(out, err); - case OBD_IOC_POLL_QUOTACHECK: - err = osc_quota_poll_check(exp, (struct if_quotacheck *)karg); - GOTO(out, err); case OBD_IOC_PING_TARGET: err = ptlrpc_obd_ping(obd); GOTO(out, err); @@ -2920,7 +2917,6 @@ static struct obd_ops osc_obd_ops = { .o_import_event = osc_import_event, .o_process_config = osc_process_config, .o_quotactl = osc_quotactl, - .o_quotacheck = osc_quotacheck, }; static int __init osc_init(void) diff --git a/lustre/ptlrpc/layout.c b/lustre/ptlrpc/layout.c index 0f0946a..3f845cd 100644 --- a/lustre/ptlrpc/layout.c +++ b/lustre/ptlrpc/layout.c @@ -732,7 +732,6 @@ static struct req_format *req_formats[] = { &RQF_MDS_REINT_RENAME, &RQF_MDS_REINT_SETATTR, &RQF_MDS_REINT_SETXATTR, - &RQF_MDS_QUOTACHECK, &RQF_MDS_QUOTACTL, &RQF_MDS_HSM_PROGRESS, &RQF_MDS_HSM_CT_REGISTER, @@ -743,10 +742,8 @@ static struct req_format *req_formats[] = { &RQF_MDS_HSM_REQUEST, &RQF_MDS_SWAP_LAYOUTS, &RQF_OUT_UPDATE, - &RQF_QC_CALLBACK, &RQF_OST_CONNECT, &RQF_OST_DISCONNECT, - &RQF_OST_QUOTACHECK, &RQF_OST_QUOTACTL, &RQF_OST_GETATTR, &RQF_OST_SETATTR, @@ -1271,14 +1268,6 @@ struct req_format RQF_LOG_CANCEL = DEFINE_REQ_FMT0("OBD_LOG_CANCEL", log_cancel_client, empty); EXPORT_SYMBOL(RQF_LOG_CANCEL); -struct req_format RQF_MDS_QUOTACHECK = - DEFINE_REQ_FMT0("MDS_QUOTACHECK", quotactl_only, empty); -EXPORT_SYMBOL(RQF_MDS_QUOTACHECK); - -struct req_format RQF_OST_QUOTACHECK = - DEFINE_REQ_FMT0("OST_QUOTACHECK", quotactl_only, empty); -EXPORT_SYMBOL(RQF_OST_QUOTACHECK); - struct req_format RQF_MDS_QUOTACTL = DEFINE_REQ_FMT0("MDS_QUOTACTL", quotactl_only, quotactl_only); EXPORT_SYMBOL(RQF_MDS_QUOTACTL); @@ -1287,10 +1276,6 @@ struct req_format RQF_OST_QUOTACTL = DEFINE_REQ_FMT0("OST_QUOTACTL", quotactl_only, quotactl_only); EXPORT_SYMBOL(RQF_OST_QUOTACTL); -struct req_format RQF_QC_CALLBACK = - DEFINE_REQ_FMT0("QC_CALLBACK", quotactl_only, empty); -EXPORT_SYMBOL(RQF_QC_CALLBACK); - struct req_format RQF_QUOTA_DQACQ = DEFINE_REQ_FMT0("QUOTA_DQACQ", quota_body_only, quota_body_only); EXPORT_SYMBOL(RQF_QUOTA_DQACQ); diff --git a/lustre/quota/qmt_handler.c b/lustre/quota/qmt_handler.c index 2a1bae8..a1f0f1b 100644 --- a/lustre/quota/qmt_handler.c +++ b/lustre/quota/qmt_handler.c @@ -312,13 +312,6 @@ static int qmt_quotactl(const struct lu_env *env, struct lu_device *ld, dqb->dqb_valid & QIF_BFLAGS); break; - case Q_QUOTAON: - case Q_QUOTAOFF: /* quota is always turned on on the master */ - RETURN(0); - - case LUSTRE_Q_INVALIDATE: /* not supported any more */ - RETURN(-ENOTSUPP); - default: CERROR("%s: unsupported quotactl command: %d\n", qmt->qmt_svname, oqctl->qc_cmd); diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 051cbab..4f552b7 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -1003,11 +1003,6 @@ int tgt_obd_log_cancel(struct tgt_session_info *tsi) return err_serious(-EOPNOTSUPP); } -int tgt_obd_qc_callback(struct tgt_session_info *tsi) -{ - return err_serious(-EOPNOTSUPP); -} - int tgt_sendpage(struct tgt_session_info *tsi, struct lu_rdpg *rdpg, int nob) { struct tgt_thread_info *tti = tgt_th_info(tsi->tsi_env); @@ -1133,7 +1128,6 @@ out: struct tgt_handler tgt_obd_handlers[] = { TGT_OBD_HDL (0, OBD_PING, tgt_obd_ping), TGT_OBD_HDL_VAR(0, OBD_LOG_CANCEL, tgt_obd_log_cancel), -TGT_OBD_HDL_VAR(0, OBD_QC_CALLBACK, tgt_obd_qc_callback), TGT_OBD_HDL (0, OBD_IDX_READ, tgt_obd_idx_read) }; EXPORT_SYMBOL(tgt_obd_handlers); diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index bfffbd9..50d42b5 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -86,9 +86,6 @@ static int lfs_df(int argc, char **argv); static int lfs_getname(int argc, char **argv); static int lfs_check(int argc, char **argv); #ifdef HAVE_SYS_QUOTA_H -static int lfs_quotacheck(int argc, char **argv); -static int lfs_quotaon(int argc, char **argv); -static int lfs_quotaoff(int argc, char **argv); static int lfs_setquota(int argc, char **argv); static int lfs_quota(int argc, char **argv); #endif @@ -249,16 +246,6 @@ command_t cmdlist[] = { "[for specified path only]\n" "Usage: getname [-h]|[path ...] "}, #ifdef HAVE_SYS_QUOTA_H - {"quotacheck", lfs_quotacheck, 0, - "Scan the specified filesystem for disk usage, and create,\n" - "or update quota files. Deprecated as of 2.4.0.\n" - "usage: quotacheck [ -ug ] "}, - {"quotaon", lfs_quotaon, 0, "Turn filesystem" - " quotas on. Deprecated as of 2.4.0.\n" - "usage: quotaon [ -ugf ] "}, - {"quotaoff", lfs_quotaoff, 0, "Turn filesystem" - " quotas off. Deprecated as of 2.4.0.\n" - "usage: quotaoff [ -ug ] "}, {"setquota", lfs_setquota, 0, "Set filesystem quotas.\n" "usage: setquota <-u|-g> |||\n" " -b -B \n" @@ -2224,206 +2211,6 @@ static int lfs_join(int argc, char **argv) } #ifdef HAVE_SYS_QUOTA_H -static int lfs_quotacheck(int argc, char **argv) -{ - int c, check_type = 0; - char *mnt; - struct if_quotacheck qchk; - struct if_quotactl qctl; - char *obd_type = (char *)qchk.obd_type; - int rc; - - memset(&qchk, 0, sizeof(qchk)); - - while ((c = getopt(argc, argv, "gu")) != -1) { - switch (c) { - case 'u': - check_type |= 0x01; - break; - case 'g': - check_type |= 0x02; - break; - default: - fprintf(stderr, "error: %s: option '-%c' " - "unrecognized\n", argv[0], c); - return CMD_HELP; - } - } - - if (check_type) - check_type--; - else /* do quotacheck for both user & group quota by default */ - check_type = 0x02; - - if (argc == optind) - return CMD_HELP; - - mnt = argv[optind]; - - rc = llapi_quotacheck(mnt, check_type); - if (rc == -EOPNOTSUPP) { - fprintf(stderr, "error: quotacheck not supported by the quota " - "master.\nPlease note that quotacheck is deprecated as " - "of lustre 2.4.0 since space accounting is always " - "enabled.\nFilesystems not formatted with 2.4 utils or " - "beyond can be upgraded with tunefs.lustre --quota.\n"); - return rc; - } else if (rc) { - fprintf(stderr, "quotacheck failed: %s\n", strerror(-rc)); - return rc; - } - - rc = llapi_poll_quotacheck(mnt, &qchk); - if (rc) { - if (*obd_type) - fprintf(stderr, "%s %s ", obd_type, - obd_uuid2str(&qchk.obd_uuid)); - fprintf(stderr, "quota check failed: %s\n", strerror(-rc)); - return rc; - } - - memset(&qctl, 0, sizeof(qctl)); - qctl.qc_cmd = LUSTRE_Q_QUOTAON; - qctl.qc_type = check_type; - rc = llapi_quotactl(mnt, &qctl); - if (rc && rc != -EALREADY) { - if (*obd_type) - fprintf(stderr, "%s %s ", (char *)qctl.obd_type, - obd_uuid2str(&qctl.obd_uuid)); - fprintf(stderr, "%s turn on quota failed: %s\n", - argv[0], strerror(-rc)); - return rc; - } - - return 0; -} - -static int lfs_quotaon(int argc, char **argv) -{ - int c; - char *mnt; - struct if_quotactl qctl; - char *obd_type = (char *)qctl.obd_type; - int rc; - - memset(&qctl, 0, sizeof(qctl)); - qctl.qc_cmd = LUSTRE_Q_QUOTAON; - - while ((c = getopt(argc, argv, "fgu")) != -1) { - switch (c) { - case 'u': - qctl.qc_type |= 0x01; - break; - case 'g': - qctl.qc_type |= 0x02; - break; - case 'f': - qctl.qc_cmd = LUSTRE_Q_QUOTAOFF; - break; - default: - fprintf(stderr, "error: %s: option '-%c' " - "unrecognized\n", argv[0], c); - return CMD_HELP; - } - } - - if (qctl.qc_type) - qctl.qc_type--; - else /* by default, enable quota for both user & group */ - qctl.qc_type = 0x02; - - if (argc == optind) - return CMD_HELP; - - mnt = argv[optind]; - - rc = llapi_quotactl(mnt, &qctl); - if (rc) { - if (rc == -EOPNOTSUPP) { - fprintf(stderr, "error: quotaon not supported by the " - "quota master.\nPlease note that quotaon/off is" - " deprecated as of lustre 2.4.0.\nQuota " - "enforcement should now be enabled on the MGS " - "via:\nmgs# lctl conf_param ${FSNAME}.quota." - "=\n(ost for block quota, mdt " - "for inode quota, u for user and g for group" - "\n"); - } else if (rc == -EALREADY) { - rc = 0; - } else if (rc == -ENOENT) { - fprintf(stderr, "error: cannot find quota database, " - "make sure you have run quotacheck\n"); - } else { - if (*obd_type) - fprintf(stderr, "%s %s ", obd_type, - obd_uuid2str(&qctl.obd_uuid)); - fprintf(stderr, "%s failed: %s\n", argv[0], - strerror(-rc)); - } - } - - return rc; -} - -static int lfs_quotaoff(int argc, char **argv) -{ - int c; - char *mnt; - struct if_quotactl qctl; - char *obd_type = (char *)qctl.obd_type; - int rc; - - memset(&qctl, 0, sizeof(qctl)); - qctl.qc_cmd = LUSTRE_Q_QUOTAOFF; - - while ((c = getopt(argc, argv, "gu")) != -1) { - switch (c) { - case 'u': - qctl.qc_type |= 0x01; - break; - case 'g': - qctl.qc_type |= 0x02; - break; - default: - fprintf(stderr, "error: %s: option '-%c' " - "unrecognized\n", argv[0], c); - return CMD_HELP; - } - } - - if (qctl.qc_type) - qctl.qc_type--; - else /* by default, disable quota for both user & group */ - qctl.qc_type = 0x02; - - if (argc == optind) - return CMD_HELP; - - mnt = argv[optind]; - - rc = llapi_quotactl(mnt, &qctl); - if (rc) { - if (rc == -EOPNOTSUPP) { - fprintf(stderr, "error: quotaoff not supported by the " - "quota master.\nPlease note that quotaon/off is" - " deprecated as of lustre 2.4.0.\nQuota " - "enforcement can be disabled on the MGS via:\n" - "mgs# lctl conf_param ${FSNAME}.quota." - "=\"\"\n"); - } else if (rc == -EALREADY) { - rc = 0; - } else { - if (*obd_type) - fprintf(stderr, "%s %s ", obd_type, - obd_uuid2str(&qctl.obd_uuid)); - fprintf(stderr, "quotaoff failed: %s\n", - strerror(-rc)); - } - } - - return rc; -} - #define ARG2INT(nr, str, msg) \ do { \ char *endp; \ diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 309e8c5..fa5fffd 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -3693,52 +3693,6 @@ int llapi_is_lustre_mnt(struct mntent *mnt) strstr(mnt->mnt_fsname, ":/") != NULL); } -int llapi_quotacheck(char *mnt, int check_type) -{ - DIR *root; - int rc; - - root = opendir(mnt); - if (!root) { - rc = -errno; - llapi_error(LLAPI_MSG_ERROR, rc, "open %s failed", mnt); - return rc; - } - - rc = ioctl(dirfd(root), OBD_IOC_QUOTACHECK, check_type); - if (rc < 0) - rc = -errno; - - closedir(root); - return rc; -} - -int llapi_poll_quotacheck(char *mnt, struct if_quotacheck *qchk) -{ - DIR *root; - int poll_intvl = 2; - int rc; - - root = opendir(mnt); - if (!root) { - rc = -errno; - llapi_error(LLAPI_MSG_ERROR, rc, "open %s failed", mnt); - return rc; - } - - while (1) { - rc = ioctl(dirfd(root), OBD_IOC_POLL_QUOTACHECK, qchk); - if (!rc) - break; - sleep(poll_intvl); - if (poll_intvl < 30) - poll_intvl *= 2; - } - - closedir(root); - return 0; -} - int llapi_quotactl(char *mnt, struct if_quotactl *qctl) { DIR *root; -- 1.8.3.1