Every file and directory takes up an inode, but I don't think you're at much risk of exhausting inodes on a decent-sized filesystem -- at 5 levels deep, your directory tree will be taking up 16^5
or 1048576 inodes, which is a fair number, but not likely to overwhelm your filesystem. On the other hand, the number of files you store might cause some problems...
It's a bit wasteful to only be using one hex digit per level, though -- I usually go to three digits per level (so ab3/4f5/5e1/...
) as that puts 4096 directories at each level, which is well within the realm of sensible performance from a decent filesystem (don't go to 4, as extN only allows 32000 subdirectories in a single directory).
Then, of course, there's the whole world of filesystems without fixed inode limits, and better performance in the face of massive numbers of files per directory, and no limit on the number of subdirectories...