Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff14ee42 authored by Dave Chinner's avatar Dave Chinner
Browse files

Merge branch 'xfs-misc-fixes-1-for-3.16' into for-next

parents b7676929 8cfcc3e5
Loading
Loading
Loading
Loading
+13 −1
Original line number Original line Diff line number Diff line
@@ -278,6 +278,17 @@ static int quota_getxquota(struct super_block *sb, int type, qid_t id,
	return ret;
	return ret;
}
}


static int quota_rmxquota(struct super_block *sb, void __user *addr)
{
	__u32 flags;

	if (copy_from_user(&flags, addr, sizeof(flags)))
		return -EFAULT;
	if (!sb->s_qcop->rm_xquota)
		return -ENOSYS;
	return sb->s_qcop->rm_xquota(sb, flags);
}

/* Copy parameters and call proper function */
/* Copy parameters and call proper function */
static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
		       void __user *addr, struct path *path)
		       void __user *addr, struct path *path)
@@ -316,8 +327,9 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
		return sb->s_qcop->quota_sync(sb, type);
		return sb->s_qcop->quota_sync(sb, type);
	case Q_XQUOTAON:
	case Q_XQUOTAON:
	case Q_XQUOTAOFF:
	case Q_XQUOTAOFF:
	case Q_XQUOTARM:
		return quota_setxstate(sb, cmd, addr);
		return quota_setxstate(sb, cmd, addr);
	case Q_XQUOTARM:
		return quota_rmxquota(sb, addr);
	case Q_XGETQSTAT:
	case Q_XGETQSTAT:
		return quota_getxstate(sb, addr);
		return quota_getxstate(sb, addr);
	case Q_XGETQSTATV:
	case Q_XGETQSTATV:
+1 −2
Original line number Original line Diff line number Diff line
@@ -456,7 +456,7 @@ xfs_dir2_leaf_readbuf(
		/*
		/*
		 * Advance offset through the mapping table.
		 * Advance offset through the mapping table.
		 */
		 */
		for (j = 0; j < mp->m_dirblkfsbs; j++) {
		for (j = 0; j < mp->m_dirblkfsbs; j += length ) {
			/*
			/*
			 * The rest of this extent but not more than a dir
			 * The rest of this extent but not more than a dir
			 * block.
			 * block.
@@ -464,7 +464,6 @@ xfs_dir2_leaf_readbuf(
			length = min_t(int, mp->m_dirblkfsbs,
			length = min_t(int, mp->m_dirblkfsbs,
					map[mip->ra_index].br_blockcount -
					map[mip->ra_index].br_blockcount -
							mip->ra_offset);
							mip->ra_offset);
			j += length;
			mip->ra_offset += length;
			mip->ra_offset += length;


			/*
			/*
+8 −45
Original line number Original line Diff line number Diff line
@@ -832,47 +832,6 @@ restart:
	return (0);
	return (0);
}
}



STATIC void
xfs_qm_dqput_final(
	struct xfs_dquot	*dqp)
{
	struct xfs_quotainfo	*qi = dqp->q_mount->m_quotainfo;
	struct xfs_dquot	*gdqp;
	struct xfs_dquot	*pdqp;

	trace_xfs_dqput_free(dqp);

	if (list_lru_add(&qi->qi_lru, &dqp->q_lru))
		XFS_STATS_INC(xs_qm_dquot_unused);

	/*
	 * If we just added a udquot to the freelist, then we want to release
	 * the gdquot/pdquot reference that it (probably) has. Otherwise it'll
	 * keep the gdquot/pdquot from getting reclaimed.
	 */
	gdqp = dqp->q_gdquot;
	if (gdqp) {
		xfs_dqlock(gdqp);
		dqp->q_gdquot = NULL;
	}

	pdqp = dqp->q_pdquot;
	if (pdqp) {
		xfs_dqlock(pdqp);
		dqp->q_pdquot = NULL;
	}
	xfs_dqunlock(dqp);

	/*
	 * If we had a group/project quota hint, release it now.
	 */
	if (gdqp)
		xfs_qm_dqput(gdqp);
	if (pdqp)
		xfs_qm_dqput(pdqp);
}

/*
/*
 * Release a reference to the dquot (decrement ref-count) and unlock it.
 * Release a reference to the dquot (decrement ref-count) and unlock it.
 *
 *
@@ -888,10 +847,14 @@ xfs_qm_dqput(


	trace_xfs_dqput(dqp);
	trace_xfs_dqput(dqp);


	if (--dqp->q_nrefs > 0)
	if (--dqp->q_nrefs == 0) {
		struct xfs_quotainfo	*qi = dqp->q_mount->m_quotainfo;
		trace_xfs_dqput_free(dqp);

		if (list_lru_add(&qi->qi_lru, &dqp->q_lru))
			XFS_STATS_INC(xs_qm_dquot_unused);
	}
	xfs_dqunlock(dqp);
	xfs_dqunlock(dqp);
	else
		xfs_qm_dqput_final(dqp);
}
}


/*
/*
+0 −2
Original line number Original line Diff line number Diff line
@@ -52,8 +52,6 @@ typedef struct xfs_dquot {
	int		 q_bufoffset;	/* off of dq in buffer (# dquots) */
	int		 q_bufoffset;	/* off of dq in buffer (# dquots) */
	xfs_fileoff_t	 q_fileoffset;	/* offset in quotas file */
	xfs_fileoff_t	 q_fileoffset;	/* offset in quotas file */


	struct xfs_dquot*q_gdquot;	/* group dquot, hint only */
	struct xfs_dquot*q_pdquot;	/* project dquot, hint only */
	xfs_disk_dquot_t q_core;	/* actual usage & quotas */
	xfs_disk_dquot_t q_core;	/* actual usage & quotas */
	xfs_dq_logitem_t q_logitem;	/* dquot log item */
	xfs_dq_logitem_t q_logitem;	/* dquot log item */
	xfs_qcnt_t	 q_res_bcount;	/* total regular nblks used+reserved */
	xfs_qcnt_t	 q_res_bcount;	/* total regular nblks used+reserved */
+3 −2
Original line number Original line Diff line number Diff line
@@ -543,10 +543,11 @@ xfs_attrmulti_by_handle(


	ops = memdup_user(am_hreq.ops, size);
	ops = memdup_user(am_hreq.ops, size);
	if (IS_ERR(ops)) {
	if (IS_ERR(ops)) {
		error = PTR_ERR(ops);
		error = -PTR_ERR(ops);
		goto out_dput;
		goto out_dput;
	}
	}


	error = ENOMEM;
	attr_name = kmalloc(MAXNAMELEN, GFP_KERNEL);
	attr_name = kmalloc(MAXNAMELEN, GFP_KERNEL);
	if (!attr_name)
	if (!attr_name)
		goto out_kfree_ops;
		goto out_kfree_ops;
@@ -556,7 +557,7 @@ xfs_attrmulti_by_handle(
		ops[i].am_error = strncpy_from_user((char *)attr_name,
		ops[i].am_error = strncpy_from_user((char *)attr_name,
				ops[i].am_attrname, MAXNAMELEN);
				ops[i].am_attrname, MAXNAMELEN);
		if (ops[i].am_error == 0 || ops[i].am_error == MAXNAMELEN)
		if (ops[i].am_error == 0 || ops[i].am_error == MAXNAMELEN)
			error = -ERANGE;
			error = ERANGE;
		if (ops[i].am_error < 0)
		if (ops[i].am_error < 0)
			break;
			break;


Loading