int permission(struct inode *inode, int mask, struct nameidata *nd) {

int retval, submask;

/* Nobody gets write access to a read-only fs. */ if (IS_RDONLY(inode) &&

(S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode))) return -EROFS;

/* Nobody gets write access to an immutable file. */ if (IS_IMMUTABLE(inode)) return -EACCES;

After this, the real work is either delegated to a filesystem-specific permission-checking routine if one exists, or to generic_permission:

Continue reading here: Fsnameic

Was this article helpful?

0 0