Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lfs:Added lfs_file_getattr interface #1047

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crafcat7
Copy link

@crafcat7 crafcat7 commented Nov 25, 2024

This change comes from #1045, which splits lfs_file_getattr and lfs_file_setattr. At the same time, the logic of lfs_file_getattr is optimized.

  1. Added a new interface lfs_file_getattr to get the corresponding file attributes through lfs_file. This interface is similar to lfs_getattr, but lfs_file_getattr replaces path with lfs_file.
  2. Implemented the corresponding test case in test_attrs.toml.

The main logic of the test:

  1. Create a file and get its attributes (it should return LFS_ERR_NOATTR at this time)
  2. Set its attributes and then get the attributes and compare the attributes

After passing make test, the results are all passed

running test_alloc: 12/12 cases, 207/207 perms
running test_attrs: 5/5 cases, 25/25 perms
running test_badblocks: 4/4 cases, 300/300 perms
running test_bd: 5/5 cases, 85/85 perms
running test_compat: 17/17 cases, 205/205 perms
running test_dirs: 14/14 cases, 445/445 perms, 1756pls!
running test_entries: 8/8 cases, 32/32 perms
running test_evil: 8/8 cases, 105/105 perms
running test_exhaustion: 5/5 cases, 85/85 perms
running test_files: 10/10 cases, 7155/7155 perms, 9410pls!
running test_interspersed: 4/4 cases, 190/190 perms, 2835pls!
running test_move: 17/17 cases, 161/161 perms, 157pls!
running test_orphans: 6/6 cases, 50/50 perms, 846pls!
running test_paths: 13/13 cases, 65/65 perms
running test_powerloss: 2/2 cases, 21/21 perms
running test_relocations: 4/4 cases, 68/68 perms, 1612pls!
running test_seek: 6/6 cases, 175/175 perms, 1050pls!
running test_superblocks: 16/16 cases, 285/285 perms, 1437pls!
running test_truncate: 7/7 cases, 1270/1270 perms, 9691pls!

done: 10929/10929 passed, 0/10929 failed, 28794pls!, in 216.85s

1. Added a new interface lfs_file_getattr to get the corresponding
   file attributes through lfs_file. This interface is similar to lfs_getattr,
   but lfs_file_getattr replaces path with lfs_file.
2. Implemented the corresponding test case in test_attrs.toml.

Signed-off-by: chenrun1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant