Thanks for keeping me as an author, I appreciate it.
I like your version of the script, especially the clever way in which you figure out the mount points to explore (as opposed to my variables for the two "roots", defaulting to $HOME and /home/.ecryptfs/$USERNAME. I like the way you do it.
The heuristic you use (the ECRYPTFS_FNEK_ENCRYPTED prefix) seems also very reasonable to me.
Finally, I still have the performance concern with the fact of doing a "find" for the inode throughout entire mounted filesystems. I think the idea laid out in my version, consisting of looking up the inodes of the directories along the path is worth it (e.g., for aa/bb/cc/dd.txt, we look up aa first, then bb in aa, then cc in bb and finally dd.txt in cc). An algorithmic cost of O(log n) as opposed to O(n) is a huge performance difference. If this didn't convince you, let's stop here and keep the script we way you wrote it. If, on the other hand, you think the line <code>find "$m/" -inum "$inum"</code> towards the end of the script could be rewritten to be more efficient, I'll be very happy to try it out.
One more thing. From Tyler's comments, I figured out that, in order to figure out the i-node
stat --printf %i "$1"
...is maybe a more elegant way than...
ls -aid "$1" | awk '{print $1}'
Hi Dustin,
Thanks for keeping me as an author, I appreciate it. ecryptfs/ $USERNAME. I like the way you do it.
I like your version of the script, especially the clever way in which you figure out the mount points to explore (as opposed to my variables for the two "roots", defaulting to $HOME and /home/.
The heuristic you use (the ECRYPTFS_ FNEK_ENCRYPTED prefix) seems also very reasonable to me.
Finally, I still have the performance concern with the fact of doing a "find" for the inode throughout entire mounted filesystems. I think the idea laid out in my version, consisting of looking up the inodes of the directories along the path is worth it (e.g., for aa/bb/cc/dd.txt, we look up aa first, then bb in aa, then cc in bb and finally dd.txt in cc). An algorithmic cost of O(log n) as opposed to O(n) is a huge performance difference. If this didn't convince you, let's stop here and keep the script we way you wrote it. If, on the other hand, you think the line <code>find "$m/" -inum "$inum"</code> towards the end of the script could be rewritten to be more efficient, I'll be very happy to try it out.
One more thing. From Tyler's comments, I figured out that, in order to figure out the i-node
stat --printf %i "$1"
...is maybe a more elegant way than...
ls -aid "$1" | awk '{print $1}'
Cheers,
Sergio