Whamcloud - gitweb
LU-2886 mdd: create local files using local_storage lib
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_io.c
index 80c7d76..091feb6 100644 (file)
@@ -709,10 +709,15 @@ static int osd_declare_write_commit(const struct lu_env *env,
                /* ignore quota for the whole request if any page is from
                 * client cache or written by root.
                 *
+                * XXX once we drop the 1.8 client support, the checking
+                * for whether page is from cache can be simplified as:
+                * !(lnb[i].flags & OBD_BRW_SYNC)
+                *
                 * XXX we could handle this on per-lnb basis as done by
                 * grant. */
                if ((lnb[i].flags & OBD_BRW_NOQUOTA) ||
-                   !(lnb[i].flags & OBD_BRW_SYNC))
+                   (lnb[i].flags & (OBD_BRW_FROM_GRANT | OBD_BRW_SYNC)) ==
+                   OBD_BRW_FROM_GRANT)
                        ignore_quota = true;
        }
 
@@ -1043,17 +1048,7 @@ static ssize_t osd_declare_write(const struct lu_env *env, struct dt_object *dt,
         oh = container_of0(handle, struct osd_thandle, ot_super);
         LASSERT(oh->ot_handle == NULL);
 
-        /* XXX: size == 0 or INT_MAX indicating a catalog header update or
-         *      llog write, see comment in mdd_declare_llog_record().
-         *
-         *      This hack will be removed with llog over OSD landing
-         */
-        if (size == DECLARE_LLOG_REWRITE)
-                credits = 2;
-        else if (size == DECLARE_LLOG_WRITE)
-                credits = 6;
-        else
-                credits = osd_dto_credits_noquota[DTO_WRITE_BLOCK];
+       credits = osd_dto_credits_noquota[DTO_WRITE_BLOCK];
 
        osd_trans_declare_op(env, oh, OSD_OT_WRITE, credits);
 
@@ -1302,6 +1297,7 @@ static int osd_fiemap_get(const struct lu_env *env, struct dt_object *dt,
 
         LASSERT(inode);
         dentry->d_inode = inode;
+       dentry->d_sb = inode->i_sb;
         file->f_dentry = dentry;
         file->f_mapping = inode->i_mapping;
         file->f_op = inode->i_fop;