From 3c1322c91dedbbd893cd284ed24957783daf5258 Mon Sep 17 00:00:00 2001 From: yury Date: Fri, 8 Jul 2005 15:23:42 +0000 Subject: [PATCH] - putting file fid into o_inline for cases when crow object may be created. It will be used later for storing into OSS object EA what is needed for quota. --- lustre/include/linux/lustre_idl.h | 2 +- lustre/llite/llite_lib.c | 7 ++++++- lustre/llite/rw.c | 4 ++++ lustre/lov/lov_obd.c | 3 ++- lustre/obdfilter/filter.c | 3 +++ 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index 202cd01..298a71c 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -327,7 +327,7 @@ struct obdo { __u32 o_mds; __u64 o_fid; __u32 o_padding; - char o_inline[OBD_INLINESZ]; /* fid in ost writes */ + char o_inline[OBD_INLINESZ]; }; #define o_dirty o_blocks diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index ba7ddd3..8aeb2db 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1072,6 +1072,7 @@ void ll_clear_inode(struct inode *inode) int ll_setattr_raw(struct inode *inode, struct iattr *attr) { struct lov_stripe_md *lsm = ll_i2info(inode)->lli_smd; + struct ll_inode_info *lli = ll_i2info(inode); struct ll_sb_info *sbi = ll_i2sbi(inode); struct ptlrpc_request *request = NULL; struct mdc_op_data *op_data; @@ -1206,7 +1207,6 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr) ldlm_policy_data_t policy = { .l_extent = {attr->ia_size, OBD_OBJECT_EOF } }; struct lustre_handle lockh = { 0 }; - struct ll_inode_info *lli = ll_i2info(inode); int err, ast_flags = 0; /* XXX when we fix the AST intents to pass the discard-range * XXX extent, make ast_flags always LDLM_AST_DISCARD_DATA @@ -1249,6 +1249,7 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr) oa->o_gr = lsm->lsm_object_gr; oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP; + /* adding uid and gid, needed for quota */ if (ia_valid & ATTR_UID) { oa->o_uid = inode->i_uid; oa->o_valid |= OBD_MD_FLUID; @@ -1259,6 +1260,10 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr) oa->o_valid |= OBD_MD_FLGID; } + /* putting there also fid, needed for quota too. */ + memcpy(obdo_id(oa), &lli->lli_id, sizeof(lli->lli_id)); + oa->o_valid |= OBD_MD_FLINLINE; + obdo_from_inode(oa, inode, OBD_MD_FLTYPE | OBD_MD_FLATIME | OBD_MD_FLMTIME | OBD_MD_FLCTIME); rc = obd_setattr(sbi->ll_dt_exp, oa, lsm, NULL); diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index f2c6836..0a4a4de 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -225,6 +225,10 @@ int ll_prepare_write(struct file *file, struct page *page, oa->o_gid = inode->i_gid; oa->o_valid |= OBD_MD_FLGID; + + /* putting there also fid, needed for quota too. */ + memcpy(obdo_id(oa), &lli->lli_id, sizeof(lli->lli_id)); + oa->o_valid |= OBD_MD_FLINLINE; rc = obd_brw(OBD_BRW_CHECK, ll_i2dtexp(inode), oa, lsm, 1, &pga, NULL); diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 74a1a5f..ade5056 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -968,7 +968,8 @@ static int lov_setattr(struct obd_export *exp, struct obdo *src_oa, OBD_MD_FLATIME | OBD_MD_FLMTIME | OBD_MD_FLCTIME | OBD_MD_FLFLAGS | OBD_MD_FLSIZE | OBD_MD_FLGROUP | - OBD_MD_FLUID | OBD_MD_FLGID))); + OBD_MD_FLUID | OBD_MD_FLGID | + OBD_MD_FLINLINE))); LASSERT(!(src_oa->o_valid & OBD_MD_FLGROUP) || src_oa->o_gr > 0); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 7e7953a..8ec9afe 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -2448,6 +2448,9 @@ filter_crow_object(struct obd_device *obd, __u64 ogr, LPU64"/"LPU64" err = %d\n", oid, ogr, (int)PTR_ERR(dentry)); RETURN(dentry); + } else { + /* XXX: here should be storing fid from client into OSS object + * EA to use it for quota later. --umka */ } RETURN(dentry); -- 1.8.3.1