Lines Matching refs:file
27 #include <linux/file.h>
134 * bitmap file handling - read and write the bitmap file and its superblock
279 * write out a page to a file
285 if (bitmap->storage.file == NULL) {
337 /* read a page from a file.
342 * to write to a file with no concerns of memory allocation failing.
344 static int read_page(struct file *file, unsigned long index,
350 struct inode *inode = file_inode(file);
355 pr_debug("read bitmap file (%dB @ %llu)\n", (int)PAGE_SIZE,
411 * bitmap file superblock operations
421 if (bitmap->storage.file)
472 /* print out the bitmap file superblock */
480 pr_debug("%s: bitmap file superblock:\n", bmname(bitmap));
570 /* read the superblock from the bitmap file and initialize some bitmap fields */
583 if (!bitmap->storage.file && !bitmap->mddev->bitmap_info.offset) {
613 if (bitmap->storage.file) {
614 loff_t isize = i_size_read(bitmap->storage.file->f_mapping->host);
617 err = read_page(bitmap->storage.file, 0,
651 pr_warn("%s: invalid bitmap file superblock: %s\n",
681 pr_warn("%s: bitmap file is out of date (%llu < %llu) -- forcing full recovery\n",
731 * general bitmap file operations
738 * file a page at a time. There's a superblock at the start of the file.
830 struct file *file;
832 file = store->file;
846 if (file) {
847 struct inode *inode = file_inode(file);
849 fput(file);
854 * bitmap_file_kick - if an error occurs while manipulating the bitmap file
855 * then it is no longer reliable, so we stop using it and we mark the file
865 if (bitmap->storage.file) {
868 ptr = file_path(bitmap->storage.file,
871 pr_warn("%s: kicking failed bitmap file %s from array!\n",
914 * to set (and eventually sync) a particular bit in the bitmap file
943 pr_debug("set file bit %lu page %lu\n", bit, page->index);
1000 * sync the dirty pages of the bitmap file to disk */
1040 * memory mapping of the bitmap file
1042 * if there's no bitmap file, or if the bitmap file had been
1054 struct file *file;
1062 file = store->file;
1064 if (!file && !bitmap->mddev->bitmap_info.offset) {
1081 pr_warn("%s: bitmap file is out of date, doing full recovery\n", bmname(bitmap));
1083 if (file && i_size_read(file->f_mapping->host) < store->bytes) {
1084 pr_warn("%s: bitmap file too short %lu < %lu\n",
1086 (unsigned long) i_size_read(file->f_mapping->host),
1111 if (file)
1112 ret = read_page(file, index, bitmap,
1182 if (bitmap->storage.file)
1252 /* Any file-page which is PENDING now needs to be written.
1689 /* dirty the memory and file bits for bitmap chunks "s" to "e" */
1755 /* release the bitmap file */
1817 struct file *file = mddev->bitmap_info.file;
1823 BUG_ON(file && mddev->bitmap_info.offset);
1852 bitmap->storage.file = file;
1853 if (file) {
1854 get_file(file);
1855 /* As future accesses to this file will use bmap,
1856 * and bypass the page cache, we must sync the file
1859 vfs_fsync(file, 1);
1861 /* read superblock from bitmap file (this sets mddev->bitmap_info.chunksize) */
2048 if (bitmap->storage.file) {
2049 seq_printf(seq, ", file: ");
2050 seq_file_path(seq, bitmap->storage.file, " \t\n");
2079 if (bitmap->storage.file && !init) {
2080 pr_info("md: cannot resize file-based bitmap\n");
2117 if (bitmap->mddev->bitmap_info.offset || bitmap->mddev->bitmap_info.file)
2139 store.file = bitmap->storage.file;
2140 bitmap->storage.file = NULL;
2268 if (mddev->bitmap_info.file)
2269 len = sprintf(page, "file");
2297 if (mddev->bitmap || mddev->bitmap_info.file ||
2310 if (mddev->bitmap_info.file) {
2311 struct file *f = mddev->bitmap_info.file;
2312 mddev->bitmap_info.file = NULL;
2320 else if (strncmp(buf, "file:", 5) == 0) {
2569 mddev->bitmap_info.file ||