--- 2.2.14pre11-raid/fs/buffer.c.~1~ Mon Dec 6 18:40:45 1999 +++ 2.2.14pre11-raid/fs/buffer.c Mon Dec 6 18:45:33 1999 @@ -641,7 +641,6 @@ } } -#if 0 void set_blocksize(kdev_t dev, int size) { extern int *blksize_size[]; @@ -699,79 +698,6 @@ } } } - -#else -void set_blocksize(kdev_t dev, int size) -{ - extern int *blksize_size[]; - int i, nlist; - struct buffer_head * bh, *bhnext; - - if (!blksize_size[MAJOR(dev)]) - return; - - /* Size must be a power of two, and between 512 and PAGE_SIZE */ - if (size > PAGE_SIZE || size < 512 || (size & (size-1))) - panic("Invalid blocksize passed to set_blocksize"); - - if (blksize_size[MAJOR(dev)][MINOR(dev)] == 0 && size == BLOCK_SIZE) { - blksize_size[MAJOR(dev)][MINOR(dev)] = size; - return; - } - if (blksize_size[MAJOR(dev)][MINOR(dev)] == size) - return; - sync_buffers(dev, 2); - blksize_size[MAJOR(dev)][MINOR(dev)] = size; - - /* We need to be quite careful how we do this - we are moving entries - * around on the free list, and we can get in a loop if we are not careful. - */ - for(nlist = 0; nlist < NR_LIST; nlist++) { - bh = lru_list[nlist]; - for (i = nr_buffers_type[nlist]*2 ; --i > 0 ; bh = bhnext) { - if(!bh) - break; - - bhnext = bh->b_next_free; - if (bh->b_dev != dev) - continue; - if (bh->b_size == size) - continue; - if (bhnext) - bhnext->b_count++; - wait_on_buffer(bh); - if (bh->b_dev == dev && bh->b_size != size) { - clear_bit(BH_Dirty, &bh->b_state); - clear_bit(BH_Uptodate, &bh->b_state); - clear_bit(BH_Req, &bh->b_state); - bh->b_flushtime = 0; - } - - /* - * lets be mega-conservative about what to free: - */ - if (!(bh->b_dev != dev) && - !(bh->b_size == size) && - !bh->b_count && - !buffer_protected(bh) && - !buffer_dirty(bh) && - !buffer_locked(bh) && - !waitqueue_active(&bh->b_wait)) { - remove_from_hash_queue(bh); - bh->b_dev = NODEV; - refile_buffer(bh); - try_to_free_buffers(buffer_page(bh)); - } else { - remove_from_queues(bh); - bh->b_dev=B_FREE; - insert_into_queues(bh); - } - if (bhnext) - bhnext->b_count--; - } - } -} -#endif /* * This function knows that we do a linear pass over the whole array,