diff options
Diffstat (limited to 'fs/gfs2/ops_file.c')
-rw-r--r-- | fs/gfs2/ops_file.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c index f4842f2548cd..e1b7d525a066 100644 --- a/fs/gfs2/ops_file.c +++ b/fs/gfs2/ops_file.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include "glock.h" | 30 | #include "glock.h" |
31 | #include "glops.h" | 31 | #include "glops.h" |
32 | #include "inode.h" | 32 | #include "inode.h" |
33 | #include "lm.h" | ||
34 | #include "log.h" | 33 | #include "log.h" |
35 | #include "meta_io.h" | 34 | #include "meta_io.h" |
36 | #include "quota.h" | 35 | #include "quota.h" |
@@ -39,6 +38,7 @@ | |||
39 | #include "util.h" | 38 | #include "util.h" |
40 | #include "eaops.h" | 39 | #include "eaops.h" |
41 | #include "ops_address.h" | 40 | #include "ops_address.h" |
41 | #include "ops_inode.h" | ||
42 | 42 | ||
43 | /** | 43 | /** |
44 | * gfs2_llseek - seek to a location in a file | 44 | * gfs2_llseek - seek to a location in a file |
@@ -369,12 +369,9 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct page *page) | |||
369 | if (al == NULL) | 369 | if (al == NULL) |
370 | goto out_unlock; | 370 | goto out_unlock; |
371 | 371 | ||
372 | ret = gfs2_quota_lock(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); | 372 | ret = gfs2_quota_lock_check(ip); |
373 | if (ret) | 373 | if (ret) |
374 | goto out_alloc_put; | 374 | goto out_alloc_put; |
375 | ret = gfs2_quota_check(ip, ip->i_inode.i_uid, ip->i_inode.i_gid); | ||
376 | if (ret) | ||
377 | goto out_quota_unlock; | ||
378 | al->al_requested = data_blocks + ind_blocks; | 375 | al->al_requested = data_blocks + ind_blocks; |
379 | ret = gfs2_inplace_reserve(ip); | 376 | ret = gfs2_inplace_reserve(ip); |
380 | if (ret) | 377 | if (ret) |
@@ -596,6 +593,36 @@ static int gfs2_setlease(struct file *file, long arg, struct file_lock **fl) | |||
596 | return generic_setlease(file, arg, fl); | 593 | return generic_setlease(file, arg, fl); |
597 | } | 594 | } |
598 | 595 | ||
596 | static int gfs2_lm_plock_get(struct gfs2_sbd *sdp, struct lm_lockname *name, | ||
597 | struct file *file, struct file_lock *fl) | ||
598 | { | ||
599 | int error = -EIO; | ||
600 | if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) | ||
601 | error = sdp->sd_lockstruct.ls_ops->lm_plock_get( | ||
602 | sdp->sd_lockstruct.ls_lockspace, name, file, fl); | ||
603 | return error; | ||
604 | } | ||
605 | |||
606 | static int gfs2_lm_plock(struct gfs2_sbd *sdp, struct lm_lockname *name, | ||
607 | struct file *file, int cmd, struct file_lock *fl) | ||
608 | { | ||
609 | int error = -EIO; | ||
610 | if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) | ||
611 | error = sdp->sd_lockstruct.ls_ops->lm_plock( | ||
612 | sdp->sd_lockstruct.ls_lockspace, name, file, cmd, fl); | ||
613 | return error; | ||
614 | } | ||
615 | |||
616 | static int gfs2_lm_punlock(struct gfs2_sbd *sdp, struct lm_lockname *name, | ||
617 | struct file *file, struct file_lock *fl) | ||
618 | { | ||
619 | int error = -EIO; | ||
620 | if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) | ||
621 | error = sdp->sd_lockstruct.ls_ops->lm_punlock( | ||
622 | sdp->sd_lockstruct.ls_lockspace, name, file, fl); | ||
623 | return error; | ||
624 | } | ||
625 | |||
599 | /** | 626 | /** |
600 | * gfs2_lock - acquire/release a posix lock on a file | 627 | * gfs2_lock - acquire/release a posix lock on a file |
601 | * @file: the file pointer | 628 | * @file: the file pointer |