aboutsummaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/locks.c b/fs/locks.c
index a94e331a52a2..cb424a4fed71 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -334,7 +334,7 @@ static int flock_to_posix_lock(struct file *filp, struct file_lock *fl,
334 start = filp->f_pos; 334 start = filp->f_pos;
335 break; 335 break;
336 case SEEK_END: 336 case SEEK_END:
337 start = i_size_read(filp->f_path.dentry->d_inode); 337 start = i_size_read(file_inode(filp));
338 break; 338 break;
339 default: 339 default:
340 return -EINVAL; 340 return -EINVAL;
@@ -384,7 +384,7 @@ static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl,
384 start = filp->f_pos; 384 start = filp->f_pos;
385 break; 385 break;
386 case SEEK_END: 386 case SEEK_END:
387 start = i_size_read(filp->f_path.dentry->d_inode); 387 start = i_size_read(file_inode(filp));
388 break; 388 break;
389 default: 389 default:
390 return -EINVAL; 390 return -EINVAL;
@@ -627,7 +627,7 @@ posix_test_lock(struct file *filp, struct file_lock *fl)
627 struct file_lock *cfl; 627 struct file_lock *cfl;
628 628
629 lock_flocks(); 629 lock_flocks();
630 for (cfl = filp->f_path.dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) { 630 for (cfl = file_inode(filp)->i_flock; cfl; cfl = cfl->fl_next) {
631 if (!IS_POSIX(cfl)) 631 if (!IS_POSIX(cfl))
632 continue; 632 continue;
633 if (posix_locks_conflict(fl, cfl)) 633 if (posix_locks_conflict(fl, cfl))
@@ -708,7 +708,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
708{ 708{
709 struct file_lock *new_fl = NULL; 709 struct file_lock *new_fl = NULL;
710 struct file_lock **before; 710 struct file_lock **before;
711 struct inode * inode = filp->f_path.dentry->d_inode; 711 struct inode * inode = file_inode(filp);
712 int error = 0; 712 int error = 0;
713 int found = 0; 713 int found = 0;
714 714
@@ -1002,7 +1002,7 @@ static int __posix_lock_file(struct inode *inode, struct file_lock *request, str
1002int posix_lock_file(struct file *filp, struct file_lock *fl, 1002int posix_lock_file(struct file *filp, struct file_lock *fl,
1003 struct file_lock *conflock) 1003 struct file_lock *conflock)
1004{ 1004{
1005 return __posix_lock_file(filp->f_path.dentry->d_inode, fl, conflock); 1005 return __posix_lock_file(file_inode(filp), fl, conflock);
1006} 1006}
1007EXPORT_SYMBOL(posix_lock_file); 1007EXPORT_SYMBOL(posix_lock_file);
1008 1008
@@ -1326,8 +1326,8 @@ int fcntl_getlease(struct file *filp)
1326 int type = F_UNLCK; 1326 int type = F_UNLCK;
1327 1327
1328 lock_flocks(); 1328 lock_flocks();
1329 time_out_leases(filp->f_path.dentry->d_inode); 1329 time_out_leases(file_inode(filp));
1330 for (fl = filp->f_path.dentry->d_inode->i_flock; fl && IS_LEASE(fl); 1330 for (fl = file_inode(filp)->i_flock; fl && IS_LEASE(fl);
1331 fl = fl->fl_next) { 1331 fl = fl->fl_next) {
1332 if (fl->fl_file == filp) { 1332 if (fl->fl_file == filp) {
1333 type = target_leasetype(fl); 1333 type = target_leasetype(fl);
@@ -1843,7 +1843,7 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd,
1843 if (copy_from_user(&flock, l, sizeof(flock))) 1843 if (copy_from_user(&flock, l, sizeof(flock)))
1844 goto out; 1844 goto out;
1845 1845
1846 inode = filp->f_path.dentry->d_inode; 1846 inode = file_inode(filp);
1847 1847
1848 /* Don't allow mandatory locks on files that may be memory mapped 1848 /* Don't allow mandatory locks on files that may be memory mapped
1849 * and shared. 1849 * and shared.
@@ -1961,7 +1961,7 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd,
1961 if (copy_from_user(&flock, l, sizeof(flock))) 1961 if (copy_from_user(&flock, l, sizeof(flock)))
1962 goto out; 1962 goto out;
1963 1963
1964 inode = filp->f_path.dentry->d_inode; 1964 inode = file_inode(filp);
1965 1965
1966 /* Don't allow mandatory locks on files that may be memory mapped 1966 /* Don't allow mandatory locks on files that may be memory mapped
1967 * and shared. 1967 * and shared.
@@ -2030,7 +2030,7 @@ void locks_remove_posix(struct file *filp, fl_owner_t owner)
2030 * posix_lock_file(). Another process could be setting a lock on this 2030 * posix_lock_file(). Another process could be setting a lock on this
2031 * file at the same time, but we wouldn't remove that lock anyway. 2031 * file at the same time, but we wouldn't remove that lock anyway.
2032 */ 2032 */
2033 if (!filp->f_path.dentry->d_inode->i_flock) 2033 if (!file_inode(filp)->i_flock)
2034 return; 2034 return;
2035 2035
2036 lock.fl_type = F_UNLCK; 2036 lock.fl_type = F_UNLCK;
@@ -2056,7 +2056,7 @@ EXPORT_SYMBOL(locks_remove_posix);
2056 */ 2056 */
2057void locks_remove_flock(struct file *filp) 2057void locks_remove_flock(struct file *filp)
2058{ 2058{
2059 struct inode * inode = filp->f_path.dentry->d_inode; 2059 struct inode * inode = file_inode(filp);
2060 struct file_lock *fl; 2060 struct file_lock *fl;
2061 struct file_lock **before; 2061 struct file_lock **before;
2062 2062
@@ -2152,7 +2152,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
2152 fl_pid = fl->fl_pid; 2152 fl_pid = fl->fl_pid;
2153 2153
2154 if (fl->fl_file != NULL) 2154 if (fl->fl_file != NULL)
2155 inode = fl->fl_file->f_path.dentry->d_inode; 2155 inode = file_inode(fl->fl_file);
2156 2156
2157 seq_printf(f, "%lld:%s ", id, pfx); 2157 seq_printf(f, "%lld:%s ", id, pfx);
2158 if (IS_POSIX(fl)) { 2158 if (IS_POSIX(fl)) {