Linux Kernel
3.7.1
|
#include <linux/export.h>
#include <linux/time.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/capability.h>
#include <linux/fsnotify.h>
#include <linux/fcntl.h>
#include <linux/security.h>
#include <linux/evm.h>
#include <linux/ima.h>
Go to the source code of this file.
Functions | |
int | inode_change_ok (const struct inode *inode, struct iattr *attr) |
EXPORT_SYMBOL (inode_change_ok) | |
int | inode_newsize_ok (const struct inode *inode, loff_t offset) |
EXPORT_SYMBOL (inode_newsize_ok) | |
void | setattr_copy (struct inode *inode, const struct iattr *attr) |
EXPORT_SYMBOL (setattr_copy) | |
int | notify_change (struct dentry *dentry, struct iattr *attr) |
EXPORT_SYMBOL (notify_change) | |
EXPORT_SYMBOL | ( | inode_change_ok | ) |
EXPORT_SYMBOL | ( | inode_newsize_ok | ) |
EXPORT_SYMBOL | ( | setattr_copy | ) |
EXPORT_SYMBOL | ( | notify_change | ) |
inode_change_ok - check if attribute changes to an inode are allowed : inode to check : attributes to change
Check if we are allowed to change the attributes contained in in the given inode. This includes the normal unix access permission checks, as well as checks for rlimits and others.
Should be called as the first thing in ->setattr implementations, possibly after taking additional locks.
inode_newsize_ok - may this inode be truncated to a given size : the inode to be truncated : the new size to assign to the inode : 0 on success, -ve errno on failure
inode_newsize_ok must be called with i_mutex held.
inode_newsize_ok will check filesystem limits and ulimits to check that the new inode size is within limits. inode_newsize_ok will also send SIGXFSZ when necessary. Caller must not proceed with inode size change if failure is returned. must be a file (not directory), with appropriate permissions to allow truncate (inode_newsize_ok does NOT check these conditions).
setattr_copy - copy simple metadata updates into the generic inode : the inode to be updated : the new attributes
setattr_copy must be called with i_mutex held.
setattr_copy updates the inode's metadata with that specified in attr. Noticeably missing is inode size update, which is more complex as it requires pagecache updates.
The inode is not marked as dirty after this operation. The rationale is that for "simple" filesystems, the struct inode is the inode storage. The caller is free to mark the inode dirty afterwards if needed.