Skip to content

xfs: some xfs_dialloc() cleanup

Gao Xiang linux-xfs 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest6 patches 0 repliesNew
  2. v46 patches 8 repliesSuperseded
  3. v36 patches 16 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v26 patches9 repliesSuperseded
v13 patches10 repliesSuperseded

Changes in v5 from the cover letter

- collect RVBs from v4;
- (3/6) get rid of an unnecessary comment (Christoph);

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6xfs: convert noroom, okalloc in xfs_dialloc() to boolfs/xfs/libxfs/xfs_ialloc.c+4 -40 replies
2/6xfs: introduce xfs_dialloc_roll()fs/xfs/libxfs/xfs_ialloc.c fs/xfs/libxfs/xfs_ialloc.h fs/xfs/xfs_inode.c+49 -360 replies
3/6xfs: move on-disk inode allocation out of xfs_ialloc()fs/xfs/xfs_inode.c fs/xfs/xfs_inode.h fs/xfs/xfs_qm.c +1 more+97 -1630 replies
4/6xfs: move xfs_dialloc_roll() into xfs_dialloc()fs/xfs/libxfs/xfs_ialloc.c fs/xfs/libxfs/xfs_ialloc.h fs/xfs/xfs_inode.c+24 -940 replies
5/6xfs: spilt xfs_dialloc() into 2 functionsfs/xfs/libxfs/xfs_ialloc.c fs/xfs/libxfs/xfs_ialloc.h fs/xfs/xfs_inode.c+51 -410 replies
6/6xfs: kill ialloced in xfs_dialloc()fs/xfs/libxfs/xfs_ialloc.c+9 -130 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchChristoph HellwigDarrick J. WongDave Chinner
1/6R-b R-b R-b
2/6R-b R-b
3/6R-b R-b
4/6R-b R-b
5/6R-b R-b
6/6R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [PATCH v5 0/6] xfs: some xfs_dialloc() cleanup

Hi folks,

This is v4 of the following patchset
https://lore.kernel.org/r/[email protected]
, which tends to simplify xfs_dialloc() logic.

This version includes Dave's original patch
https://lore.kernel.org/r/[email protected]

to avoid the original double call of xfs_dialloc() and confusing ialloc_context with some split in order for better review and minor modification (e.g. ino isn't passed in xfs_ialloc()).

I'm not quite sure what's messy ENOSPC mentioned in the original patch since return 0 and *ipp = NULL in xfs_dir_ialloc() would cause NULL-dereference in its callers, so I leave this part alone, although I think noroom has no use at all (it can be cleaned up as well with a following patch) (at a glance, the final shape looks almost ok...)

I dropped [PATCH v1 3/3] since xfs_ialloc_select_ag() already looks simple enough (comments about this are welcome... I can re-add this if needed.)

I'm re-runing xfstests -g auto with the whole series for now since a bit left behind this time, hopefully no extra issues here. I've dropped all RVBs from "[PATCH v4 3/6]" since some more modification here...

Thanks for your time.

changes since v4:
- collect RVBs from v4;
- (3/6) get rid of an unnecessary comment (Christoph);

changes since v3 (Christoph):
- (2/6) get rid of a brace;
- (2/6) keeping xfs_buf_relse() in the callers;
- (2/6) get rid of "XXX:" comment;
- (3/6) rename xfs_ialloc() to xfs_init_new_inode();
- (3/6) rename pino to parent_ino;
- (3/6) convert the return type from int to struct xfs_inode * (so I dropped all RVBs of this patch, since more modification here....)
- (4/6) refine a comment;
- (5/6) add a found_ag lebel to have a central place for the sucessful return, since there are somewhat too many labels here, I didn't add another error lebel to make *IO_agbp = NULL and return error;
- (6/6) drop the else after the break.

changes since v2:
- use struct xfs_dquot_acct * instead of void * on dqinfo (Darrick);
- rename xfs_ialloc() to xfs_dir_ialloc_init() (Dave);
- fix a temporary state compile error due to (ialloc_context -> &ialloc_context) on [PATCH v2 3/6];
- collect more RVBs from the reply of v2;
- Cc Eric to confirm dqinfo;

changes since v1:
- add Dave's patch with spilt and minor update;
- update comments above xfs_ialloc_ag_alloc() suggested by Darrick;
- collect RVBs to
"xfs: convert noroom, okalloc in xfs_dialloc() to bool" "xfs: kill ialloced in xfs_dialloc()"
since no real logic changes ("(!error)" to "(error==0)" suggested by Darrick has been updated).

Thanks,
Gao Xiang

Dave Chinner (4):
xfs: introduce xfs_dialloc_roll()
xfs: move on-disk inode allocation out of xfs_ialloc()
xfs: move xfs_dialloc_roll() into xfs_dialloc()
xfs: spilt xfs_dialloc() into 2 functions

Gao Xiang (2):
xfs: convert noroom, okalloc in xfs_dialloc() to bool
xfs: kill ialloced in xfs_dialloc()

 fs/xfs/libxfs/xfs_ialloc.c | 174 +++++++++++++------------
 fs/xfs/libxfs/xfs_ialloc.h |  36 +++---
 fs/xfs/xfs_inode.c         | 258 +++++++++----------------------------
 fs/xfs/xfs_inode.h         |   6 +-
 fs/xfs/xfs_qm.c            |  27 ++--
 fs/xfs/xfs_symlink.c       |   8 +-
 6 files changed, 196 insertions(+), 313 deletions(-)
Signature · 1 line
2.27.0