summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2011-11-16 14:04:19 +0100
committerJan Kara <jack@suse.cz>2011-11-16 14:04:19 +0100
commitb21068b188539573f39525c296202c071ad594fe (patch)
treebeef9dd736fcfda73f953e7359569eb3d2eb2702
parent717f5e4b6095325f7ea0329cb677300a92d2766c (diff)
downloadlinuxquota-b21068b188539573f39525c296202c071ad594fe.tar.gz
quotaon: Remove duplicated check for hasquota()
We check hasquota() twice needlessly when changing quota state. Remove one of the checks. Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--quotaon.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/quotaon.c b/quotaon.c
index ee9a02e..f374423 100644
--- a/quotaon.c
+++ b/quotaon.c
@@ -248,8 +248,7 @@ static int v1_newstate(struct mntent *mnt, int type, char *file, int flags, int
return 1;
if ((flags & STATEFLAG_OFF) && hasmntopt(mnt, MNTOPT_RSQUASH))
errs += quotarsquashonoff(dev, type, flags);
- if (hasquota(mnt, type, 0))
- errs += quotaonoff((char *)dev, mnt->mnt_dir, file, type, QF_VFSOLD, flags);
+ errs += quotaonoff((char *)dev, mnt->mnt_dir, file, type, QF_VFSOLD, flags);
if ((flags & STATEFLAG_ON) && hasmntopt(mnt, MNTOPT_RSQUASH))
errs += quotarsquashonoff(dev, type, flags);
free((char *)dev);
@@ -266,8 +265,7 @@ static int v2_newstate(struct mntent *mnt, int type, char *file, int flags, int
if (!dev)
return 1;
- if (hasquota(mnt, type, 0))
- errs = quotaonoff((char *)dev, mnt->mnt_dir, file, type, fmt, flags);
+ errs = quotaonoff((char *)dev, mnt->mnt_dir, file, type, fmt, flags);
free((char *)dev);
return errs;
}