inode.c (5e2aa2ed08e2e280121dc7cf5609c87d464f12ef) | inode.c (56d7acc792c0d98f38f22058671ee715ff197023) |
---|---|
1/* 2 * inode.c - NILFS inode operations. 3 * 4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 10 unchanged lines hidden (view full) --- 19 * 20 * Written by Ryusuke Konishi <ryusuke@osrg.net> 21 * 22 */ 23 24#include <linux/buffer_head.h> 25#include <linux/gfp.h> 26#include <linux/mpage.h> | 1/* 2 * inode.c - NILFS inode operations. 3 * 4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 10 unchanged lines hidden (view full) --- 19 * 20 * Written by Ryusuke Konishi <ryusuke@osrg.net> 21 * 22 */ 23 24#include <linux/buffer_head.h> 25#include <linux/gfp.h> 26#include <linux/mpage.h> |
27#include <linux/pagemap.h> |
|
27#include <linux/writeback.h> 28#include <linux/aio.h> 29#include "nilfs.h" 30#include "btnode.h" 31#include "segment.h" 32#include "page.h" 33#include "mdt.h" 34#include "cpfile.h" --- 179 unchanged lines hidden (view full) --- 214 } else if (wbc->for_reclaim) 215 nilfs_flush_segment(inode->i_sb, inode->i_ino); 216 217 return 0; 218} 219 220static int nilfs_set_page_dirty(struct page *page) 221{ | 28#include <linux/writeback.h> 29#include <linux/aio.h> 30#include "nilfs.h" 31#include "btnode.h" 32#include "segment.h" 33#include "page.h" 34#include "mdt.h" 35#include "cpfile.h" --- 179 unchanged lines hidden (view full) --- 215 } else if (wbc->for_reclaim) 216 nilfs_flush_segment(inode->i_sb, inode->i_ino); 217 218 return 0; 219} 220 221static int nilfs_set_page_dirty(struct page *page) 222{ |
223 struct inode *inode = page->mapping->host; |
|
222 int ret = __set_page_dirty_nobuffers(page); 223 224 if (page_has_buffers(page)) { | 224 int ret = __set_page_dirty_nobuffers(page); 225 226 if (page_has_buffers(page)) { |
225 struct inode *inode = page->mapping->host; | |
226 unsigned nr_dirty = 0; 227 struct buffer_head *bh, *head; 228 229 /* 230 * This page is locked by callers, and no other thread 231 * concurrently marks its buffers dirty since they are 232 * only dirtied through routines in fs/buffer.c in 233 * which call sites of mark_buffer_dirty are protected --- 6 unchanged lines hidden (view full) --- 240 continue; 241 242 set_buffer_dirty(bh); 243 nr_dirty++; 244 } while (bh = bh->b_this_page, bh != head); 245 246 if (nr_dirty) 247 nilfs_set_file_dirty(inode, nr_dirty); | 227 unsigned nr_dirty = 0; 228 struct buffer_head *bh, *head; 229 230 /* 231 * This page is locked by callers, and no other thread 232 * concurrently marks its buffers dirty since they are 233 * only dirtied through routines in fs/buffer.c in 234 * which call sites of mark_buffer_dirty are protected --- 6 unchanged lines hidden (view full) --- 241 continue; 242 243 set_buffer_dirty(bh); 244 nr_dirty++; 245 } while (bh = bh->b_this_page, bh != head); 246 247 if (nr_dirty) 248 nilfs_set_file_dirty(inode, nr_dirty); |
249 } else if (ret) { 250 unsigned nr_dirty = 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits); 251 252 nilfs_set_file_dirty(inode, nr_dirty); |
|
248 } 249 return ret; 250} 251 252void nilfs_write_failed(struct address_space *mapping, loff_t to) 253{ 254 struct inode *inode = mapping->host; 255 --- 859 unchanged lines hidden --- | 253 } 254 return ret; 255} 256 257void nilfs_write_failed(struct address_space *mapping, loff_t to) 258{ 259 struct inode *inode = mapping->host; 260 --- 859 unchanged lines hidden --- |