Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24 /mm/backing-dev.c

Filename:/mm/backing-dev.c
Lines Added:35
Lines Deleted:12
Also changed in: (Previous) 2.6.24-rc8  2.6.24-rc7  2.6.24-rc6  2.6.24-rc5  2.6.24-rc4-git7  2.6.24-rc4-git6 
(Following) 2.6.25-git16  2.6.25-git17  2.6.25-git18  2.6.25-git19  2.6.25-git20  2.6.26-rc1 

Location
[  2.6.24
  [  mm
     o  backing-dev.c

Patch

diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index f50a281..e8644b1 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -5,6 +5,41 @@
 #include <linux/sched.h>
 #include <linux/module.h>
 
+int bdi_init(struct backing_dev_info *bdi)
+{
+   int i;
+   int err;
+
+   for (i = 0; i < NR_BDI_STAT_ITEMS; i++) {
+      err = percpu_counter_init_irq(&bdi->bdi_stat[i], 0);
+      if (err)
+         goto err;
+   }
+
+   bdi->dirty_exceeded = 0;
+   err = prop_local_init_percpu(&bdi->completions);
+
+   if (err) {
+err:
+      while (i--)
+         percpu_counter_destroy(&bdi->bdi_stat[i]);
+   }
+
+   return err;
+}
+EXPORT_SYMBOL(bdi_init);
+
+void bdi_destroy(struct backing_dev_info *bdi)
+{
+   int i;
+
+   for (i = 0; i < NR_BDI_STAT_ITEMS; i++)
+      percpu_counter_destroy(&bdi->bdi_stat[i]);
+
+   prop_local_destroy_percpu(&bdi->completions);
+}
+EXPORT_SYMBOL(bdi_destroy);
+
 static wait_queue_head_t congestion_wqh[2] = {
       __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[0]),
       __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1])
@@ -55,15 +90,3 @@ long congestion_wait(int rw, long timeout)
 }
 EXPORT_SYMBOL(congestion_wait);
 
-/**
- * congestion_end - wake up sleepers on a congested backing_dev_info
- * @rw: READ or WRITE
- */
-void congestion_end(int rw)
-{
-   wait_queue_head_t *wqh = &congestion_wqh[rw];
-
-   if (waitqueue_active(wqh))
-      wake_up(wqh);
-}
-EXPORT_SYMBOL(congestion_end);


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.