From: David Chinner <dgc@sgi.com>
To: Ruben Porras <ruben.porras@linworks.de>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] Implement ioctl to mark AGs as "don't use/use"
Date: Fri, 29 Jun 2007 10:35:45 +1000 [thread overview]
Message-ID: <20070629003545.GE31489@sgi.com> (raw)
In-Reply-To: <46838CAE.9030808@linworks.de>
On Thu, Jun 28, 2007 at 12:25:50PM +0200, Ruben Porras wrote:
> David Chinner wrote:
> Ok, thank you for the explanation, I think that now I got it right.
> Attached is a new patch.
Ok, I'll have a look in a little while ;)
> There is one question that I would like to ask: when you sketched the
> xfs_alloc_set_flag_ag function, you put inside it the call to the
> funcintion xfs_alloc_log_agf (see next code snippet).
>
> STATIC void
> xfs_alloc_set_flag_ag(
> xfs_trans_t *tp,
> xfs_buf_t *agbp, /* buffer for a.g. freelist header */
> xfs_perag_t *pag,
> int flag)
> {
> xfs_agf_t *agf; /* a.g. freespace structure */
>
> agf = XFS_BUF_TO_AGF(agbp);
> pag->pagf_flags |= flag;
> agf->agf_flags = cpu_to_be32(pag->pagf_flags);
>
> xfs_alloc_log_agf(tp, agbp, XFS_AGF_FLAGS); <-- ***** FROM HERE
> }
>
> is it required to do the transaction log right after the change or can it be
> done in the caller function right after calling xfs_alloc_set_flag_ag?
>
> For example
>
> caller(...)
>
> {
> xfs_alloc_set_flag_ag(tp, bp, pag, XFS_AGFLAG_ALLOC_DENY);
>
> <-- **** TO HERE
>
> xfs_trans_set_sync(tp);
> xfs_trans_commit(tp, 0);
> }
Yes, you could do that but I don't think it make sense. We also
log the dirty buffer in th context in which it got dirtied, and
in this case it is xfs_alloc_set_flag_ag(). it also saves having
to rememeber that you ahve to call xfs_alloc_log_agf() after a
call to xfs_alloc_set_flag_ag(). If you need to change multiple flags,
batch them up and do a single xfs_alloc_set_flag_ag() call...
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
next prev parent reply other threads:[~2007-06-29 0:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-27 10:15 [PATCH] Implement ioctl to mark AGs as "don't use/use" Ruben Porras
2007-06-28 4:50 ` David Chinner
2007-06-28 10:25 ` Ruben Porras
2007-06-29 0:35 ` David Chinner [this message]
2007-06-29 0:54 ` David Chinner
2007-09-03 9:20 ` Ruben Porras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070629003545.GE31489@sgi.com \
--to=dgc@sgi.com \
--cc=ruben.porras@linworks.de \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox