xfs
[Top] [All Lists]

Re: [PATCH 7/7] xfs: merge xfs_ialloc_ag_select into xfs_dialloc

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 7/7] xfs: merge xfs_ialloc_ag_select into xfs_dialloc
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Mon, 30 Jul 2012 12:21:00 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <501182AE.2090109@xxxxxxx>
References: <20120704145444.863203951@xxxxxxxxxxxxxxxxxxxxxx> <20120704145616.894941902@xxxxxxxxxxxxxxxxxxxxxx> <501182AE.2090109@xxxxxxx>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 07/26/12 12:47, Mark Tinguely wrote:


+ if (pass < 2) {
+ /*
+ * Is there enough free space for the file plus a block
+ * of inodes?
+ */
+ xfs_extlen_t longest = pag->pagf_longest;
+ int needspace =
+ S_ISDIR(mode) || S_ISREG(mode) || S_ISLNK(mode);
+
+ if (!longest)
+ longest = pag->pagf_flcount > 0;
+
+ if (pag->pagf_freeblks <
+ XFS_IALLOC_BLOCKS(mp) + needspace)
+ goto nextag;
^^^^^^^ here

+ if (longest < XFS_IALLOC_BLOCKS(mp))
+ goto nextag;

^^^^^^^ and here
+ }

Isn't the agbp locked from the earlier xfs_ialloc_read_agi()?
Do we want to release them before going on to the next AG?

Thank-you,

--Mark.


same line of thought as above:


+               if (!pag->pagf_init) {
+                       int flags = pass ? 0 : XFS_ALLOC_FLAG_TRYLOCK;
+
+                       error = xfs_alloc_pagf_init(mp, tp, agno, flags);
+                       if (error)
+                               goto out_error;
+               }

Also, don't we still have the AGI buffer locked when we try to
initialize the AGF? If the AGF initialization fails, do we need to also
unlock the AGI buffer before returning?

Thank-you.

--Mark.

<Prev in Thread] Current Thread [Next in Thread>