int (*ap_refresh_count)(void *data, int cmd);
void (*ap_fill_obdo)(void *data, int cmd, struct obdo *oa);
void (*ap_completion)(void *data, int cmd, struct obdo *oa, int rc);
- void (*ap_get_ucred)(void *data, struct lvfs_ucred *ouc);
};
/* the `oig' is passed down from a caller of obd rw methods. the callee
EXIT;
}
-static void llu_ap_get_ucred(void *data, struct lvfs_ucred *luc)
-{
- struct ll_async_page *llap;
- struct ll_uctxt ctxt;
- ENTRY;
-
- llap = LLAP_FROM_COOKIE(data);
-
- luc->luc_fsuid = current->fsuid;
- luc->luc_fsgid = current->fsgid;
- luc->luc_cap = current->cap_effective;
- ll_i2uctxt(&ctxt, llap->llap_inode, NULL);
- luc->luc_suppgid1 = ctxt.gid1;
-
- EXIT;
-}
-
static struct obd_async_page_ops llu_async_page_ops = {
.ap_make_ready = NULL,
.ap_refresh_count = NULL,
.ap_fill_obdo = llu_ap_fill_obdo,
.ap_completion = llu_ap_completion,
- .ap_get_ucred = llu_ap_get_ucred,
};
static int llu_queue_pio(int cmd, struct llu_io_group *group,
static int llu_iop_ioctl(struct inode *ino, unsigned long int request,
va_list ap)
{
+ unsigned long arg;
liblustre_wait_event(0);
switch (request) {
- unsigned long arg;
case LL_IOC_GROUP_LOCK:
arg = va_arg(ap, unsigned long);
return llu_get_grouplock(ino, arg);
struct page *llap_page;
struct list_head llap_pending_write;
struct list_head llap_pglist_item;
- /* user credit information for oss enforcement quota */
- struct lvfs_ucred llap_ouc;
/* checksum for paranoid I/O debugging */
__u32 llap_checksum;
};
EXIT;
}
-static void ll_ap_get_ucred(void *data, struct lvfs_ucred *ouc)
-{
- struct ll_async_page *llap;
-
- llap = LLAP_FROM_COOKIE(data);
- if (IS_ERR(llap)) {
- EXIT;
- return;
- }
-
- memcpy(ouc, &llap->llap_ouc, sizeof(*ouc));
- EXIT;
-}
-
static struct obd_async_page_ops ll_async_page_ops = {
.ap_make_ready = ll_ap_make_ready,
.ap_refresh_count = ll_ap_refresh_count,
.ap_fill_obdo = ll_ap_fill_obdo,
.ap_completion = ll_ap_completion,
- .ap_get_ucred = ll_ap_get_ucred,
};
struct ll_async_page *llap_cast_private(struct page *page)
struct lov_stripe_md *lsm = lli->lli_smd;
struct obd_export *exp;
struct ll_async_page *llap;
- struct ll_uctxt ctxt;
loff_t size;
int rc = 0;
ENTRY;
if (exp == NULL)
RETURN(-EINVAL);
- /* set user credit information for this page */
- llap->llap_ouc.luc_fsuid = current->fsuid;
- llap->llap_ouc.luc_fsgid = current->fsgid;
- llap->llap_ouc.luc_cap = current->cap_effective;
- ll_i2uctxt(&ctxt, inode, NULL);
- llap->llap_ouc.luc_suppgid1 = ctxt.gid1;
-
/* queue a write for some time in the future the first time we
* dirty the page */
if (!PageDirty(page)) {
int lustre_dquot_init(void);
void lustre_dquot_exit(void);
int dqacq_handler(struct obd_device *obd, struct qunit_data *qdata, int opc);
-void mds_adjust_qunit(struct obd_device *obd, uid_t cuid, gid_t cgid,
+void mds_adjust_qunit(struct obd_device *obd, uid_t cuid, gid_t cgid,
uid_t puid, gid_t pgid, int rc);
int init_admin_quotafiles(struct obd_device *obd, struct obd_quotactl *oqctl);
int mds_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl);
#else
static inline int lustre_dquot_init(void) { return 0; }
static inline void lustre_dquot_exit(void) { return; }
-static inline int dqacq_handler(struct obd_device *obd,
+static inline int dqacq_handler(struct obd_device *obd,
struct qunit_data *qdata, int opc) {return 0;}
-static inline void mds_adjust_qunit(struct obd_device *obd, uid_t cuid,
- gid_t cgid, uid_t puid,
+static inline void mds_adjust_qunit(struct obd_device *obd, uid_t cuid,
+ gid_t cgid, uid_t puid,
gid_t pgid, int rc) { return; }
-static inline int init_admin_quotafiles(struct obd_device *obd,
+static inline int init_admin_quotafiles(struct obd_device *obd,
struct obd_quotactl *oqctl) {return 0;}
-static inline int mds_quota_on(struct obd_device *obd,
+static inline int mds_quota_on(struct obd_device *obd,
struct obd_quotactl *oqctl) { return 0; }
-static inline int mds_quota_off(struct obd_device *obd,
+static inline int mds_quota_off(struct obd_device *obd,
struct obd_quotactl *oqctl) { return 0; }
-static inline int mds_set_dqinfo(struct obd_device *obd,
+static inline int mds_set_dqinfo(struct obd_device *obd,
struct obd_quotactl *oqctl) { return 0; }
-static inline int mds_get_dqinfo(struct obd_device *obd,
+static inline int mds_get_dqinfo(struct obd_device *obd,
struct obd_quotactl *oqctl) { return 0; }
-static inline int mds_set_dqblk(struct obd_device *obd,
+static inline int mds_set_dqblk(struct obd_device *obd,
struct obd_quotactl *oqctl) { return 0; }
-static inline int mds_get_dqblk(struct obd_device *obd,
+static inline int mds_get_dqblk(struct obd_device *obd,
struct obd_quotactl *oqctl) { return 0; }
#endif /* KERNEL_VERSION(2,5,0) && QUOTA */
ENTRY;
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+ /* dentry and mnt ref dropped in dentry_open() on error, or
+ * in filp_close() if dentry_open() succeeds */
dentry = dget(mds->mds_pending_dir);
if (IS_ERR(dentry))
GOTO(err_pop, rc = PTR_ERR(dentry));
unsigned long *blocks, int blocks_per_page) {}
static inline void filter_tally_read(struct filter_obd *filter,
struct niobuf_local *lnb, int niocount) {}
-static inline int lproc_filter_attach_seqstat(struct obd_device *dev) {};
+static inline int lproc_filter_attach_seqstat(struct obd_device *dev) {}
#endif
/* Quota stuff */
int lprocfs_filter_wr_itune(struct file *file, const char *buffer,
unsigned long count, void *data);
#endif /* LPROCFS */
-#else /* Quota */
+#else /* !HAVE_QUOTA_SUPPORT */
static inline int filter_quota_setup(struct filter_obd *filter)
{
return 0;
}
static inline void filter_quota_cleanup(struct filter_obd *filter) {}
-static inline void filter_quota_set_info(struct obd_export *exp, struct obd_device *obd) {}
-static inline int filter_quotacheck(struct obd_export *exp, struct obd_quotactl *oqctl)
+static inline void filter_quota_set_info(struct obd_export *exp,
+ struct obd_device *obd) {}
+static inline int filter_quotacheck(struct obd_export *exp,
+ struct obd_quotactl *oqctl)
{
return -ENOTSUPP;
}
-static inline int filter_quotactl(struct obd_export *exp, struct obd_quotactl *oqctl)
+static inline int filter_quotactl(struct obd_export *exp,
+ struct obd_quotactl *oqctl)
{
return -ENOTSUPP;
}
static inline int filter_quota_enforcement(struct obd_device *obd,
- unsigned int fsuid, unsigned int fsgid,
- struct lvfs_ucred **ret_uc)
+ unsigned int fsuid,
+ unsigned int fsgid,
+ struct lvfs_ucred **ret_uc)
{
return 0;
}
static inline int filter_get_quota_flag(struct obd_device *obd,
- struct obdo *oa)
+ struct obdo *oa)
{
return 0;
}
-static inline int filter_quota_check_master(struct obd_device *obd, struct inode *inode)
+static inline int filter_quota_check_master(struct obd_device *obd,
+ struct inode *inode)
{
return 0;
}
-#endif /* Quota */
+#endif /* HAVE_QUOTA_SUPPORT */
-#endif
+#endif /* _FILTER_INTERNAL_H */
if (rc)
filter_free_dio_pages(objcount, obj, niocount, res);
case 3:
- pop_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
filter_free_iobuf(iobuf);
case 2:
+ pop_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
if (rc)
f_dput(dentry);
break;
OBD_ALLOC(dreq, sizeof(*dreq));
if (dreq == NULL)
goto failed_0;
-
+
OBD_ALLOC(dreq->dr_pages, num_pages * sizeof(*dreq->dr_pages));
if (dreq->dr_pages == NULL)
goto failed_1;
-
+
OBD_ALLOC(dreq->dr_blocks,
MAX_BLOCKS_PER_PAGE * num_pages * sizeof(*dreq->dr_blocks));
if (dreq->dr_blocks == NULL)
if (dreq->dr_npages == 0)
RETURN(0);
- /* If there is any page in this write rpc that comes from client
- * cache, we write the whole rpc without quota limit */
- if (dreq->dr_flag & OBD_BRW_FROM_GRANT) {
- cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
- dreq->dr_flag &= ~OBD_BRW_FROM_GRANT;
- }
-
remap:
rc = fsfilt_map_inode_pages(obd, inode,
dreq->dr_pages, dreq->dr_npages,
if (rc != 0)
GOTO(cleanup, rc);
-
+
rc = filter_alloc_iobuf(&obd->u.filter, OBD_BRW_WRITE, obj->ioo_bufcnt,
(void **)&dreq);
if (rc)
this_size = lnb->offset + lnb->len;
if (this_size > iattr.ia_size)
iattr.ia_size = this_size;
- /* if one page is a write-back page from client cache,
- * then mark that the whole io request can be over quota */
- if (lnb->flags & OBD_BRW_FROM_GRANT)
- dreq->dr_flag |= OBD_BRW_FROM_GRANT;
}
/* The client store the user credit information fsuid and fsgid
void *oap_caller_data;
};
-#define OAP_FROM_COOKIE(c) \
- (LASSERT(((struct osc_async_page *)(c))->oap_magic == OAP_MAGIC), \
+#define OAP_FROM_COOKIE(c) \
+ (LASSERT(((struct osc_async_page *)(c))->oap_magic == OAP_MAGIC), \
(struct osc_async_page *)(c))
struct osc_cache_waiter {
int osc_quotacheck(struct obd_export *exp, struct obd_quotactl *oqctl);
int osc_poll_quotacheck(struct obd_export *exp, struct if_quotacheck *qchk);
int osc_quotactl(struct obd_export *exp, struct obd_quotactl *oqctl);
-#else
+#else /* !HAVE_QUOTA_SUPPORT */
static inline int osc_get_quota_flag(struct client_obd *cli,
- unsigned int uid, unsigned int gid)
+ unsigned int uid, unsigned int gid)
{
return QUOTA_OK;
}
static inline int osc_set_quota_flag(struct client_obd *cli,
- unsigned int uid, unsigned int gid,
- obd_flag valid, obd_flag flags)
+ unsigned int uid, unsigned int gid,
+ obd_flag valid, obd_flag flags)
{
return 0;
}
return 0;
}
static inline void osc_qinfo_exit(void) {}
-static inline int osc_quotacheck(struct obd_export *exp, struct obd_quotactl *oqctl)
+static inline int osc_quotacheck(struct obd_export *exp,
+ struct obd_quotactl *oqctl)
{
return -ENOTSUPP;
}
-static inline int osc_poll_quotacheck(struct obd_export *exp, struct if_quotacheck *qchk)
+static inline int osc_poll_quotacheck(struct obd_export *exp,
+ struct if_quotacheck *qchk)
{
return -ENOTSUPP;
}
-static inline int osc_quotactl(struct obd_export *exp, struct obd_quotactl *oqctl)
+static inline int osc_quotactl(struct obd_export *exp,
+ struct obd_quotactl *oqctl)
{
return -ENOTSUPP;
}
-#endif
+#endif /* HAVE_QUOTA_SUPPORT */
#ifdef LPROCFS
int lproc_osc_attach_seqstat(struct obd_device *dev);
(long long)OST_LAST_OPC);
LASSERTF(OBD_OBJECT_EOF == 0xffffffffffffffffULL," found %lld\n",
(long long)OBD_OBJECT_EOF);
- LASSERTF(OST_REQ_HAS_OA1 == 1, " found %lld\n",
- (long long)OST_REQ_HAS_OA1);
LASSERTF(MDS_GETATTR == 33, " found %lld\n",
(long long)MDS_GETATTR);
LASSERTF(MDS_GETATTR_NAME == 34, " found %lld\n",
(long long)(int)offsetof(struct ldlm_extent, end));
LASSERTF((int)sizeof(((struct ldlm_extent *)0)->end) == 8, " found %lld\n",
(long long)(int)sizeof(((struct ldlm_extent *)0)->end));
+ LASSERTF((int)offsetof(struct ldlm_extent, gid) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct ldlm_extent, gid));
+ LASSERTF((int)sizeof(((struct ldlm_extent *)0)->gid) == 8, " found %lld\n",
+ (long long)(int)sizeof(((struct ldlm_extent *)0)->gid));
/* Checks for struct ldlm_flock */
LASSERTF((int)sizeof(struct ldlm_flock) == 32, " found %lld\n",