patch-2.4.19 linux-2.4.19/fs/block_dev.c
Next file: linux-2.4.19/fs/buffer.c
Previous file: linux-2.4.19/fs/binfmt_script.c
Back to the patch index
Back to the overall index
- Lines: 55
- Date:
Fri Aug 2 17:39:45 2002
- Orig file:
linux-2.4.18/fs/block_dev.c
- Orig date:
Mon Feb 25 11:38:08 2002
diff -urN linux-2.4.18/fs/block_dev.c linux-2.4.19/fs/block_dev.c
@@ -22,8 +22,6 @@
#include <asm/uaccess.h>
-#define MAX_BUF_PER_PAGE (PAGE_CACHE_SIZE / 512)
-
static unsigned long max_block(kdev_t dev)
{
unsigned int retval = ~0U;
@@ -102,6 +100,26 @@
return 0;
}
+int sb_set_blocksize(struct super_block *sb, int size)
+{
+ int bits;
+ if (set_blocksize(sb->s_dev, size) < 0)
+ return 0;
+ sb->s_blocksize = size;
+ for (bits = 9, size >>= 9; size >>= 1; bits++)
+ ;
+ sb->s_blocksize_bits = bits;
+ return sb->s_blocksize;
+}
+
+int sb_min_blocksize(struct super_block *sb, int size)
+{
+ int minsize = get_hardsect_size(sb->s_dev);
+ if (size < minsize)
+ size = minsize;
+ return sb_set_blocksize(sb, size);
+}
+
static int blkdev_get_block(struct inode * inode, long iblock, struct buffer_head * bh, int create)
{
if (iblock >= max_block(inode->i_rdev))
@@ -515,9 +533,6 @@
if (!bdops->check_media_change(dev))
return 0;
- printk(KERN_DEBUG "VFS: Disk change detected on device %s\n",
- bdevname(dev));
-
if (invalidate_device(dev, 0))
printk("VFS: busy inodes on changed media.\n");
@@ -616,7 +631,7 @@
down(&bdev->bd_sem);
lock_kernel();
- if (kind == BDEV_FILE)
+ if (kind == BDEV_FILE && bdev->bd_openers == 1)
__block_fsync(bd_inode);
else if (kind == BDEV_FS)
fsync_no_super(rdev);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)