Date: Fri, 25 Aug 2023 22:07:02 +0530 From: Raghav Sharma <raghav@freebsd.org> To: soc-status@freebsd.org Subject: SquashFS port final report Message-ID: <CAGthht%2Bf1kUdSyrArNZDMuoRSt0E%2BxUsJjLEbraPqHpBAjvF6w@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
--000000000000f980b10603c1f447 Content-Type: text/plain; charset="UTF-8" Hello! The last 3 weeks have been amazing for our SquashFS port. We completed directories, files, and symlinks support. I completed xattrs support too but implementing vnops() hooks for them is remaining as I was spending this last week on testing our driver. A more detailed report for each feature: * Directories - SquashFS directories are simple, we have a header for the current directory which keeps the count of the number of entries and offset of block in the Directory table. Since I was done implementing their traversing functions most of the work remaining was of implementing VOP_LOOKUP() and VOP_READDIR() hooks. I spent some time understanding those hooks and implemented them completing directories read support. * Files - Now this was a little special, SquashFS files are in fragments which in turn are in the Fragment table. Since there wasn't much documentation available I tried to make sense of SquashFuse source code to understand files. Once I got its design I began porting them. However, I got stuck while testing due to constant page faults that occurred while reading files. After a lot of debugging, I realized that we cannot use uio vectors directly for reading and should use uio helper functions like uiomove(), uiomove_frombuf(), etc... to handle those operations. Once I used them the issue was resolved. * Symlinks - This was simple, the symlink target was specified in inode metadata and all we needed to do was read it. I quickly implemented the VOP_READLINK() hook and symlinks support was done as well. * Extended Attributes - I spent some time understanding SquashFuse's implementation of them, and after that I ported all necessary functions for operations like getting extended attributes, getting their value, etc... The work for implementing VOP_() hooks for them remains since I spent this last week testing more of our driver. I am glad I did a lot of testing where I encountered two issues: 1. We can't list the first entry of the root inode. 2. The inode data leaks memory, I don't know how to free that data once we are not using that inode. I think the second issue could be resolved soon once I see which function gets called for freeing inode data. This is it for this final report. Thanks a lot for reading it this far. --Raghav --000000000000f980b10603c1f447 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hello!<br><br>The last 3 weeks have been amazing for our S= quashFS port.<br>We completed directories, files, and symlinks support.<br>= I completed xattrs support too but implementing vnops() hooks for them is r= emaining as I was spending this last week on testing our driver.<br><br>A m= ore detailed report for each feature:<br><br>* Directories - SquashFS direc= tories are simple, we have a header for the current directory which keeps t= he count of the number of entries and offset of block=C2=A0in the Directory= table.<br>Since I was done implementing their traversing functions most of= the work remaining=C2=A0was of implementing VOP_LOOKUP() and VOP_READDIR()= hooks.<br>I spent some time understanding=C2=A0those hooks and implemented= them completing directories read support.<br><br>* Files - Now this was=C2= =A0a little special, SquashFS files are in fragments which in turn are in t= he Fragment table.<br>Since there wasn't much documentation available I= tried to make sense of SquashFuse source code to understand files.<br>Once= I got its design I began porting them.<br><br>However, I got stuck while t= esting due to constant page faults that occurred while reading files.<br>Af= ter a lot of debugging, I realized that we cannot use uio vectors directly = for reading and should use uio helper functions like uiomove(), uiomove_fro= mbuf(), etc... to handle those operations.<br>Once I used them the issue wa= s resolved.<br><br>* Symlinks - This was simple, the symlink target was spe= cified in inode metadata and all we needed to do was read it.<br>I quickly = implemented the VOP_READLINK() hook and symlinks support was done as well.<= br><br>* Extended Attributes - I spent some time understanding SquashFuse&#= 39;s implementation of them, and after that I ported all necessary function= s for operations like getting extended attributes, getting their value, etc= ...<br>The work for implementing VOP_() hooks for them remains since I spen= t this last week testing more of our driver.<br><br>I am glad I did a lot o= f testing where I encountered two issues:<br><br>1. We can't list the f= irst entry of the root inode.<br>2. The inode data leaks memory, I don'= t know how to free that data once we are not using that inode.<br>I think t= he second issue could be resolved soon once I see which function gets calle= d for freeing inode data.<br><br>This is it for this final report.<br><br>T= hanks a lot for reading it this far.<br><br>--Raghav</div> --000000000000f980b10603c1f447--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGthht%2Bf1kUdSyrArNZDMuoRSt0E%2BxUsJjLEbraPqHpBAjvF6w>