Whamcloud - gitweb
LU-6910 osp: add procfs values for OST reserved size
[fs/lustre-release.git] / lustre / osp / osp_dev.c
index d85bbbe..2a9d30f 100644 (file)
@@ -752,7 +752,17 @@ static int osp_statfs(const struct lu_env *env, struct dt_device *dev,
               LPU64" files, "LPU64" free files\n", d->opd_obd->obd_name,
               sfs->os_blocks, sfs->os_bfree, sfs->os_bavail,
               sfs->os_files, sfs->os_ffree);
-       RETURN(0);
+
+       /* ENOSPC could be for two reasons,
+        * 1) not enough inodes 2) not enough blocks
+        * for 1) lod should use preallocated objects
+        * and for 2) shouldn`t. So, here for ENOSPC
+        * different values is returned to spend preallocated.
+        */
+       if (d->opd_pre_status == -ENOSPC && sfs->os_ffree < 32)
+               RETURN(0);
+
+       RETURN(d->opd_pre_status);
 }
 
 static int osp_sync_timeout(void *data)
@@ -1900,7 +1910,7 @@ struct llog_operations osp_mds_ost_orig_logops;
  * \retval 0           0 if initialization succeeds.
  * \retval negative    negative errno if initialization failed.
  */
-static int __init osp_mod_init(void)
+static int __init osp_init(void)
 {
        struct obd_type *type;
        int rc;
@@ -1952,7 +1962,7 @@ static int __init osp_mod_init(void)
  * This callback is called when kernel unloads OSP module from memory, and
  * it will deregister OSP and LWP device type from obd_types (\see class_obd.c).
  */
-static void __exit osp_mod_exit(void)
+static void __exit osp_exit(void)
 {
        class_unregister_type(LUSTRE_LWP_NAME);
        class_unregister_type(LUSTRE_OSP_NAME);
@@ -1960,9 +1970,9 @@ static void __exit osp_mod_exit(void)
 }
 
 MODULE_AUTHOR("OpenSFS, Inc. <http://www.lustre.org/>");
-MODULE_DESCRIPTION("Lustre OST Proxy Device ("LUSTRE_OSP_NAME")");
+MODULE_DESCRIPTION("Lustre OSD Storage Proxy ("LUSTRE_OSP_NAME")");
 MODULE_VERSION(LUSTRE_VERSION_STRING);
 MODULE_LICENSE("GPL");
 
-module_init(osp_mod_init);
-module_exit(osp_mod_exit);
+module_init(osp_init);
+module_exit(osp_exit);