Is still able to act on the file In this particular case the inode is removed from the hash table even if it still belongs to the inuse or dirty list

The methods associated with an inode object are also called inode operations. They are described by an inode_operations structure, whose address is included in the i op field. Here are the inode operations in the order they appear in the inode_operations table:

create(dir, dentry, mode)

Creates a new disk inode for a regular file associated with a dentry object in some directory.

lookup(dir, dentry)

Searches a directory for an inode corresponding to the filename included in a dentry object.

link(old dentry, dir, new dentry)

Creates a new hard link that refers to the file specified by old_dentry in the directory dir; the new hard link has the name specified by new_dentry.

unlink(dir, dentry)

Removes the hard link of the file specified by a dentry object from a directory.

symlink(dir, dentry, symname)

Creates a new inode for a symbolic link associated with a dentry object in some directory.

mkdir(dir, dentry, mode)

Creates a new inode for a directory associated with a dentry object in some directory.

rmdir(dir, dentry)

Removes from a directory the subdirectory whose name is included in a dentry object.

mknod(dir, dentry, mode, rdev)

Creates a new disk inode for a special file associated with a dentry object in some directory. The mode and rdev parameters specify, respectively, the file type and the device's major number.

rename(old dir, old dentry, new dir, new dentry)

Moves the file identified by old_entry from the old_dir directory to the new_dir readlink(dentry, buffer, buflen)

Copies into a memory area specified by buffer the file pathname corresponding to the symbolic link specified by the dentry.

follow link(inode, dir)

Translates a symbolic link specified by an inode object; if the symbolic link is a relative pathname, the lookup operation starts from the specified directory.

truncate(inode)

Modifies the size of the file associated with an inode. Before invoking this method, it is necessary to set the i_size field of the inode object to the required new size.

permission(inode, mask)

Checks whether the specified access mode is allowed for the file associated with inode.

revalidate(dentry)

Updates the cached attributes of a file specified by a dentry object (usually invoked by the network filesystem).

setattr(dentry, iattr)

Notifies a "change event" after touching the inode attributes.

getattr(dentry, iattr)

Used by networking filesystems when noticing that some cached inode attributes must be refreshed.

The methods just listed are available to all possible inodes and filesystem types. However, only a subset of them applies to a specific inode and filesystem; the fields corresponding to unimplemented methods are set to null.

Continue reading here: File Objects

Was this article helpful?

0 0