Lines Matching refs:inode
39 #include "inode.h"
54 static int ocfs2_init_file_private(struct inode *inode, struct file *file)
70 static void ocfs2_free_file_private(struct inode *inode, struct file *file)
73 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
83 static int ocfs2_file_open(struct inode *inode, struct file *file)
87 struct ocfs2_inode_info *oi = OCFS2_I(inode);
89 trace_ocfs2_file_open(inode, file, file->f_path.dentry,
95 status = dquot_initialize(inode);
102 /* Check that the inode hasn't been wiped from disk by another
118 status = ocfs2_init_file_private(inode, file);
135 static int ocfs2_file_release(struct inode *inode, struct file *file)
137 struct ocfs2_inode_info *oi = OCFS2_I(inode);
143 trace_ocfs2_file_release(inode, file, file->f_path.dentry,
150 ocfs2_free_file_private(inode, file);
155 static int ocfs2_dir_open(struct inode *inode, struct file *file)
157 return ocfs2_init_file_private(inode, file);
160 static int ocfs2_dir_release(struct inode *inode, struct file *file)
162 ocfs2_free_file_private(inode, file);
170 struct inode *inode = file->f_mapping->host;
171 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
172 struct ocfs2_inode_info *oi = OCFS2_I(inode);
178 trace_ocfs2_sync_file(inode, file, file->f_path.dentry,
197 ret = blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL);
208 int ocfs2_should_update_atime(struct inode *inode,
212 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
217 if ((inode->i_flags & S_NOATIME) ||
218 ((inode->i_sb->s_flags & SB_NODIRATIME) && S_ISDIR(inode->i_mode)))
233 ((vfsmnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode)))
237 if ((timespec64_compare(&inode->i_atime, &inode->i_mtime) <= 0) ||
238 (timespec64_compare(&inode->i_atime, &inode->i_ctime) <= 0))
244 now = current_time(inode);
245 if ((now.tv_sec - inode->i_atime.tv_sec <= osb->s_atime_quantum))
251 int ocfs2_update_inode_atime(struct inode *inode,
255 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
266 ret = ocfs2_journal_access_di(handle, INODE_CACHE(inode), bh,
276 * inode fields.
278 inode->i_atime = current_time(inode);
279 di->i_atime = cpu_to_le64(inode->i_atime.tv_sec);
280 di->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec);
281 ocfs2_update_inode_fsync_trans(handle, inode, 0);
291 struct inode *inode,
297 i_size_write(inode, new_i_size);
298 inode->i_blocks = ocfs2_inode_sector_count(inode);
299 inode->i_ctime = inode->i_mtime = current_time(inode);
301 status = ocfs2_mark_inode_dirty(handle, inode, fe_bh);
311 int ocfs2_simple_size_update(struct inode *inode,
316 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
326 ret = ocfs2_set_inode_size(handle, inode, di_bh,
331 ocfs2_update_inode_fsync_trans(handle, inode, 0);
337 static int ocfs2_cow_file_pos(struct inode *inode,
342 u32 phys, cpos = offset >> OCFS2_SB(inode->i_sb)->s_clustersize_bits;
351 if ((offset & (OCFS2_SB(inode->i_sb)->s_clustersize - 1)) == 0)
354 status = ocfs2_get_clusters(inode, cpos, &phys,
364 return ocfs2_refcount_cow(inode, fe_bh, cpos, 1, cpos+1);
371 struct inode *inode,
385 status = ocfs2_cow_file_pos(inode, fe_bh, new_i_size);
391 /* TODO: This needs to actually orphan the inode in this
401 status = ocfs2_journal_access_di(handle, INODE_CACHE(inode), fe_bh,
411 cluster_bytes = ocfs2_align_bytes_to_clusters(inode->i_sb, new_i_size);
412 status = ocfs2_zero_range_for_truncate(inode, handle, new_i_size,
419 i_size_write(inode, new_i_size);
420 inode->i_ctime = inode->i_mtime = current_time(inode);
424 di->i_ctime = di->i_mtime = cpu_to_le64(inode->i_ctime.tv_sec);
425 di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec);
426 ocfs2_update_inode_fsync_trans(handle, inode, 0);
436 int ocfs2_truncate_file(struct inode *inode,
442 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
448 trace_ocfs2_truncate_file((unsigned long long)OCFS2_I(inode)->ip_blkno,
452 mlog_bug_on_msg(le64_to_cpu(fe->i_size) != i_size_read(inode),
453 "Inode %llu, inode i_size = %lld != di "
455 (unsigned long long)OCFS2_I(inode)->ip_blkno,
456 i_size_read(inode),
469 down_write(&OCFS2_I(inode)->ip_alloc_sem);
472 &OCFS2_I(inode)->ip_la_data_resv);
475 * The inode lock forced other nodes to sync and drop their
482 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
483 unmap_mapping_range(inode->i_mapping,
485 truncate_inode_pages(inode->i_mapping, new_i_size);
486 status = ocfs2_truncate_inline(inode, di_bh, new_i_size,
487 i_size_read(inode), 1);
495 * change. Orphan the inode so that recovery can complete the
498 status = ocfs2_orphan_for_truncate(osb, inode, di_bh, new_i_size);
504 unmap_mapping_range(inode->i_mapping, new_i_size + PAGE_SIZE - 1, 0, 1);
505 truncate_inode_pages(inode->i_mapping, new_i_size);
507 status = ocfs2_commit_truncate(osb, inode, di_bh);
515 up_write(&OCFS2_I(inode)->ip_alloc_sem);
518 if (!status && OCFS2_I(inode)->ip_clusters == 0)
519 status = ocfs2_try_remove_refcount_tree(inode, di_bh);
535 struct inode *inode,
548 ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), fe_bh);
556 static int ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
569 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
579 status = ocfs2_read_inode_block(inode, &bh);
587 BUG_ON(le32_to_cpu(fe->i_clusters) != OCFS2_I(inode)->ip_clusters);
589 ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), bh);
590 status = ocfs2_lock_allocators(inode, &et, clusters_to_add, 0,
608 (unsigned long long)OCFS2_I(inode)->ip_blkno,
609 (unsigned long long)i_size_read(inode),
613 status = dquot_alloc_space_nodirty(inode,
622 status = ocfs2_journal_access_di(handle, INODE_CACHE(inode), bh,
629 prev_clusters = OCFS2_I(inode)->ip_clusters;
632 inode,
646 ocfs2_update_inode_fsync_trans(handle, inode, 1);
649 spin_lock(&OCFS2_I(inode)->ip_lock);
650 clusters_to_add -= (OCFS2_I(inode)->ip_clusters - prev_clusters);
651 spin_unlock(&OCFS2_I(inode)->ip_lock);
653 dquot_free_space(inode,
676 trace_ocfs2_extend_allocation_end(OCFS2_I(inode)->ip_blkno,
679 OCFS2_I(inode)->ip_clusters,
680 (unsigned long long)i_size_read(inode));
684 dquot_free_space(inode,
712 static handle_t *ocfs2_zero_start_ordered_transaction(struct inode *inode,
717 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
721 if (!ocfs2_should_order_data(inode))
731 ret = ocfs2_jbd2_inode_add_write(handle, inode, start_byte, length);
737 ret = ocfs2_journal_access_di(handle, INODE_CACHE(inode), di_bh,
741 ocfs2_update_inode_fsync_trans(handle, inode, 1);
755 static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from,
758 struct address_space *mapping = inode->i_mapping;
768 BUG_ON(abs_from & (inode->i_blkbits - 1));
770 handle = ocfs2_zero_start_ordered_transaction(inode, di_bh,
792 (unsigned long long)OCFS2_I(inode)->ip_blkno,
800 block_end = block_start + i_blocksize(inode);
826 * whose offset are over inode size, the release happens at
829 i_size_write(inode, abs_to);
830 inode->i_blocks = ocfs2_inode_sector_count(inode);
831 di->i_size = cpu_to_le64((u64)i_size_read(inode));
832 inode->i_mtime = inode->i_ctime = current_time(inode);
833 di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec);
834 di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec);
838 ocfs2_update_inode_fsync_trans(handle, inode, 1);
846 ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle);
863 static int ocfs2_zero_extend_get_range(struct inode *inode,
871 zero_start >> OCFS2_SB(inode->i_sb)->s_clustersize_bits;
872 u32 last_cpos = ocfs2_clusters_for_bytes(inode->i_sb, zero_end);
877 rc = ocfs2_get_clusters(inode, zero_cpos, &p_cpos,
899 rc = ocfs2_get_clusters(inode, zero_cpos + zero_clusters,
917 rc = ocfs2_refcount_cow(inode, di_bh, zero_cpos,
925 *range_start = ocfs2_clusters_to_bytes(inode->i_sb, zero_cpos);
926 *range_end = ocfs2_clusters_to_bytes(inode->i_sb,
937 static int ocfs2_zero_extend_range(struct inode *inode, u64 range_start,
945 (unsigned long long)OCFS2_I(inode)->ip_blkno,
954 rc = ocfs2_write_zero_page(inode, zero_pos, next_pos, di_bh);
971 int ocfs2_zero_extend(struct inode *inode, struct buffer_head *di_bh,
976 struct super_block *sb = inode->i_sb;
978 zero_start = ocfs2_align_bytes_to_blocks(sb, i_size_read(inode));
979 trace_ocfs2_zero_extend((unsigned long long)OCFS2_I(inode)->ip_blkno,
981 (unsigned long long)i_size_read(inode));
983 ret = ocfs2_zero_extend_get_range(inode, di_bh, zero_start,
999 ret = ocfs2_zero_extend_range(inode, range_start,
1011 int ocfs2_extend_no_holes(struct inode *inode, struct buffer_head *di_bh,
1016 struct ocfs2_inode_info *oi = OCFS2_I(inode);
1022 BUG_ON(!di_bh && ocfs2_is_refcount_inode(inode));
1025 clusters_to_add = ocfs2_clusters_for_bytes(inode->i_sb, new_i_size);
1032 ret = ocfs2_extend_allocation(inode, oi->ip_clusters,
1045 ret = ocfs2_zero_extend(inode, di_bh, zero_to);
1053 static int ocfs2_extend_file(struct inode *inode,
1058 struct ocfs2_inode_info *oi = OCFS2_I(inode);
1066 if (i_size_read(inode) == new_i_size)
1068 BUG_ON(new_i_size < i_size_read(inode));
1089 ret = ocfs2_convert_inline_data_to_extents(inode, di_bh);
1097 if (ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb)))
1098 ret = ocfs2_zero_extend(inode, di_bh, new_i_size);
1100 ret = ocfs2_extend_no_holes(inode, di_bh, new_i_size,
1111 ret = ocfs2_simple_size_update(inode, di_bh, new_i_size);
1123 struct inode *inode = d_inode(dentry);
1124 struct super_block *sb = inode->i_sb;
1133 trace_ocfs2_setattr(inode, dentry,
1134 (unsigned long long)OCFS2_I(inode)->ip_blkno,
1141 if (S_ISLNK(inode->i_mode))
1153 if (is_quota_modification(inode, attr)) {
1154 status = dquot_initialize(inode);
1158 size_change = S_ISREG(inode->i_mode) && attr->ia_valid & ATTR_SIZE;
1161 * Here we should wait dio to finish before inode lock
1165 inode_dio_wait(inode);
1167 status = ocfs2_rw_lock(inode, 1);
1174 had_lock = ocfs2_inode_lock_tracker(inode, &bh, 1, &oh);
1202 status = inode_newsize_ok(inode, attr->ia_size);
1206 if (i_size_read(inode) >= attr->ia_size) {
1207 if (ocfs2_should_order_data(inode)) {
1208 status = ocfs2_begin_ordered_truncate(inode,
1213 status = ocfs2_truncate_file(inode, bh, attr->ia_size);
1215 status = ocfs2_extend_file(inode, bh, attr->ia_size);
1224 if ((attr->ia_valid & ATTR_UID && !uid_eq(attr->ia_uid, inode->i_uid)) ||
1225 (attr->ia_valid & ATTR_GID && !gid_eq(attr->ia_gid, inode->i_gid))) {
1231 if (attr->ia_valid & ATTR_UID && !uid_eq(attr->ia_uid, inode->i_uid)
1241 if (attr->ia_valid & ATTR_GID && !gid_eq(attr->ia_gid, inode->i_gid)
1251 down_write(&OCFS2_I(inode)->ip_alloc_sem);
1259 status = __dquot_transfer(inode, transfer_to);
1263 down_write(&OCFS2_I(inode)->ip_alloc_sem);
1272 setattr_copy(inode, attr);
1273 mark_inode_dirty(inode);
1275 status = ocfs2_mark_inode_dirty(handle, inode, bh);
1282 up_write(&OCFS2_I(inode)->ip_alloc_sem);
1285 ocfs2_inode_unlock_tracker(inode, 1, &oh, had_lock);
1290 ocfs2_rw_unlock(inode, 1);
1298 status = ocfs2_acl_chmod(inode, bh);
1303 ocfs2_inode_unlock_tracker(inode, 1, &oh, had_lock);
1312 struct inode *inode = d_inode(path->dentry);
1324 generic_fillattr(inode, stat);
1326 * If there is inline data in the inode, the inode will normally not
1331 if (unlikely(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL))
1341 int ocfs2_permission(struct inode *inode, int mask)
1349 had_lock = ocfs2_inode_lock_tracker(inode, NULL, 0, &oh);
1366 ret = generic_permission(inode, mask);
1368 ocfs2_inode_unlock_tracker(inode, 0, &oh, had_lock);
1373 static int __ocfs2_write_remove_suid(struct inode *inode,
1378 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1382 (unsigned long long)OCFS2_I(inode)->ip_blkno,
1383 inode->i_mode);
1392 ret = ocfs2_journal_access_di(handle, INODE_CACHE(inode), bh,
1399 inode->i_mode &= ~S_ISUID;
1400 if ((inode->i_mode & S_ISGID) && (inode->i_mode & S_IXGRP))
1401 inode->i_mode &= ~S_ISGID;
1404 di->i_mode = cpu_to_le16(inode->i_mode);
1405 ocfs2_update_inode_fsync_trans(handle, inode, 0);
1415 static int ocfs2_write_remove_suid(struct inode *inode)
1420 ret = ocfs2_read_inode_block(inode, &bh);
1426 ret = __ocfs2_write_remove_suid(inode, bh);
1437 static int ocfs2_allocate_unwritten_extents(struct inode *inode,
1445 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
1446 ret = ocfs2_read_inode_block(inode, &di_bh);
1454 * fits within the inode.
1459 ret = ocfs2_convert_inline_data_to_extents(inode, di_bh);
1469 cpos = start >> OCFS2_SB(inode->i_sb)->s_clustersize_bits;
1470 clusters = ocfs2_clusters_for_bytes(inode->i_sb, start + len);
1474 ret = ocfs2_get_clusters(inode, cpos, &phys_cpos,
1496 ret = ocfs2_extend_allocation(inode, cpos, alloc_size, 1);
1519 static void ocfs2_truncate_cluster_pages(struct inode *inode, u64 byte_start,
1522 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1524 struct address_space *mapping = inode->i_mapping;
1526 start = (loff_t)ocfs2_align_bytes_to_clusters(inode->i_sb, byte_start);
1543 static int ocfs2_zeroout_partial_cluster(struct inode *inode,
1550 struct super_block *sb = inode->i_sb;
1563 ret = ocfs2_get_clusters(inode, cluster, &p_cluster,
1575 static int ocfs2_zero_partial_clusters(struct inode *inode,
1581 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1584 loff_t isize = i_size_read(inode);
1594 (unsigned long long)OCFS2_I(inode)->ip_blkno,
1615 ret = ocfs2_zeroout_partial_cluster(inode, isize,
1653 ret = ocfs2_zero_range_for_truncate(inode, handle, start,
1670 ret = ocfs2_zero_range_for_truncate(inode, handle, start, end);
1674 ocfs2_update_inode_fsync_trans(handle, inode, 1);
1705 static void ocfs2_calc_trunc_pos(struct inode *inode,
1744 ocfs2_clusters_to_blocks(inode->i_sb, coff);
1761 int ocfs2_remove_inode_range(struct inode *inode,
1768 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1770 struct address_space *mapping = inode->i_mapping;
1778 ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh);
1782 (unsigned long long)OCFS2_I(inode)->ip_blkno,
1789 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
1790 ret = ocfs2_truncate_inline(inode, di_bh, byte_start,
1798 * truncate of an inline-data inode. We're talking
1813 if (ocfs2_is_refcount_inode(inode)) {
1814 ret = ocfs2_cow_file_pos(inode, di_bh, byte_start);
1820 ret = ocfs2_cow_file_pos(inode, di_bh, byte_start + byte_len);
1831 ret = ocfs2_zero_partial_clusters(inode, byte_start, byte_len);
1846 ret = ocfs2_find_path(INODE_CACHE(inode), path,
1863 ret = ocfs2_find_cpos_for_left_leaf(inode->i_sb,
1891 ocfs2_calc_trunc_pos(inode, el, rec, trunc_start, &trunc_cpos,
1897 phys_cpos = ocfs2_blocks_to_clusters(inode->i_sb, blkno);
1899 ret = ocfs2_remove_btree_range(inode, &et, trunc_cpos,
1912 ocfs2_truncate_cluster_pages(inode, byte_start, byte_len);
1925 static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
1933 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1936 unsigned long long max_off = inode->i_sb->s_maxbytes;
1941 inode_lock(inode);
1946 ret = ocfs2_rw_lock(inode, 1);
1952 ret = ocfs2_inode_lock(inode, &di_bh, 1);
1958 if (inode->i_flags & (S_IMMUTABLE|S_APPEND)) {
1970 sr->l_start += i_size_read(inode);
1998 ret = __ocfs2_write_remove_suid(inode, di_bh);
2005 down_write(&OCFS2_I(inode)->ip_alloc_sem);
2013 ret = ocfs2_allocate_unwritten_extents(inode, sr->l_start,
2018 ret = ocfs2_remove_inode_range(inode, di_bh, sr->l_start,
2025 orig_isize = i_size_read(inode);
2028 ret = ocfs2_zeroout_partial_cluster(inode, orig_isize,
2031 i_size_write(inode, size);
2033 up_write(&OCFS2_I(inode)->ip_alloc_sem);
2049 inode->i_ctime = inode->i_mtime = current_time(inode);
2050 ret = ocfs2_mark_inode_dirty(handle, inode, di_bh);
2061 ocfs2_inode_unlock(inode, 1);
2063 ocfs2_rw_unlock(inode, 1);
2066 inode_unlock(inode);
2073 struct inode *inode = file_inode(file);
2074 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
2084 if (!S_ISREG(inode->i_mode))
2093 ret = __ocfs2_change_file_space(file, inode, file->f_pos, cmd, sr, 0);
2101 struct inode *inode = file_inode(file);
2102 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
2116 ret = inode_newsize_ok(inode, offset + len);
2128 return __ocfs2_change_file_space(NULL, inode, offset, cmd, &sr,
2132 int ocfs2_check_range_for_refcount(struct inode *inode, loff_t pos,
2138 struct super_block *sb = inode->i_sb;
2140 if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb)) ||
2141 !ocfs2_is_refcount_inode(inode) ||
2142 OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL)
2149 ret = ocfs2_get_clusters(inode, cpos, &phys_cpos, &extent_len,
2171 static int ocfs2_is_io_unaligned(struct inode *inode, size_t count, loff_t pos)
2173 int blockmask = inode->i_sb->s_blocksize - 1;
2181 static int ocfs2_inode_lock_for_extent_tree(struct inode *inode,
2190 ret = ocfs2_inode_lock(inode, di_bh, meta_level);
2192 ret = ocfs2_try_inode_lock(inode, di_bh, meta_level);
2198 down_write(&OCFS2_I(inode)->ip_alloc_sem);
2200 down_read(&OCFS2_I(inode)->ip_alloc_sem);
2203 ret = down_write_trylock(&OCFS2_I(inode)->ip_alloc_sem);
2205 ret = down_read_trylock(&OCFS2_I(inode)->ip_alloc_sem);
2218 ocfs2_inode_unlock(inode, meta_level);
2223 static void ocfs2_inode_unlock_for_extent_tree(struct inode *inode,
2229 up_write(&OCFS2_I(inode)->ip_alloc_sem);
2231 up_read(&OCFS2_I(inode)->ip_alloc_sem);
2237 ocfs2_inode_unlock(inode, meta_level);
2246 struct inode *inode = d_inode(dentry);
2256 ret = ocfs2_inode_lock_for_extent_tree(inode,
2274 ret = ocfs2_overwrite_io(inode, di_bh, pos, count);
2288 * inode. There's also the dinode i_size state which
2290 * set inode->i_size at the end of a write. */
2291 if (setattr_should_drop_suidgid(inode)) {
2293 ocfs2_inode_unlock_for_extent_tree(inode,
2301 ret = ocfs2_write_remove_suid(inode);
2308 ret = ocfs2_check_range_for_refcount(inode, pos, count);
2310 ocfs2_inode_unlock_for_extent_tree(inode,
2316 ret = ocfs2_inode_lock_for_extent_tree(inode,
2327 cpos = pos >> OCFS2_SB(inode->i_sb)->s_clustersize_bits;
2329 ocfs2_clusters_for_bytes(inode->i_sb, pos + count) - cpos;
2330 ret = ocfs2_refcount_cow(inode, di_bh, cpos, clusters, UINT_MAX);
2343 trace_ocfs2_prepare_inode_for_write(OCFS2_I(inode)->ip_blkno,
2346 ocfs2_inode_unlock_for_extent_tree(inode,
2363 struct inode *inode = file_inode(file);
2364 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
2369 i_size_read(inode) ? 1 : 0);
2373 trace_ocfs2_file_write_iter(inode, file, file->f_path.dentry,
2374 (unsigned long long)OCFS2_I(inode)->ip_blkno,
2386 if (!inode_trylock(inode))
2389 inode_lock(inode);
2399 ret = ocfs2_try_rw_lock(inode, rw_level);
2401 ret = ocfs2_rw_lock(inode, rw_level);
2414 * We need to take and drop the inode lock to force
2419 ret = ocfs2_try_inode_lock(inode, NULL, 1);
2421 ret = ocfs2_inode_lock(inode, NULL, 1);
2428 ocfs2_inode_unlock(inode, 1);
2447 ocfs2_is_io_unaligned(inode, count, iocb->ki_pos)) {
2478 IS_SYNC(inode)) {
2502 ocfs2_rw_unlock(inode, rw_level);
2505 inode_unlock(inode);
2517 struct inode *inode = file_inode(filp);
2521 trace_ocfs2_file_read_iter(inode, filp, filp->f_path.dentry,
2522 (unsigned long long)OCFS2_I(inode)->ip_blkno,
2528 if (!inode) {
2543 ret = ocfs2_try_rw_lock(inode, 0);
2545 ret = ocfs2_rw_lock(inode, 0);
2562 * Take and drop the meta data lock to update inode fields
2566 ret = ocfs2_inode_lock_atime(inode, filp->f_path.mnt, &lock_level,
2573 ocfs2_inode_unlock(inode, lock_level);
2588 ocfs2_rw_unlock(inode, rw_level);
2596 struct inode *inode = file->f_mapping->host;
2599 inode_lock(inode);
2605 /* SEEK_END requires the OCFS2 inode lock for the file
2608 ret = ocfs2_inode_lock(inode, NULL, 0);
2613 offset += i_size_read(inode);
2614 ocfs2_inode_unlock(inode, 0);
2634 offset = vfs_setpos(file, offset, inode->i_sb->s_maxbytes);
2637 inode_unlock(inode);
2647 struct inode *inode_in = file_inode(file_in);
2648 struct inode *inode_out = file_inode(file_out);