Files stored, or to be stored, in a storage device are marked either as
non-discardable or as discardable in a file system structure associated
with a storage device. Each discardable file has associated with it a
discarding priority level. A publisher file is permitted to be stored in
the storage device only if storing the publisher file does not narrow a
storage usage safety margin that is reserved for user files. User files
are allowed to be stored in the storage device even if storing them
narrows the storage usage safety margin but, in such cases, the storage
usage safety margin is restored by removing one or more discardable files
from the storage device. A discardable file is removed from the storage
device if its discarding priority level equals or is higher than a
predetermined discarding threshold value.