Whamcloud - gitweb
LU-5040 osd: fix osd declare credit for quota
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_internal.h
index b3f15b5..af14812 100644 (file)
@@ -52,7 +52,7 @@
 #include <linux/dcache.h>
 /* struct dirent64 */
 #include <linux/dirent.h>
-
+#include <linux/statfs.h>
 #include <ldiskfs/ldiskfs.h>
 #include <ldiskfs/ldiskfs_jbd2.h>
 
@@ -549,6 +549,7 @@ struct osd_thread_info {
         int                    oti_txns;
         /** used in osd_fid_set() to put xattr */
         struct lu_buf          oti_buf;
+       struct lu_buf          oti_big_buf;
         /** used in osd_ea_fid_set() to set fid into common ea */
        union {
                struct lustre_mdt_attrs oti_mdt_attrs;
@@ -706,10 +707,12 @@ loff_t find_tree_dqentry(const struct lu_env *env,
                          struct osd_it_quota *it);
 /* osd_quota.c */
 int osd_declare_qid(const struct lu_env *env, struct osd_thandle *oh,
-                   struct lquota_id_info *qi, bool allocated, int *flags);
+                   struct lquota_id_info *qi, struct osd_object *obj,
+                   bool enforce, int *flags);
 int osd_declare_inode_qid(const struct lu_env *env, qid_t uid, qid_t gid,
                          long long space, struct osd_thandle *oh,
-                         bool is_blk, bool allocated, int *flags, bool force);
+                         struct osd_object *obj, bool is_blk, int *flags,
+                         bool force);
 const struct dt_rec *osd_quota_pack(struct osd_object *obj,
                                    const struct dt_rec *rec,
                                    union lquota_rec *quota_rec);
@@ -1081,6 +1084,11 @@ static inline int fid_is_internal(const struct lu_fid *fid)
        return (!fid_is_namespace_visible(fid) && !fid_is_idif(fid));
 }
 
+static inline unsigned long osd_remote_parent_ino(struct osd_device *dev)
+{
+       return dev->od_mdt_map->omm_remote_parent->d_inode->i_ino;
+}
+
 #ifdef JOURNAL_START_HAS_3ARGS
 # define osd_journal_start_sb(sb, type, nblock) \
                ldiskfs_journal_start_sb(sb, type, nblock)
@@ -1089,7 +1097,9 @@ static inline int fid_is_internal(const struct lu_fid *fid)
 # define osd_ldiskfs_find_entry(dir, name, de, inlined, lock) \
                ldiskfs_find_entry(dir, name, de, inlined, lock)
 # define osd_journal_start(inode, type, nblocks) \
-               ldiskfs_journal_start(inode, type, nblocks);
+               ldiskfs_journal_start(inode, type, nblocks)
+# define osd_transaction_size(dev) \
+               (osd_journal(dev)->j_max_transaction_buffers / 2)
 #else
 # define LDISKFS_HT_MISC       0
 # define osd_journal_start_sb(sb, type, nblock) \
@@ -1099,7 +1109,9 @@ static inline int fid_is_internal(const struct lu_fid *fid)
 # define osd_ldiskfs_find_entry(dir, name, de, inlined, lock) \
                ldiskfs_find_entry(dir, name, de, lock)
 # define osd_journal_start(inode, type, nblocks) \
-               ldiskfs_journal_start(inode, nblocks);
+               ldiskfs_journal_start(inode, nblocks)
+# define osd_transaction_size(dev) \
+               (osd_journal(dev)->j_max_transaction_buffers)
 #endif
 
 void ldiskfs_inc_count(handle_t *handle, struct inode *inode);