]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - mm/backing-dev.c
Merge tag 'iio-fixes-for-4.17a' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / mm / backing-dev.c
index d2984e9fcf0845383279524f317d03582d6c19af..023190c69dce71c528cccb7498e7456d41f674d3 100644 (file)
@@ -100,18 +100,7 @@ static int bdi_debug_stats_show(struct seq_file *m, void *v)
 
        return 0;
 }
-
-static int bdi_debug_stats_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, bdi_debug_stats_show, inode->i_private);
-}
-
-static const struct file_operations bdi_debug_stats_fops = {
-       .open           = bdi_debug_stats_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(bdi_debug_stats);
 
 static int bdi_debug_register(struct backing_dev_info *bdi, const char *name)
 {
@@ -1031,23 +1020,18 @@ EXPORT_SYMBOL(congestion_wait);
 
 /**
  * wait_iff_congested - Conditionally wait for a backing_dev to become uncongested or a pgdat to complete writes
- * @pgdat: A pgdat to check if it is heavily congested
  * @sync: SYNC or ASYNC IO
  * @timeout: timeout in jiffies
  *
- * In the event of a congested backing_dev (any backing_dev) and the given
- * @pgdat has experienced recent congestion, this waits for up to @timeout
- * jiffies for either a BDI to exit congestion of the given @sync queue
- * or a write to complete.
- *
- * In the absence of pgdat congestion, cond_resched() is called to yield
- * the processor if necessary but otherwise does not sleep.
+ * In the event of a congested backing_dev (any backing_dev) this waits
+ * for up to @timeout jiffies for either a BDI to exit congestion of the
+ * given @sync queue or a write to complete.
  *
  * The return value is 0 if the sleep is for the full timeout. Otherwise,
  * it is the number of jiffies that were still remaining when the function
  * returned. return_value == timeout implies the function did not sleep.
  */
-long wait_iff_congested(struct pglist_data *pgdat, int sync, long timeout)
+long wait_iff_congested(int sync, long timeout)
 {
        long ret;
        unsigned long start = jiffies;
@@ -1055,12 +1039,10 @@ long wait_iff_congested(struct pglist_data *pgdat, int sync, long timeout)
        wait_queue_head_t *wqh = &congestion_wqh[sync];
 
        /*
-        * If there is no congestion, or heavy congestion is not being
-        * encountered in the current pgdat, yield if necessary instead
+        * If there is no congestion, yield if necessary instead
         * of sleeping on the congestion queue
         */
-       if (atomic_read(&nr_wb_congested[sync]) == 0 ||
-           !test_bit(PGDAT_CONGESTED, &pgdat->flags)) {
+       if (atomic_read(&nr_wb_congested[sync]) == 0) {
                cond_resched();
 
                /* In case we scheduled, work out time remaining */