Blocks deallocation routine when file is deleted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi list,

I wanted to understand the routine of block deallocation when a file
is deleted from XFS.

Suppose initial state of the XFS partition is:

-----------------8<------------------------
localhost:/home/adil # df /mnt/test/
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg_lv_test
                      67055628      5280  67050348   1% /mnt/test
-----------------8<------------------------

The Used value is 5280. What it (5280) signifies? Number of FSB?

Now a 1MB size file is being created named xyz. After file creation
checked the filesystem usage:

-----------------8<------------------------
localhost:/home/adil # df /mnt/test/
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg_lv_test
                      67055628      6304  67049324   1% /mnt/test
localhost:/mnt/test # xfs_io xyz
xfs_io> stat
fd.path = "xyz"
fd.flags = non-sync,non-direct,read-write
stat.ino = 132
stat.type = regular file
stat.size = 1048576
stat.blocks = 2048
fsxattr.xflags = 0x0 [--------------]
fsxattr.projid = 0
fsxattr.extsize = 0
fsxattr.nextents = 1
fsxattr.naextents = 0
dioattr.mem = 0x200
dioattr.miniosz = 512
dioattr.maxiosz = 2147483136
-----------------8<------------------------

The used count has increased from 5280 to 6304 i.e. by 1024. What it
(1024) signifies?

Now deleted the file and checked the blocks and other information
whether the blocks allocated returned back or not:

-----------------8<------------------------
localhost:/mnt/test # rm xyz
localhost:/home/adil # df /mnt/test/
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg_lv_test
                      67055628      5280  67050348   1% /mnt/test
-----------------8<------------------------

So here we see that the used count is decreased to original value (5280).

I would like to know where this deallocation is being done in the
code. I appreciate if anyone can help me in giving the code flow hint.

Thanks and Best Regards,
Adil

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux