Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186094
b: refs/heads/master
c: 8c4e4ac
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Jan Kara committed Mar 4, 2010
1 parent e869dd9 commit a38466a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c988afb5fa3fc450207c3dfc0ce535f4bfdae4d1
refs/heads/master: 8c4e4acd660a09e571a71583b5bbe1eee700c9ad
11 changes: 7 additions & 4 deletions trunk/fs/quota/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/capability.h>
#include <linux/quotaops.h>
#include <linux/types.h>
#include <linux/writeback.h>
#include <net/netlink.h>
#include <net/genetlink.h>

Expand Down Expand Up @@ -52,7 +53,7 @@ void sync_quota_sb(struct super_block *sb, int type)
{
int cnt;

if (!sb->s_qcop->quota_sync)
if (!sb->s_qcop || !sb->s_qcop->quota_sync)
return;

sb->s_qcop->quota_sync(sb, type);
Expand Down Expand Up @@ -318,9 +319,11 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
case Q_XGETQUOTA:
return quota_getxquota(sb, type, id, addr);
case Q_XQUOTASYNC:
if (!sb->s_qcop->quota_sync)
return -ENOSYS;
return sb->s_qcop->quota_sync(sb, type);
/* caller already holds s_umount */
if (sb->s_flags & MS_RDONLY)
return -EROFS;
writeback_inodes_sb(sb);
return 0;
default:
return -EINVAL;
}
Expand Down
15 changes: 0 additions & 15 deletions trunk/fs/xfs/linux-2.6/xfs_quotaops.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,6 @@ xfs_quota_type(int type)
}
}

STATIC int
xfs_fs_quota_sync(
struct super_block *sb,
int type)
{
struct xfs_mount *mp = XFS_M(sb);

if (sb->s_flags & MS_RDONLY)
return -EROFS;
if (!XFS_IS_QUOTA_RUNNING(mp))
return -ENOSYS;
return -xfs_sync_data(mp, 0);
}

STATIC int
xfs_fs_get_xstate(
struct super_block *sb,
Expand Down Expand Up @@ -151,7 +137,6 @@ xfs_fs_set_xquota(
}

const struct quotactl_ops xfs_quotactl_operations = {
.quota_sync = xfs_fs_quota_sync,
.get_xstate = xfs_fs_get_xstate,
.set_xstate = xfs_fs_set_xstate,
.get_xquota = xfs_fs_get_xquota,
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/quotaops.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static inline struct quota_info *sb_dqopt(struct super_block *sb)
void sync_quota_sb(struct super_block *sb, int type);
static inline void writeout_quota_sb(struct super_block *sb, int type)
{
if (sb->s_qcop->quota_sync)
if (sb->s_qcop && sb->s_qcop->quota_sync)
sb->s_qcop->quota_sync(sb, type);
}

Expand Down

0 comments on commit a38466a

Please sign in to comment.