Whamcloud - gitweb
- putting file fid into o_inline for cases when crow object may be created. It will...
authoryury <yury>
Fri, 8 Jul 2005 15:23:42 +0000 (15:23 +0000)
committeryury <yury>
Fri, 8 Jul 2005 15:23:42 +0000 (15:23 +0000)
lustre/include/linux/lustre_idl.h
lustre/llite/llite_lib.c
lustre/llite/rw.c
lustre/lov/lov_obd.c
lustre/obdfilter/filter.c

index 202cd01..298a71c 100644 (file)
@@ -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
index ba7ddd3..8aeb2db 100644 (file)
@@ -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);
index f2c6836..0a4a4de 100644 (file)
@@ -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);
index 74a1a5f..ade5056 100644 (file)
@@ -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);
 
index 7e7953a..8ec9afe 100644 (file)
@@ -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);