diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /fs/reiserfs/ioctl.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'fs/reiserfs/ioctl.c')
-rw-r--r-- | fs/reiserfs/ioctl.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c index 5cbb81e134ac..4e153051bc75 100644 --- a/fs/reiserfs/ioctl.c +++ b/fs/reiserfs/ioctl.c | |||
@@ -9,7 +9,6 @@ | |||
9 | #include <linux/time.h> | 9 | #include <linux/time.h> |
10 | #include <asm/uaccess.h> | 10 | #include <asm/uaccess.h> |
11 | #include <linux/pagemap.h> | 11 | #include <linux/pagemap.h> |
12 | #include <linux/smp_lock.h> | ||
13 | #include <linux/compat.h> | 12 | #include <linux/compat.h> |
14 | 13 | ||
15 | /* | 14 | /* |
@@ -60,7 +59,7 @@ long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
60 | if (err) | 59 | if (err) |
61 | break; | 60 | break; |
62 | 61 | ||
63 | if (!is_owner_or_cap(inode)) { | 62 | if (!inode_owner_or_capable(inode)) { |
64 | err = -EPERM; | 63 | err = -EPERM; |
65 | goto setflags_out; | 64 | goto setflags_out; |
66 | } | 65 | } |
@@ -104,7 +103,7 @@ setflags_out: | |||
104 | err = put_user(inode->i_generation, (int __user *)arg); | 103 | err = put_user(inode->i_generation, (int __user *)arg); |
105 | break; | 104 | break; |
106 | case REISERFS_IOC_SETVERSION: | 105 | case REISERFS_IOC_SETVERSION: |
107 | if (!is_owner_or_cap(inode)) { | 106 | if (!inode_owner_or_capable(inode)) { |
108 | err = -EPERM; | 107 | err = -EPERM; |
109 | break; | 108 | break; |
110 | } | 109 | } |
@@ -160,8 +159,6 @@ long reiserfs_compat_ioctl(struct file *file, unsigned int cmd, | |||
160 | 159 | ||
161 | int reiserfs_commit_write(struct file *f, struct page *page, | 160 | int reiserfs_commit_write(struct file *f, struct page *page, |
162 | unsigned from, unsigned to); | 161 | unsigned from, unsigned to); |
163 | int reiserfs_prepare_write(struct file *f, struct page *page, | ||
164 | unsigned from, unsigned to); | ||
165 | /* | 162 | /* |
166 | ** reiserfs_unpack | 163 | ** reiserfs_unpack |
167 | ** Function try to convert tail from direct item into indirect. | 164 | ** Function try to convert tail from direct item into indirect. |
@@ -186,12 +183,11 @@ int reiserfs_unpack(struct inode *inode, struct file *filp) | |||
186 | return 0; | 183 | return 0; |
187 | } | 184 | } |
188 | 185 | ||
189 | /* we need to make sure nobody is changing the file size beneath | ||
190 | ** us | ||
191 | */ | ||
192 | reiserfs_mutex_lock_safe(&inode->i_mutex, inode->i_sb); | ||
193 | depth = reiserfs_write_lock_once(inode->i_sb); | 186 | depth = reiserfs_write_lock_once(inode->i_sb); |
194 | 187 | ||
188 | /* we need to make sure nobody is changing the file size beneath us */ | ||
189 | reiserfs_mutex_lock_safe(&inode->i_mutex, inode->i_sb); | ||
190 | |||
195 | write_from = inode->i_size & (blocksize - 1); | 191 | write_from = inode->i_size & (blocksize - 1); |
196 | /* if we are on a block boundary, we are already unpacked. */ | 192 | /* if we are on a block boundary, we are already unpacked. */ |
197 | if (write_from == 0) { | 193 | if (write_from == 0) { |
@@ -200,7 +196,7 @@ int reiserfs_unpack(struct inode *inode, struct file *filp) | |||
200 | } | 196 | } |
201 | 197 | ||
202 | /* we unpack by finding the page with the tail, and calling | 198 | /* we unpack by finding the page with the tail, and calling |
203 | ** reiserfs_prepare_write on that page. This will force a | 199 | ** __reiserfs_write_begin on that page. This will force a |
204 | ** reiserfs_get_block to unpack the tail for us. | 200 | ** reiserfs_get_block to unpack the tail for us. |
205 | */ | 201 | */ |
206 | index = inode->i_size >> PAGE_CACHE_SHIFT; | 202 | index = inode->i_size >> PAGE_CACHE_SHIFT; |
@@ -210,7 +206,7 @@ int reiserfs_unpack(struct inode *inode, struct file *filp) | |||
210 | if (!page) { | 206 | if (!page) { |
211 | goto out; | 207 | goto out; |
212 | } | 208 | } |
213 | retval = reiserfs_prepare_write(NULL, page, write_from, write_from); | 209 | retval = __reiserfs_write_begin(page, write_from, 0); |
214 | if (retval) | 210 | if (retval) |
215 | goto out_unlock; | 211 | goto out_unlock; |
216 | 212 | ||