patch-1.3.1 linux/fs/buffer.c
Next file: linux/fs/minix/inode.c
Previous file: linux/drivers/scsi/u14-34f.h
Back to the patch index
Back to the overall index
- Lines: 32
- Date:
Tue Jun 13 13:51:18 1995
- Orig file:
v1.3.0/linux/fs/buffer.c
- Orig date:
Mon Jun 12 12:48:33 1995
diff -u --recursive --new-file v1.3.0/linux/fs/buffer.c linux/fs/buffer.c
@@ -1160,6 +1160,31 @@
}
/*
+ * bwrite_page writes a page out to the buffer cache and/or the physical device.
+ * It's used for mmap writes (the same way bread_page() is used for mmap reads).
+ */
+void bwrite_page(unsigned long address, dev_t dev, int b[], int size)
+{
+ struct buffer_head * bh[MAX_BUF_PER_PAGE];
+ int i, j;
+
+ for (i=0, j=0; j<PAGE_SIZE ; i++, j+= size) {
+ bh[i] = NULL;
+ if (b[i])
+ bh[i] = getblk(dev, b[i], size);
+ }
+ for (i=0, j=0; j<PAGE_SIZE ; i++, j += size, address += size) {
+ if (bh[i]) {
+ memcpy(bh[i]->b_data, (void *) address, size);
+ bh[i]->b_uptodate = 1;
+ mark_buffer_dirty(bh[i], 0);
+ brelse(bh[i]);
+ } else
+ memset((void *) address, 0, size);
+ }
+}
+
+/*
* Try to increase the number of buffers available: the size argument
* is used to determine what kind of buffers we want.
*/
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this