[patchlet] Minor cleanup in mm/filemap.c (2.4.0-t8p1)

From: Rasmus Andersen (rasmus@jaquet.dk)
Date: Tue Aug 29 2000 - 16:59:39 EST


Hi.

The following patch applies against 2.4.0-test8-pre1 and does minor
cleanup in mm/filemap.c.

It falls in three parts:

o The first changes a direct reference to tsk->state to use
  __set_task_state. For cleanliness and consistency.
o The second part deletes 'wait' from the interface of filemap_write_page
  and cleans up the two places it is called. It seems to be a leftover
  from pre 2.4.0-test days.
o The last part changes a comment to follow the code.

Please comment.

--- linux-240test8-pre1/mm/filemap.c Tue Aug 29 22:20:51 2000
+++ linux/mm/filemap.c Tue Aug 29 23:46:07 2000
@@ -628,7 +628,7 @@
                         break;
                 schedule();
         } while (PageLocked(page));
- tsk->state = TASK_RUNNING;
+ __set_task_state(tsk, TASK_RUNNING);
         remove_wait_queue(&page->wait, &wait);
 }
 
@@ -1527,8 +1527,7 @@
 }
 
 static int filemap_write_page(struct file *file,
- struct page * page,
- int wait)
+ struct page * page)
 {
         /*
          * If a task terminates while we're swapping the page, the vma and
@@ -1548,7 +1547,7 @@
 extern void wakeup_bdflush(int);
 int filemap_swapout(struct page * page, struct file * file)
 {
- int retval = filemap_write_page(file, page, 0);
+ int retval = filemap_write_page(file, page);
         wakeup_bdflush(0);
         return retval;
 }
@@ -1595,7 +1594,7 @@
                         pgoff, page->index, address, vma->vm_start, vma->vm_pgoff);
         }
         lock_page(page);
- error = filemap_write_page(vma->vm_file, page, 1);
+ error = filemap_write_page(vma->vm_file, page);
         UnlockPage(page);
         page_cache_free(page);
         return error;
@@ -2234,7 +2233,7 @@
  * return values:
  * zero - success
  * -EFAULT - vec points to an illegal address
- * -EINVAL - addr is not a multiple of PAGE_CACHE_SIZE,
+ * -EINVAL - start is not a multiple of PAGE_CACHE_SIZE,
  * or len has a nonpositive value
  * -ENOMEM - Addresses in the range [addr, addr + len] are
  * invalid for the address space of this process, or

-- 
Regards,
        Rasmus(rasmus@jaquet.dk)

If a man says something in a forest and there are no women around to hear him, is he still wrong? -- Anonymous - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:24 EST