The file name lives in the directory and points to the inode number. That is why several names (hard links) can point to the same inode, and why a deleted file keeps using space as long as a process holds it open.
On ext4 the number of inodes is fixed when the file system is created. Millions of small files, such as sessions, cache or mail files, can use them all up. The system then reports No space left on device although df -h still shows free space.
In that case check df -i and look for the directory with the most files. Usual suspects are PHP session directories, mail queues that are never cleaned, and preview thumbnails.
Example
df -i /var