I am trying to create a new binary to scan the directory of /data, but it seems to be impossible.

I try both in the kernel module and user module. The /data is controlled by selinux policy. And some directories like /data/user/0 is protected by the neverallow policy.

Only fews process can access to it. it is impossible to give a u:r:su:s0 to a user module process.

Any ideas to scan the /data and calculate the size of the sub-directory.
Thanks in advance