Lines Matching full:if

21  * License along with this program; if not, write to the
72 if (!fp) in ocfs2_init_file_private()
88 if (fp) { in ocfs2_free_file_private()
107 if (file->f_mode & FMODE_WRITE) in ocfs2_file_open()
113 * node. If it hasn't then we're safe as long as we hold the in ocfs2_file_open()
115 if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_DELETED) { in ocfs2_file_open()
122 if (mode & O_DIRECT) in ocfs2_file_open()
129 if (status) { in ocfs2_file_open()
131 * We want to set open count back if we're failing the in ocfs2_file_open()
148 if (!--oi->ip_open_count) in ocfs2_file_release()
189 if (err) in ocfs2_sync_file()
198 if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) { in ocfs2_sync_file()
203 if (osb->s_mount_opt & OCFS2_MOUNT_BARRIER) in ocfs2_sync_file()
212 if (err) in ocfs2_sync_file()
225 if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) in ocfs2_should_update_atime()
228 if ((inode->i_flags & S_NOATIME) || in ocfs2_should_update_atime()
237 * if we can't tell whether this is a noatime mount, then we in ocfs2_should_update_atime()
240 if (vfsmnt == NULL) in ocfs2_should_update_atime()
243 if ((vfsmnt->mnt_flags & MNT_NOATIME) || in ocfs2_should_update_atime()
247 if (vfsmnt->mnt_flags & MNT_RELATIME) { in ocfs2_should_update_atime()
248 if ((timespec_compare(&inode->i_atime, &inode->i_mtime) <= 0) || in ocfs2_should_update_atime()
256 if ((now.tv_sec - inode->i_atime.tv_sec <= osb->s_atime_quantum)) in ocfs2_should_update_atime()
271 if (IS_ERR(handle)) { in ocfs2_update_inode_atime()
279 if (ret) { in ocfs2_update_inode_atime()
312 if (status < 0) { in ocfs2_set_inode_size()
330 if (IS_ERR(handle)) { in ocfs2_simple_size_update()
338 if (ret < 0) in ocfs2_simple_size_update()
356 * If the new offset is aligned to the range of the cluster, there is in ocfs2_cow_file_pos()
360 if ((offset & (OCFS2_SB(inode->i_sb)->s_clustersize - 1)) == 0) in ocfs2_cow_file_pos()
365 if (status) { in ocfs2_cow_file_pos()
370 if (!(ext_flags & OCFS2_EXT_REFCOUNTED)) in ocfs2_cow_file_pos()
390 * We need to CoW the cluster contains the offset if it is reflinked in ocfs2_orphan_for_truncate()
395 if (status) { in ocfs2_orphan_for_truncate()
404 if (IS_ERR(handle)) { in ocfs2_orphan_for_truncate()
412 if (status < 0) { in ocfs2_orphan_for_truncate()
423 if (status) { in ocfs2_orphan_for_truncate()
468 if (new_i_size > le64_to_cpu(fe->i_size)) { in ocfs2_truncate_file()
479 if (new_i_size == le64_to_cpu(fe->i_size)) in ocfs2_truncate_file()
489 * pages, which (correctly) happens even if we have a truncate in ocfs2_truncate_file()
497 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { in ocfs2_truncate_file()
500 if (status) in ocfs2_truncate_file()
508 * truncate if necessary. This does the task of marking in ocfs2_truncate_file()
511 if (status < 0) { in ocfs2_truncate_file()
517 if (status < 0) { in ocfs2_truncate_file()
527 if (!status && OCFS2_I(inode)->ip_clusters == 0) in ocfs2_truncate_file()
540 * Will return -EAGAIN, and a reason if a restart is needed.
541 * If passed in, *reason will always be set, even in error.
589 if (status < 0) { in __ocfs2_extend_allocation()
601 if (status) { in __ocfs2_extend_allocation()
609 if (IS_ERR(handle)) { in __ocfs2_extend_allocation()
625 if (status) in __ocfs2_extend_allocation()
629 /* reserve a write to the file entry early on - that we if we in __ocfs2_extend_allocation()
634 if (status < 0) { in __ocfs2_extend_allocation()
651 if ((status < 0) && (status != -EAGAIN)) { in __ocfs2_extend_allocation()
652 if (status != -ENOSPC) in __ocfs2_extend_allocation()
667 if (why != RESTART_NONE && clusters_to_add) { in __ocfs2_extend_allocation()
668 if (why == RESTART_META) { in __ocfs2_extend_allocation()
679 if (status < 0) { in __ocfs2_extend_allocation()
697 if (status < 0 && did_quota) in __ocfs2_extend_allocation()
700 if (handle) { in __ocfs2_extend_allocation()
704 if (data_ac) { in __ocfs2_extend_allocation()
708 if (meta_ac) { in __ocfs2_extend_allocation()
712 if ((!status) && restart_func) { in __ocfs2_extend_allocation()
732 if (!ocfs2_should_order_data(inode)) in ocfs2_zero_start_ordered_transaction()
736 if (IS_ERR(handle)) { in ocfs2_zero_start_ordered_transaction()
743 if (ret < 0) in ocfs2_zero_start_ordered_transaction()
747 if (ret) { in ocfs2_zero_start_ordered_transaction()
748 if (!IS_ERR(handle)) in ocfs2_zero_start_ordered_transaction()
773 if (!page) { in ocfs2_write_zero_page()
782 if (!zero_to) in ocfs2_write_zero_page()
803 if (ret < 0) { in ocfs2_write_zero_page()
808 if (!handle) { in ocfs2_write_zero_page()
810 if (IS_ERR(handle)) { in ocfs2_write_zero_page()
820 if (ret < 0) in ocfs2_write_zero_page()
826 if (handle) in ocfs2_write_zero_page()
844 * zero_start. If range_end is 0, there's nothing to do.
864 if (rc) { in ocfs2_zero_extend_get_range()
869 if (p_cpos && !(ext_flags & OCFS2_EXT_UNWRITTEN)) { in ocfs2_zero_extend_get_range()
871 if (ext_flags & OCFS2_EXT_REFCOUNTED) in ocfs2_zero_extend_get_range()
878 if (!zero_clusters) { in ocfs2_zero_extend_get_range()
887 if (rc) { in ocfs2_zero_extend_get_range()
892 if (!p_cpos || (ext_flags & OCFS2_EXT_UNWRITTEN)) in ocfs2_zero_extend_get_range()
894 if (ext_flags & OCFS2_EXT_REFCOUNTED) in ocfs2_zero_extend_get_range()
898 if ((zero_cpos + zero_clusters) > last_cpos) in ocfs2_zero_extend_get_range()
901 if (needs_cow) { in ocfs2_zero_extend_get_range()
904 if (rc) { in ocfs2_zero_extend_get_range()
937 if (next_pos > range_end) in ocfs2_zero_extend_range()
940 if (rc < 0) { in ocfs2_zero_extend_range()
972 if (ret) { in ocfs2_zero_extend()
976 if (!range_end) in ocfs2_zero_extend()
979 if (range_start < zero_start) in ocfs2_zero_extend()
981 if (range_end > zero_to_size) in ocfs2_zero_extend()
986 if (ret) { in ocfs2_zero_extend()
1011 if (clusters_to_add < oi->ip_clusters) in ocfs2_extend_no_holes()
1016 if (clusters_to_add) { in ocfs2_extend_no_holes()
1019 if (ret) { in ocfs2_extend_no_holes()
1026 * Call this even if we don't add any clusters to the tree. We in ocfs2_extend_no_holes()
1031 if (ret < 0) in ocfs2_extend_no_holes()
1048 if (new_i_size == 0) in ocfs2_extend_file()
1051 if (i_size_read(inode) == new_i_size) in ocfs2_extend_file()
1064 if (oi->ip_dyn_features & OCFS2_INLINE_DATA_FL) { in ocfs2_extend_file()
1069 if (ocfs2_size_fits_inline_data(di_bh, new_i_size)) { in ocfs2_extend_file()
1075 if (ret) { in ocfs2_extend_file()
1082 if (ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb))) in ocfs2_extend_file()
1090 if (ret < 0) { in ocfs2_extend_file()
1097 if (ret < 0) in ocfs2_extend_file()
1122 if (S_ISLNK(inode->i_mode)) in ocfs2_setattr()
1127 if (!(attr->ia_valid & OCFS2_VALID_ATTRS)) in ocfs2_setattr()
1131 if (status) in ocfs2_setattr()
1134 if (is_quota_modification(inode, attr)) in ocfs2_setattr()
1137 if (size_change) { in ocfs2_setattr()
1139 if (status < 0) { in ocfs2_setattr()
1146 if (status < 0) { in ocfs2_setattr()
1147 if (status != -ENOENT) in ocfs2_setattr()
1152 if (size_change && attr->ia_size != i_size_read(inode)) { in ocfs2_setattr()
1154 if (status) in ocfs2_setattr()
1159 if (i_size_read(inode) > attr->ia_size) { in ocfs2_setattr()
1160 if (ocfs2_should_order_data(inode)) { in ocfs2_setattr()
1163 if (status) in ocfs2_setattr()
1169 if (status < 0) { in ocfs2_setattr()
1170 if (status != -ENOSPC) in ocfs2_setattr()
1177 if ((attr->ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || in ocfs2_setattr()
1184 if (attr->ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid in ocfs2_setattr()
1189 if (!transfer_to[USRQUOTA]) { in ocfs2_setattr()
1194 if (attr->ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid in ocfs2_setattr()
1199 if (!transfer_to[GRPQUOTA]) { in ocfs2_setattr()
1206 if (IS_ERR(handle)) { in ocfs2_setattr()
1212 if (status < 0) in ocfs2_setattr()
1216 if (IS_ERR(handle)) { in ocfs2_setattr()
1232 if ((attr->ia_valid & ATTR_SIZE) && in ocfs2_setattr()
1235 if (status) { in ocfs2_setattr()
1245 if (status < 0) in ocfs2_setattr()
1253 if (size_change) in ocfs2_setattr()
1262 if (!status && attr->ia_valid & ATTR_MODE) { in ocfs2_setattr()
1264 if (status < 0) in ocfs2_setattr()
1281 if (err) { in ocfs2_getattr()
1282 if (err != -ENOENT) in ocfs2_getattr()
1300 if (mask & MAY_NOT_BLOCK) in ocfs2_permission()
1304 if (ret) { in ocfs2_permission()
1305 if (ret != -ENOENT) in ocfs2_permission()
1330 if (IS_ERR(handle)) { in __ocfs2_write_remove_suid()
1338 if (ret < 0) { in __ocfs2_write_remove_suid()
1344 if ((inode->i_mode & S_ISGID) && (inode->i_mode & S_IXGRP)) in __ocfs2_write_remove_suid()
1376 if (ret < 0) { in ocfs2_check_range_for_holes()
1381 if (phys_cpos == 0 || (extent_flags & OCFS2_EXT_UNWRITTEN)) { in ocfs2_check_range_for_holes()
1386 if (extent_len > clusters) in ocfs2_check_range_for_holes()
1402 if (ret < 0) { in ocfs2_write_remove_suid()
1426 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { in ocfs2_allocate_unwritten_extents()
1428 if (ret) { in ocfs2_allocate_unwritten_extents()
1434 * Nothing to do if the requested reservation range in ocfs2_allocate_unwritten_extents()
1437 if (ocfs2_size_fits_inline_data(di_bh, end)) in ocfs2_allocate_unwritten_extents()
1441 if (ret) { in ocfs2_allocate_unwritten_extents()
1457 if (ret) { in ocfs2_allocate_unwritten_extents()
1466 if (alloc_size > clusters) in ocfs2_allocate_unwritten_extents()
1469 if (phys_cpos) { in ocfs2_allocate_unwritten_extents()
1478 if (ret) { in ocfs2_allocate_unwritten_extents()
1479 if (ret != -ENOSPC) in ocfs2_allocate_unwritten_extents()
1511 if (start < end) { in ocfs2_truncate_cluster_pages()
1538 * If both edges are on a cluster boundary then there's no in ocfs2_zero_partial_clusters()
1542 if ((start & (csize - 1)) == 0 && (end & (csize - 1)) == 0) in ocfs2_zero_partial_clusters()
1546 if (IS_ERR(handle)) { in ocfs2_zero_partial_clusters()
1556 if (tmpend > end) in ocfs2_zero_partial_clusters()
1563 if (ret) in ocfs2_zero_partial_clusters()
1566 if (tmpend < end) { in ocfs2_zero_partial_clusters()
1578 if (ret) in ocfs2_zero_partial_clusters()
1596 if (le32_to_cpu(rec->e_cpos) < pos) in ocfs2_find_rec()
1623 if (le32_to_cpu(rec->e_cpos) >= trunc_start) { in ocfs2_calc_trunc_pos()
1629 * Skip holes if any. in ocfs2_calc_trunc_pos()
1631 if (range < *trunc_end) in ocfs2_calc_trunc_pos()
1636 } else if (range > trunc_start) { in ocfs2_calc_trunc_pos()
1643 * skip hole if any. in ocfs2_calc_trunc_pos()
1645 if (range < *trunc_end) in ocfs2_calc_trunc_pos()
1692 if (byte_len == 0) in ocfs2_remove_inode_range()
1695 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { in ocfs2_remove_inode_range()
1698 if (ret) { in ocfs2_remove_inode_range()
1715 * partially zero'd later, if hole's start and end offset were in ocfs2_remove_inode_range()
1719 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_HAS_REFCOUNT_FL) { in ocfs2_remove_inode_range()
1722 if (ret) { in ocfs2_remove_inode_range()
1728 if (ret) { in ocfs2_remove_inode_range()
1739 if (ret) { in ocfs2_remove_inode_range()
1745 if (!path) { in ocfs2_remove_inode_range()
1755 if (ret) { in ocfs2_remove_inode_range()
1766 if (i < 0) { in ocfs2_remove_inode_range()
1767 if (path->p_tree_depth == 0) in ocfs2_remove_inode_range()
1773 if (ret) { in ocfs2_remove_inode_range()
1782 if (cluster_in_el == 0) in ocfs2_remove_inode_range()
1800 if (done) in ocfs2_remove_inode_range()
1809 if (ret < 0) { in ocfs2_remove_inode_range()
1844 if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) in __ocfs2_change_file_space()
1853 if (ret) { in __ocfs2_change_file_space()
1859 if (ret) { in __ocfs2_change_file_space()
1864 if (inode->i_flags & (S_IMMUTABLE|S_APPEND)) { in __ocfs2_change_file_space()
1886 if (sr->l_start < 0 in __ocfs2_change_file_space()
1895 if (cmd == OCFS2_IOC_RESVSP || cmd == OCFS2_IOC_RESVSP64) { in __ocfs2_change_file_space()
1896 if (sr->l_len <= 0) { in __ocfs2_change_file_space()
1902 if (file && should_remove_suid(file->f_path.dentry)) { in __ocfs2_change_file_space()
1904 if (ret) { in __ocfs2_change_file_space()
1930 if (ret) { in __ocfs2_change_file_space()
1939 if (IS_ERR(handle)) { in __ocfs2_change_file_space()
1945 if (change_size && i_size_read(inode) < size) in __ocfs2_change_file_space()
1950 if (ret < 0) in __ocfs2_change_file_space()
1953 if (file->f_flags & O_SYNC) in __ocfs2_change_file_space()
1975 if ((cmd == OCFS2_IOC_RESVSP || cmd == OCFS2_IOC_RESVSP64) && in ocfs2_change_file_space()
1978 else if ((cmd == OCFS2_IOC_UNRESVSP || cmd == OCFS2_IOC_UNRESVSP64) && in ocfs2_change_file_space()
1982 if (!S_ISREG(inode->i_mode)) in ocfs2_change_file_space()
1985 if (!(file->f_mode & FMODE_WRITE)) in ocfs2_change_file_space()
2000 if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE)) in ocfs2_fallocate()
2002 if (!ocfs2_writes_unwritten_extents(osb)) in ocfs2_fallocate()
2005 if (mode & FALLOC_FL_KEEP_SIZE) in ocfs2_fallocate()
2008 if (mode & FALLOC_FL_PUNCH_HOLE) in ocfs2_fallocate()
2027 if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb)) || in ocfs2_check_range_for_refcount()
2038 if (ret < 0) { in ocfs2_check_range_for_refcount()
2043 if (phys_cpos && (extent_flags & OCFS2_EXT_REFCOUNTED)) { in ocfs2_check_range_for_refcount()
2048 if (extent_len > clusters) in ocfs2_check_range_for_refcount()
2070 if ((pos & blockmask) || (final_size & blockmask)) in ocfs2_is_io_unaligned()
2087 if (ret) { in ocfs2_prepare_inode_for_refcount()
2095 if (ret) in ocfs2_prepare_inode_for_refcount()
2116 * if we need to make modifications here. in ocfs2_prepare_inode_for_write()
2120 if (ret < 0) { in ocfs2_prepare_inode_for_write()
2126 /* Clear suid / sgid if necessary. We do this here in ocfs2_prepare_inode_for_write()
2135 if (should_remove_suid(dentry)) { in ocfs2_prepare_inode_for_write()
2136 if (meta_level == 0) { in ocfs2_prepare_inode_for_write()
2143 if (ret < 0) { in ocfs2_prepare_inode_for_write()
2151 if (appending) in ocfs2_prepare_inode_for_write()
2159 if (ret == 1) { in ocfs2_prepare_inode_for_write()
2168 if (has_refcount) in ocfs2_prepare_inode_for_write()
2170 if (direct_io) in ocfs2_prepare_inode_for_write()
2174 if (ret < 0) { in ocfs2_prepare_inode_for_write()
2180 * Skip the O_DIRECT checks if we don't need in ocfs2_prepare_inode_for_write()
2183 if (!direct_io || !(*direct_io)) in ocfs2_prepare_inode_for_write()
2190 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { in ocfs2_prepare_inode_for_write()
2201 if (end > i_size_read(inode)) { in ocfs2_prepare_inode_for_write()
2208 * check for them here. If any are found, the in ocfs2_prepare_inode_for_write()
2213 if (ret == 1) { in ocfs2_prepare_inode_for_write()
2216 } else if (ret < 0) in ocfs2_prepare_inode_for_write()
2221 if (appending) in ocfs2_prepare_inode_for_write()
2229 if (meta_level >= 0) in ocfs2_prepare_inode_for_write()
2261 if (iocb->ki_left == 0) in ocfs2_file_aio_write()
2275 if (direct_io) { in ocfs2_file_aio_write()
2288 if (ret < 0) { in ocfs2_file_aio_write()
2297 if (direct_io && full_coherency) { in ocfs2_file_aio_write()
2304 if (ret < 0) { in ocfs2_file_aio_write()
2316 if (ret < 0) { in ocfs2_file_aio_write()
2321 if (direct_io && !is_sync_kiocb(iocb)) in ocfs2_file_aio_write()
2329 if (direct_io && !can_do_direct) { in ocfs2_file_aio_write()
2339 if (unaligned_dio) { in ocfs2_file_aio_write()
2363 if (ret) in ocfs2_file_aio_write()
2369 if (ret) in ocfs2_file_aio_write()
2372 if (direct_io) { in ocfs2_file_aio_write()
2375 if (written < 0) { in ocfs2_file_aio_write()
2390 if (((file->f_flags & O_DSYNC) && !direct_io) || IS_SYNC(inode) || in ocfs2_file_aio_write()
2394 if (ret < 0) in ocfs2_file_aio_write()
2397 if (!ret && ((old_size != i_size_read(inode)) || in ocfs2_file_aio_write()
2401 if (ret < 0) in ocfs2_file_aio_write()
2405 if (!ret) in ocfs2_file_aio_write()
2415 * that don't. so we don't have to unlock the rw_lock if either an in ocfs2_file_aio_write()
2419 if ((ret == -EIOCBQUEUED) || (!ocfs2_iocb_is_rw_locked(iocb))) { in ocfs2_file_aio_write()
2425 if (unaligned_dio) in ocfs2_file_aio_write()
2429 if (rw_level != -1) in ocfs2_file_aio_write()
2433 if (have_alloc_sem) in ocfs2_file_aio_write()
2438 if (written) in ocfs2_file_aio_write()
2451 if (ret < 0) { in ocfs2_splice_to_file()
2481 if (pipe->inode) in ocfs2_file_splice_write()
2487 if (ret <= 0) in ocfs2_file_splice_write()
2492 if (ret < 0) in ocfs2_file_splice_write()
2502 if (pipe->inode) in ocfs2_file_splice_write()
2505 if (sd.num_spliced) in ocfs2_file_splice_write()
2508 if (ret > 0) { in ocfs2_file_splice_write()
2515 if (err) in ocfs2_file_splice_write()
2544 if (ret < 0) { in ocfs2_file_splice_read()
2571 if (!inode) { in ocfs2_file_aio_read()
2583 if (filp->f_flags & O_DIRECT) { in ocfs2_file_aio_read()
2588 if (ret < 0) { in ocfs2_file_aio_read()
2607 if (ret < 0) { in ocfs2_file_aio_read()
2620 if (ret == -EIOCBQUEUED || !ocfs2_iocb_is_rw_locked(iocb)) { in ocfs2_file_aio_read()
2626 if (have_alloc_sem) in ocfs2_file_aio_read()
2629 if (rw_level != -1) in ocfs2_file_aio_read()
2650 if (offset == 0) { in ocfs2_file_llseek()
2659 if (ret) in ocfs2_file_llseek()
2667 if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET)) in ocfs2_file_llseek()
2669 if (!ret && offset > inode->i_sb->s_maxbytes) in ocfs2_file_llseek()
2671 if (ret) in ocfs2_file_llseek()
2674 if (offset != file->f_pos) { in ocfs2_file_llseek()
2681 if (ret) in ocfs2_file_llseek()
2748 * These will be used if the underlying cluster stack does not support
2749 * posix file locking, if the user passes the "localflocks" mount
2750 * option, or if we have a local-only fs.