Lines Matching defs:s_inode
3927 static int ocfs2_duplicate_inline_data(struct inode *s_inode,
3934 struct ocfs2_super *osb = OCFS2_SB(s_inode->i_sb);
3938 BUG_ON(!(OCFS2_I(s_inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL));
3970 static int ocfs2_duplicate_extent_list(struct inode *s_inode,
3985 size = i_size_read(s_inode);
3986 clusters = ocfs2_clusters_for_bytes(s_inode->i_sb, size);
3990 ret = ocfs2_get_clusters(s_inode, cpos, &p_cluster,
4022 static int ocfs2_complete_reflink(struct inode *s_inode,
4032 loff_t size = i_size_read(s_inode);
4050 OCFS2_I(t_inode)->ip_clusters = OCFS2_I(s_inode)->ip_clusters;
4051 OCFS2_I(t_inode)->ip_attr = OCFS2_I(s_inode)->ip_attr;
4052 OCFS2_I(t_inode)->ip_dyn_features = OCFS2_I(s_inode)->ip_dyn_features;
4055 t_inode->i_blocks = s_inode->i_blocks;
4064 t_inode->i_uid = s_inode->i_uid;
4065 t_inode->i_gid = s_inode->i_gid;
4066 t_inode->i_mode = s_inode->i_mode;
4081 t_inode->i_mtime = s_inode->i_mtime;
4093 static int ocfs2_create_reflink_node(struct inode *s_inode,
4102 struct ocfs2_super *osb = OCFS2_SB(s_inode->i_sb);
4115 if (OCFS2_I(s_inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
4116 ret = ocfs2_duplicate_inline_data(s_inode, s_bh,
4130 ret = ocfs2_duplicate_extent_list(s_inode, t_inode, t_bh,
4472 /* Remap the range pos_in:len in s_inode to pos_out:len in t_inode. */
4473 static loff_t ocfs2_reflink_remap_extent(struct inode *s_inode,
4494 osb = OCFS2_SB(s_inode->i_sb);
4496 ocfs2_init_dinode_extent_tree(&s_et, INODE_CACHE(s_inode), s_bh);
4499 spos = ocfs2_bytes_to_clusters(s_inode->i_sb, pos_in);
4501 slast = ocfs2_clusters_for_bytes(s_inode->i_sb, pos_in + len);
4510 ret = ocfs2_get_clusters(s_inode, spos, &p_cluster,
4540 /* Mark s_inode's extent as refcounted. */
4542 ret = ocfs2_add_refcount_flag(s_inode, &s_et,
4586 /* Set up refcount tree and remap s_inode to t_inode. */
4587 loff_t ocfs2_reflink_remap_blocks(struct inode *s_inode,
4601 osb = OCFS2_SB(s_inode->i_sb);
4610 if (pos_in == pos_out && pos_in == 0 && len == i_size_read(s_inode) &&
4612 (OCFS2_I(s_inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL)) {
4613 ret = ocfs2_duplicate_inline_data(s_inode, s_bh, t_inode, t_bh);
4625 if (ocfs2_is_refcount_inode(s_inode) &&
4631 /* Neither inode has a refcount tree. Add one to s_inode. */
4632 if (!ocfs2_is_refcount_inode(s_inode) &&
4634 ret = ocfs2_create_refcount_tree(s_inode, s_bh);
4642 if (!ocfs2_is_refcount_inode(s_inode)) {
4643 ret = ocfs2_set_refcount_tree(s_inode, s_bh,
4669 ret = ocfs2_reflink_remap_extent(s_inode, s_bh, pos_in, t_inode, t_bh,
4686 int ocfs2_reflink_inodes_lock(struct inode *s_inode,
4691 struct inode *inode1 = s_inode;
4697 bool same_inode = (s_inode == t_inode);
4702 lock_two_nondirectories(s_inode, t_inode);
4775 unlock_two_nondirectories(s_inode, t_inode);
4780 void ocfs2_reflink_inodes_unlock(struct inode *s_inode,
4785 ocfs2_inode_unlock(s_inode, 1);
4786 ocfs2_rw_unlock(s_inode, 1);
4788 if (s_inode != t_inode) {
4793 unlock_two_nondirectories(s_inode, t_inode);