Re: [PATCH 8/13: eCryptfs] File operations

From: Eric Dumazet
Date: Thu May 04 2006 - 00:06:10 EST


On Thursday 04 May 2006 05:39, Phillip Hellewell wrote:
> +struct file_operations ecryptfs_dir_fops = {
> + .readdir = ecryptfs_readdir,
> + .ioctl = ecryptfs_ioctl,
> + .mmap = generic_file_mmap,
> + .open = ecryptfs_open,
> + .flush = ecryptfs_flush,
> + .release = ecryptfs_release,
> + .fsync = ecryptfs_fsync,
> + .fasync = ecryptfs_fasync,
> + .lock = ecryptfs_lock,
> + .sendfile = ecryptfs_sendfile,
> +};
> +
> +struct file_operations ecryptfs_main_fops = {
> + .llseek = ecryptfs_llseek,
> + .read = ecryptfs_read_update_atime,
> + .write = generic_file_write,
> + .readdir = ecryptfs_readdir,
> + .ioctl = ecryptfs_ioctl,
> + .mmap = generic_file_mmap,
> + .open = ecryptfs_open,
> + .flush = ecryptfs_flush,
> + .release = ecryptfs_release,
> + .fsync = ecryptfs_fsync,
> + .fasync = ecryptfs_fasync,
> + .lock = ecryptfs_lock,
> + .sendfile = ecryptfs_sendfile,
> +};

Current kernel has support for const file_operations, so new file systems
should use a 'const' attribute for 'file_operation' declarations.
It helps avoiding false sharing on SMP.

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/