aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 92959d093adf..53bca9978fb5 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -131,14 +131,21 @@ static struct inode *gfs2_iget_skip(struct super_block *sb,
131 131
132void gfs2_set_iop(struct inode *inode) 132void gfs2_set_iop(struct inode *inode)
133{ 133{
134 struct gfs2_sbd *sdp = GFS2_SB(inode);
134 umode_t mode = inode->i_mode; 135 umode_t mode = inode->i_mode;
135 136
136 if (S_ISREG(mode)) { 137 if (S_ISREG(mode)) {
137 inode->i_op = &gfs2_file_iops; 138 inode->i_op = &gfs2_file_iops;
138 inode->i_fop = &gfs2_file_fops; 139 if (sdp->sd_args.ar_localflocks)
140 inode->i_fop = &gfs2_file_fops_nolock;
141 else
142 inode->i_fop = &gfs2_file_fops;
139 } else if (S_ISDIR(mode)) { 143 } else if (S_ISDIR(mode)) {
140 inode->i_op = &gfs2_dir_iops; 144 inode->i_op = &gfs2_dir_iops;
141 inode->i_fop = &gfs2_dir_fops; 145 if (sdp->sd_args.ar_localflocks)
146 inode->i_fop = &gfs2_dir_fops_nolock;
147 else
148 inode->i_fop = &gfs2_dir_fops;
142 } else if (S_ISLNK(mode)) { 149 } else if (S_ISLNK(mode)) {
143 inode->i_op = &gfs2_symlink_iops; 150 inode->i_op = &gfs2_symlink_iops;
144 } else { 151 } else {