bitmap->daemon_lastrun = jiffies; 
static int bitmap_read_sb(struct bitmap *bitmap){	char *reason = NULL;	bitmap_super_t *sb;	unsigned long chunksize, daemon_sleep, write_behind;	unsigned long bytes_read;	unsigned long long events;	int err = -EINVAL;	/* page 0 is the superblock, read it... */	if (bitmap->file)		bitmap->sb_page = read_page(bitmap->file, 0, &bytes_read);	else {		bitmap->sb_page = read_sb_page(bitmap->mddev, bitmap->offset, 0);		bytes_read = PAGE_SIZE;	}	if (IS_ERR(bitmap->sb_page)) {		err = PTR_ERR(bitmap->sb_page);		bitmap->sb_page = NULL;		return err;	}	sb = (bitmap_super_t *)kmap(bitmap->sb_page);	if (bytes_read < sizeof(*sb)) { /* short read */		printk(KERN_INFO "%s: bitmap file superblock truncated\n",			bmname(bitmap));		err = -ENOSPC;		goto out;	}	chunksize = le32_to_cpu(sb->chunksize);	daemon_sleep = le32_to_cpu(sb->daemon_sleep);	write_behind = le32_to_cpu(sb->write_behind);	/* verify that the bitmap-specific fields are valid */	if (sb->magic != cpu_to_le32(BITMAP_MAGIC))		reason = "bad magic";	else if (sb->version != cpu_to_le32(BITMAP_MAJOR))		reason = "unrecognized superblock version";	else if (chunksize < 512 || chunksize > (1024 * 1024 * 4))		reason = "bitmap chunksize out of range (512B - 4MB)";	else if ((1 << ffz(~chunksize)) != chunksize)		reason = "bitmap chunksize not a power of 2";	else if (daemon_sleep < 1 || daemon_sleep > 15)		reason = "daemon sleep period out of range (1-15s)";	else if (write_behind > COUNTER_MAX)		reason = "write-behind limit out of range (0 - 16383)";	if (reason) {		printk(KERN_INFO "%s: invalid bitmap file superblock: %s\n",			bmname(bitmap), reason);		goto out;	}	/* keep the array size field of the bitmap superblock up to date */	sb->sync_size = cpu_to_le64(bitmap->mddev->resync_max_sectors);	if (!bitmap->mddev->persistent)		goto success;	/*	 * if we have a persistent array superblock, compare the	 * bitmap's UUID and event counter to the mddev's	 */	if (memcmp(sb->uuid, bitmap->mddev->uuid, 16)) {		printk(KERN_INFO "%s: bitmap superblock UUID mismatch\n",			bmname(bitmap));		goto out;	}	events = le64_to_cpu(sb->events);	if (events < bitmap->mddev->events) {		printk(KERN_INFO "%s: bitmap file is out of date (%llu < %llu) "			"-- forcing full recovery\n", bmname(bitmap), events,			(unsigned long long) bitmap->mddev->events);		sb->state |= BITMAP_STALE;	}success:	/* assign fields using values from superblock */	bitmap->chunksize = chunksize;	bitmap->daemon_sleep = daemon_sleep;	bitmap->max_write_behind = write_behind;	bitmap->flags |= sb->state;	bitmap->events_cleared = le64_to_cpu(sb->events_cleared);	if (sb->state & BITMAP_STALE)		bitmap->events_cleared = bitmap->mddev->events;	err = 0;out:	kunmap(bitmap->sb_page);	if (err)		bitmap_print_sb(bitmap);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/585f0dd5a955c420ff3af5193aa07d6f789bf81a/bitmap.c/clean/drivers/md/bitmap.c