file.c (0cce284537fb42d9c28b9b31038ffc9b464555f5) | file.c (26a28a0c1eb756ba18bfb1f93309c4b4406b9cd9) |
---|---|
1/* 2 * fs/f2fs/file.c 3 * 4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 5 * http://www.samsung.com/ 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 1528 unchanged lines hidden (view full) --- 1537 1538 f2fs_msg(F2FS_I_SB(inode)->sb, KERN_WARNING, 1539 "Unexpected flush for atomic writes: ino=%lu, npages=%u", 1540 inode->i_ino, get_dirty_pages(inode)); 1541 ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX); 1542 if (ret) 1543 clear_inode_flag(inode, FI_ATOMIC_FILE); 1544out: | 1/* 2 * fs/f2fs/file.c 3 * 4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 5 * http://www.samsung.com/ 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 1528 unchanged lines hidden (view full) --- 1537 1538 f2fs_msg(F2FS_I_SB(inode)->sb, KERN_WARNING, 1539 "Unexpected flush for atomic writes: ino=%lu, npages=%u", 1540 inode->i_ino, get_dirty_pages(inode)); 1541 ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX); 1542 if (ret) 1543 clear_inode_flag(inode, FI_ATOMIC_FILE); 1544out: |
1545 stat_inc_atomic_write(inode); 1546 stat_update_max_atomic_write(inode); |
|
1545 inode_unlock(inode); 1546 mnt_drop_write_file(filp); 1547 return ret; 1548} 1549 1550static int f2fs_ioc_commit_atomic_write(struct file *filp) 1551{ 1552 struct inode *inode = file_inode(filp); --- 13 unchanged lines hidden (view full) --- 1566 1567 if (f2fs_is_atomic_file(inode)) { 1568 clear_inode_flag(inode, FI_ATOMIC_FILE); 1569 ret = commit_inmem_pages(inode); 1570 if (ret) { 1571 set_inode_flag(inode, FI_ATOMIC_FILE); 1572 goto err_out; 1573 } | 1547 inode_unlock(inode); 1548 mnt_drop_write_file(filp); 1549 return ret; 1550} 1551 1552static int f2fs_ioc_commit_atomic_write(struct file *filp) 1553{ 1554 struct inode *inode = file_inode(filp); --- 13 unchanged lines hidden (view full) --- 1568 1569 if (f2fs_is_atomic_file(inode)) { 1570 clear_inode_flag(inode, FI_ATOMIC_FILE); 1571 ret = commit_inmem_pages(inode); 1572 if (ret) { 1573 set_inode_flag(inode, FI_ATOMIC_FILE); 1574 goto err_out; 1575 } |
1576 ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true); 1577 stat_dec_atomic_write(inode); 1578 } else { 1579 ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true); |
|
1574 } | 1580 } |
1575 1576 ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true); | |
1577err_out: 1578 inode_unlock(inode); 1579 mnt_drop_write_file(filp); 1580 return ret; 1581} 1582 1583static int f2fs_ioc_start_volatile_write(struct file *filp) 1584{ --- 737 unchanged lines hidden --- | 1581err_out: 1582 inode_unlock(inode); 1583 mnt_drop_write_file(filp); 1584 return ret; 1585} 1586 1587static int f2fs_ioc_start_volatile_write(struct file *filp) 1588{ --- 737 unchanged lines hidden --- |