aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 13:27:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 13:27:28 -0500
commitb2034d474b7e1e8578bd5c2977024b51693269d9 (patch)
treee43969bf7c2ba89884c2580f56978826f1014520 /fs/ocfs2
parent27d189c02ba25851973c8582e419c0bded9f7e5b (diff)
parent924241575a85249b9d410e38f5b2fcad9035e45c (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (41 commits) fs: add documentation on fallocate hole punching Gfs2: fail if we try to use hole punch Btrfs: fail if we try to use hole punch Ext4: fail if we try to use hole punch Ocfs2: handle hole punching via fallocate properly XFS: handle hole punching via fallocate properly fs: add hole punching to fallocate vfs: pass struct file to do_truncate on O_TRUNC opens (try #2) fix signedness mess in rw_verify_area() on 64bit architectures fs: fix kernel-doc for dcache::prepend_path fs: fix kernel-doc for dcache::d_validate sanitize ecryptfs ->mount() switch afs move internal-only parts of ncpfs headers to fs/ncpfs switch ncpfs switch 9p pass default dentry_operations to mount_pseudo() switch hostfs switch affs switch configfs ...
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/export.c6
-rw-r--r--fs/ocfs2/file.c8
-rw-r--r--fs/ocfs2/namei.c5
-rw-r--r--fs/ocfs2/super.c1
4 files changed, 8 insertions, 12 deletions
diff --git a/fs/ocfs2/export.c b/fs/ocfs2/export.c
index 6adafa576065..5dbc3062b4fd 100644
--- a/fs/ocfs2/export.c
+++ b/fs/ocfs2/export.c
@@ -137,9 +137,7 @@ check_gen:
137 } 137 }
138 138
139 result = d_obtain_alias(inode); 139 result = d_obtain_alias(inode);
140 if (!IS_ERR(result)) 140 if (IS_ERR(result))
141 d_set_d_op(result, &ocfs2_dentry_ops);
142 else
143 mlog_errno(PTR_ERR(result)); 141 mlog_errno(PTR_ERR(result));
144 142
145bail: 143bail:
@@ -175,8 +173,6 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
175 } 173 }
176 174
177 parent = d_obtain_alias(ocfs2_iget(OCFS2_SB(dir->i_sb), blkno, 0, 0)); 175 parent = d_obtain_alias(ocfs2_iget(OCFS2_SB(dir->i_sb), blkno, 0, 0));
178 if (!IS_ERR(parent))
179 d_set_d_op(parent, &ocfs2_dentry_ops);
180 176
181bail_unlock: 177bail_unlock:
182 ocfs2_inode_unlock(dir, 0); 178 ocfs2_inode_unlock(dir, 0);
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index bdadbae09094..63e3fca266e0 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1995,6 +1995,7 @@ static long ocfs2_fallocate(struct inode *inode, int mode, loff_t offset,
1995 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 1995 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1996 struct ocfs2_space_resv sr; 1996 struct ocfs2_space_resv sr;
1997 int change_size = 1; 1997 int change_size = 1;
1998 int cmd = OCFS2_IOC_RESVSP64;
1998 1999
1999 if (!ocfs2_writes_unwritten_extents(osb)) 2000 if (!ocfs2_writes_unwritten_extents(osb))
2000 return -EOPNOTSUPP; 2001 return -EOPNOTSUPP;
@@ -2005,12 +2006,15 @@ static long ocfs2_fallocate(struct inode *inode, int mode, loff_t offset,
2005 if (mode & FALLOC_FL_KEEP_SIZE) 2006 if (mode & FALLOC_FL_KEEP_SIZE)
2006 change_size = 0; 2007 change_size = 0;
2007 2008
2009 if (mode & FALLOC_FL_PUNCH_HOLE)
2010 cmd = OCFS2_IOC_UNRESVSP64;
2011
2008 sr.l_whence = 0; 2012 sr.l_whence = 0;
2009 sr.l_start = (s64)offset; 2013 sr.l_start = (s64)offset;
2010 sr.l_len = (s64)len; 2014 sr.l_len = (s64)len;
2011 2015
2012 return __ocfs2_change_file_space(NULL, inode, offset, 2016 return __ocfs2_change_file_space(NULL, inode, offset, cmd, &sr,
2013 OCFS2_IOC_RESVSP64, &sr, change_size); 2017 change_size);
2014} 2018}
2015 2019
2016int ocfs2_check_range_for_refcount(struct inode *inode, loff_t pos, 2020int ocfs2_check_range_for_refcount(struct inode *inode, loff_t pos,
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index 30c523144452..849fb4a2e814 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -147,7 +147,6 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry,
147 spin_unlock(&oi->ip_lock); 147 spin_unlock(&oi->ip_lock);
148 148
149bail_add: 149bail_add:
150 d_set_d_op(dentry, &ocfs2_dentry_ops);
151 ret = d_splice_alias(inode, dentry); 150 ret = d_splice_alias(inode, dentry);
152 151
153 if (inode) { 152 if (inode) {
@@ -415,7 +414,6 @@ static int ocfs2_mknod(struct inode *dir,
415 mlog_errno(status); 414 mlog_errno(status);
416 goto leave; 415 goto leave;
417 } 416 }
418 d_set_d_op(dentry, &ocfs2_dentry_ops);
419 417
420 status = ocfs2_add_entry(handle, dentry, inode, 418 status = ocfs2_add_entry(handle, dentry, inode,
421 OCFS2_I(inode)->ip_blkno, parent_fe_bh, 419 OCFS2_I(inode)->ip_blkno, parent_fe_bh,
@@ -743,7 +741,6 @@ static int ocfs2_link(struct dentry *old_dentry,
743 } 741 }
744 742
745 ihold(inode); 743 ihold(inode);
746 d_set_d_op(dentry, &ocfs2_dentry_ops);
747 d_instantiate(dentry, inode); 744 d_instantiate(dentry, inode);
748 745
749out_commit: 746out_commit:
@@ -1797,7 +1794,6 @@ static int ocfs2_symlink(struct inode *dir,
1797 mlog_errno(status); 1794 mlog_errno(status);
1798 goto bail; 1795 goto bail;
1799 } 1796 }
1800 d_set_d_op(dentry, &ocfs2_dentry_ops);
1801 1797
1802 status = ocfs2_add_entry(handle, dentry, inode, 1798 status = ocfs2_add_entry(handle, dentry, inode,
1803 le64_to_cpu(fe->i_blkno), parent_fe_bh, 1799 le64_to_cpu(fe->i_blkno), parent_fe_bh,
@@ -2462,7 +2458,6 @@ int ocfs2_mv_orphaned_inode_to_new(struct inode *dir,
2462 goto out_commit; 2458 goto out_commit;
2463 } 2459 }
2464 2460
2465 d_set_d_op(dentry, &ocfs2_dentry_ops);
2466 d_instantiate(dentry, inode); 2461 d_instantiate(dentry, inode);
2467 status = 0; 2462 status = 0;
2468out_commit: 2463out_commit:
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 17ff46fa8a10..06d1f749ca89 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -2097,6 +2097,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
2097 2097
2098 sb->s_fs_info = osb; 2098 sb->s_fs_info = osb;
2099 sb->s_op = &ocfs2_sops; 2099 sb->s_op = &ocfs2_sops;
2100 sb->s_d_op = &ocfs2_dentry_ops;
2100 sb->s_export_op = &ocfs2_export_ops; 2101 sb->s_export_op = &ocfs2_export_ops;
2101 sb->s_qcop = &ocfs2_quotactl_ops; 2102 sb->s_qcop = &ocfs2_quotactl_ops;
2102 sb->dq_op = &ocfs2_quota_operations; 2103 sb->dq_op = &ocfs2_quota_operations;