[PATCH 03/14] xfs: convert log grant heads to LSN notation

Christoph Hellwig hch at infradead.org
Wed Dec 1 07:05:04 CST 2010


> -STATIC int	 xlog_space_left(xlog_t *log, int cycle, int bytes);
> +STATIC int	 xlog_space_left(int logsize, xfs_lsn_t tail_lsn,
> +				xfs_lsn_t head);

Looking further through the series I have to say I really hate
passing in the logsize instead of the log structure.  Passing the
log pointer from higher level functions just makes a lot more sense.

Also in this case passing the tail_lsn explicitly doesn't make any sense
- it becomes atomic later and thus there is no locking requirement for
it.

> -xlog_grant_sub_space(struct log *log, int bytes)
> +__xlog_grant_sub_space(
> +	xfs_lsn_t	*head,
> +	int		bytes,
> +	int		logsize)

Same thing here - the calling convention would be a lot more regular
by still passing the log as first argument.

After the factoring I also think we could cut down on the amount of
wrappers in this area.  Just rename __xlog_grant_sub_space and
__xlog_grant_add_space to not have the __ prefix, and kill the wrappers
around it - they only have one or two callers, and just having two
helpers and passing the heads we're interested in is a lot simpler and
cleaner.




More information about the xfs mailing list