Whamcloud - gitweb
LU-15 shrink the cache to alleviate OST memory pressure
[fs/lustre-release.git] / lustre / obdfilter / filter_internal.h
index 25e6e0b..d8cf3f9 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -113,8 +113,7 @@ enum {
         LPROC_FILTER_LAST,
 };
 
-//#define FILTER_MAX_CACHE_SIZE (32 * 1024 * 1024) /* was OBD_OBJECT_EOF */
-#define FILTER_MAX_CACHE_SIZE OBD_OBJECT_EOF
+#define FILTER_MAX_CACHE_SIZE (8 * 1024 * 1024)
 
 /* We have to pass a 'created' array to fsfilt_map_inode_pages() which we
  * then ignore.  So we pre-allocate one that everyone can use... */
@@ -152,7 +151,8 @@ int filter_setattr_internal(struct obd_export *exp, struct dentry *dentry,
 int filter_setattr(struct obd_export *exp, struct obd_info *oinfo,
                    struct obd_trans_info *oti);
 
-struct dentry *filter_create_object(struct obd_device *obd, struct obdo *oa);
+int filter_create(struct obd_export *exp, struct obdo *oa,
+                  struct lov_stripe_md **ea, struct obd_trans_info *oti);
 
 struct obd_llog_group *filter_find_olg(struct obd_device *obd, int seq);
 
@@ -243,4 +243,15 @@ void blacklist_add(uid_t uid);
 void blacklist_del(uid_t uid);
 int blacklist_display(char *buf, int bufsize);
 
+/* sync on lock cancel is useless when we force a journal flush,
+ * and if we enable async journal commit, we should also turn on
+ * sync on lock cancel if it is not enabled already. */
+static inline void filter_slc_set(struct filter_obd *filter)
+{
+        if (filter->fo_syncjournal == 1)
+                filter->fo_sync_lock_cancel = NEVER_SYNC_ON_CANCEL;
+        else if (filter->fo_sync_lock_cancel == NEVER_SYNC_ON_CANCEL)
+                filter->fo_sync_lock_cancel = ALWAYS_SYNC_ON_CANCEL;
+}
+
 #endif /* _FILTER_INTERNAL_H */