Re: [PATCH 07/13] xfs: refactor incore dquot initialization functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 22, 2018 at 08:06:37AM -0700, Darrick J. Wong wrote:
> -/*
> - * Read in the ondisk dquot using dqtobp() then copy it to an incore version,
> - * and release the buffer immediately.
> - *
> - * If XFS_QMOPT_DQALLOC is set, allocate a dquot on disk if it needed.
> - */
> -int
> -xfs_qm_dqread(
> +/* Allocate and initialize everything we need for an incore dquot. */
> +STATIC struct xfs_dquot *
> +xfs_qm_dqinit_once(
>  	struct xfs_mount	*mp,
>  	xfs_dqid_t		id,
> -	uint			type,
> -	uint			flags,
> -	struct xfs_dquot	**O_dqpp)
> +	uint			type)
>  {
>  	struct xfs_dquot	*dqp;
> -	struct xfs_disk_dquot	*ddqp;
> -	struct xfs_buf		*bp;
> -	struct xfs_trans	*tp = NULL;
> -	int			error;
>  
>  	dqp = kmem_zone_zalloc(xfs_qm_dqzone, KM_SLEEP);

Shouldn't this be called something like xfs_dquot_alloc given that
it allocates the xfs_dquot structure?

> +/* Copy the in-core quota fields in from the on-disk buffer. */
> +STATIC void
> +xfs_qm_dqinit_from_buf(
> +	struct xfs_dquot	*dqp,
> +	struct xfs_disk_dquot	*ddqp)
> +{

xfs_dquot_from_disk?

Also didn't we stop using STATIC for new code a while ago?

> +	/* copy everything from disk dquot to the incore dquot */
> +	memcpy(&dqp->q_core, ddqp, sizeof(xfs_disk_dquot_t));

	memcpy(&dqp->q_core, ddqp, sizeof(dqp->q_core));

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux