[lustre-devel] HELP: difference between fallocate and truncate implementation
arshad hussain <[email protected]> Tue, 19 Nov 2024 18:34:05 +0530
| Newsgroups | org.lustre.lists.lustre-devel |
|---|---|
| Message-ID | <CAKsu7qypKG2h38VD7GaruSaF+=iD9o6T29m+trE33vkK4jDoYA@mail.gmail.com> |
Hi Kg.Xu, > - from LU-13765 <https://review.whamcloud.com/c/fs/lustre-release/+/39342>, > it explains why move fallocate() from ldiskfs upto OSD layer (due to > unpredictable credits ahead), however truncate() resides in ldiskfs layer When fallocate was first introduced (LU-3606) it did called into ldiskfs_fallocate(). During LU-13765, it was moved to the OSD layer with the difference being credits extend (osd_extend_restart_trans()). These changes could have been done under ldiskfs but it is much more straightforward and uncomplicated to implement it under OSD. Though it is not a layering hack. Thanks, Arshad On Tue, Nov 19, 2024 at 2:38 AM <[email protected]> wrote: > > Send lustre-devel mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of lustre-devel digest..." > > > Today's Topics: > > 1. HELP: difference between fallocate and truncate > implementation (keguang xu) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 18 Nov 2024 16:11:38 +0800 > From: keguang xu <[email protected]> > To: [email protected] > Subject: [lustre-devel] HELP: difference between fallocate and > truncate implementation > Message-ID: > <CAF83deS+MC_ZKr9vXix_Js63ZyJ2KkXsSwLg5FeBs-+NziYf3Q@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Lustre devs, > > I came across the code and noticed an implementation difference between > fallocate and truncate/punch operations under the lustre/osd-ldiskfs/. > While *osd_fallocate*() is handled in the Lustre OSD layer, *osd_punch*() > remains in the ldiskfs layer, both of which may relate to multiple > transactions as their comments suggested. > - from LU-13765 <https://review.whamcloud.com/c/fs/lustre-release/+/39342>, > it explains why move fallocate() from ldiskfs upto OSD layer (due to > unpredictable credits ahead), however truncate() resides in ldiskfs layer > instead of moving upto OSD layer? > - LU-10048 <https://review.whamcloud.com/c/fs/lustre-release/+/27488> > claims to "avoids restarting truncate transaction handles in main > transaction", while in osd_fallocate_preallocate() it seems there's no such > concern? Besides, why should we avoid restarting? > > Correct me if I misunderstood the code above...Thank you for your input. > > Best Regards, > kg.xu > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20241118/0c12b8e7/attachment-0001.htm> > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > lustre-devel mailing list > [email protected] > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org > > > ------------------------------ > > End of lustre-devel Digest, Vol 205, Issue 12 > ********************************************* _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org