diff options
| -rw-r--r-- | fs/nfs/dir.c | 2 | ||||
| -rw-r--r-- | fs/nfs/file.c | 32 | ||||
| -rw-r--r-- | fs/nfs/inode.c | 2 | ||||
| -rw-r--r-- | fs/nfs/nfs3proc.c | 1 | ||||
| -rw-r--r-- | fs/nfs/nfs4proc.c | 1 | ||||
| -rw-r--r-- | fs/nfs/proc.c | 1 | ||||
| -rw-r--r-- | include/linux/nfs_fs.h | 3 | ||||
| -rw-r--r-- | include/linux/nfs_xdr.h | 1 |
8 files changed, 41 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index b238d95ac48c..ac2899098147 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
| @@ -1468,12 +1468,12 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry | |||
| 1468 | res = NULL; | 1468 | res = NULL; |
| 1469 | goto out; | 1469 | goto out; |
| 1470 | /* This turned out not to be a regular file */ | 1470 | /* This turned out not to be a regular file */ |
| 1471 | case -EISDIR: | ||
| 1471 | case -ENOTDIR: | 1472 | case -ENOTDIR: |
| 1472 | goto no_open; | 1473 | goto no_open; |
| 1473 | case -ELOOP: | 1474 | case -ELOOP: |
| 1474 | if (!(nd->intent.open.flags & O_NOFOLLOW)) | 1475 | if (!(nd->intent.open.flags & O_NOFOLLOW)) |
| 1475 | goto no_open; | 1476 | goto no_open; |
| 1476 | /* case -EISDIR: */ | ||
| 1477 | /* case -EINVAL: */ | 1477 | /* case -EINVAL: */ |
| 1478 | default: | 1478 | default: |
| 1479 | res = ERR_CAST(inode); | 1479 | res = ERR_CAST(inode); |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 0a1f8312b4dc..6d93e0754b5e 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
| @@ -886,3 +886,35 @@ static int nfs_setlease(struct file *file, long arg, struct file_lock **fl) | |||
| 886 | file->f_path.dentry->d_name.name, arg); | 886 | file->f_path.dentry->d_name.name, arg); |
| 887 | return -EINVAL; | 887 | return -EINVAL; |
| 888 | } | 888 | } |
| 889 | |||
| 890 | #ifdef CONFIG_NFS_V4 | ||
| 891 | static int | ||
| 892 | nfs4_file_open(struct inode *inode, struct file *filp) | ||
| 893 | { | ||
| 894 | /* | ||
| 895 | * NFSv4 opens are handled in d_lookup and d_revalidate. If we get to | ||
| 896 | * this point, then something is very wrong | ||
| 897 | */ | ||
| 898 | dprintk("NFS: %s called! inode=%p filp=%p\n", __func__, inode, filp); | ||
| 899 | return -ENOTDIR; | ||
| 900 | } | ||
| 901 | |||
| 902 | const struct file_operations nfs4_file_operations = { | ||
| 903 | .llseek = nfs_file_llseek, | ||
| 904 | .read = do_sync_read, | ||
| 905 | .write = do_sync_write, | ||
| 906 | .aio_read = nfs_file_read, | ||
| 907 | .aio_write = nfs_file_write, | ||
| 908 | .mmap = nfs_file_mmap, | ||
| 909 | .open = nfs4_file_open, | ||
| 910 | .flush = nfs_file_flush, | ||
| 911 | .release = nfs_file_release, | ||
| 912 | .fsync = nfs_file_fsync, | ||
| 913 | .lock = nfs_lock, | ||
| 914 | .flock = nfs_flock, | ||
| 915 | .splice_read = nfs_file_splice_read, | ||
| 916 | .splice_write = nfs_file_splice_write, | ||
| 917 | .check_flags = nfs_check_flags, | ||
| 918 | .setlease = nfs_setlease, | ||
| 919 | }; | ||
| 920 | #endif /* CONFIG_NFS_V4 */ | ||
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index c07a55aec838..50a15fa8cf98 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
| @@ -291,7 +291,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
| 291 | */ | 291 | */ |
| 292 | inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->file_inode_ops; | 292 | inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->file_inode_ops; |
| 293 | if (S_ISREG(inode->i_mode)) { | 293 | if (S_ISREG(inode->i_mode)) { |
| 294 | inode->i_fop = &nfs_file_operations; | 294 | inode->i_fop = NFS_SB(sb)->nfs_client->rpc_ops->file_ops; |
| 295 | inode->i_data.a_ops = &nfs_file_aops; | 295 | inode->i_data.a_ops = &nfs_file_aops; |
| 296 | inode->i_data.backing_dev_info = &NFS_SB(sb)->backing_dev_info; | 296 | inode->i_data.backing_dev_info = &NFS_SB(sb)->backing_dev_info; |
| 297 | } else if (S_ISDIR(inode->i_mode)) { | 297 | } else if (S_ISDIR(inode->i_mode)) { |
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 85f1690ca08c..d4bc9ed91748 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
| @@ -853,6 +853,7 @@ const struct nfs_rpc_ops nfs_v3_clientops = { | |||
| 853 | .dentry_ops = &nfs_dentry_operations, | 853 | .dentry_ops = &nfs_dentry_operations, |
| 854 | .dir_inode_ops = &nfs3_dir_inode_operations, | 854 | .dir_inode_ops = &nfs3_dir_inode_operations, |
| 855 | .file_inode_ops = &nfs3_file_inode_operations, | 855 | .file_inode_ops = &nfs3_file_inode_operations, |
| 856 | .file_ops = &nfs_file_operations, | ||
| 856 | .getroot = nfs3_proc_get_root, | 857 | .getroot = nfs3_proc_get_root, |
| 857 | .getattr = nfs3_proc_getattr, | 858 | .getattr = nfs3_proc_getattr, |
| 858 | .setattr = nfs3_proc_setattr, | 859 | .setattr = nfs3_proc_setattr, |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index b60fddf606f7..069cb8094d43 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
| @@ -6253,6 +6253,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = { | |||
| 6253 | .dentry_ops = &nfs4_dentry_operations, | 6253 | .dentry_ops = &nfs4_dentry_operations, |
| 6254 | .dir_inode_ops = &nfs4_dir_inode_operations, | 6254 | .dir_inode_ops = &nfs4_dir_inode_operations, |
| 6255 | .file_inode_ops = &nfs4_file_inode_operations, | 6255 | .file_inode_ops = &nfs4_file_inode_operations, |
| 6256 | .file_ops = &nfs4_file_operations, | ||
| 6256 | .getroot = nfs4_proc_get_root, | 6257 | .getroot = nfs4_proc_get_root, |
| 6257 | .getattr = nfs4_proc_getattr, | 6258 | .getattr = nfs4_proc_getattr, |
| 6258 | .setattr = nfs4_proc_setattr, | 6259 | .setattr = nfs4_proc_setattr, |
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index ac40b8535d7e..f48125da198a 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c | |||
| @@ -710,6 +710,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = { | |||
| 710 | .dentry_ops = &nfs_dentry_operations, | 710 | .dentry_ops = &nfs_dentry_operations, |
| 711 | .dir_inode_ops = &nfs_dir_inode_operations, | 711 | .dir_inode_ops = &nfs_dir_inode_operations, |
| 712 | .file_inode_ops = &nfs_file_inode_operations, | 712 | .file_inode_ops = &nfs_file_inode_operations, |
| 713 | .file_ops = &nfs_file_operations, | ||
| 713 | .getroot = nfs_proc_get_root, | 714 | .getroot = nfs_proc_get_root, |
| 714 | .getattr = nfs_proc_getattr, | 715 | .getattr = nfs_proc_getattr, |
| 715 | .setattr = nfs_proc_setattr, | 716 | .setattr = nfs_proc_setattr, |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index ab2c6343361a..92ecf5585fac 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -410,6 +410,9 @@ extern const struct inode_operations nfs_file_inode_operations; | |||
| 410 | extern const struct inode_operations nfs3_file_inode_operations; | 410 | extern const struct inode_operations nfs3_file_inode_operations; |
| 411 | #endif /* CONFIG_NFS_V3 */ | 411 | #endif /* CONFIG_NFS_V3 */ |
| 412 | extern const struct file_operations nfs_file_operations; | 412 | extern const struct file_operations nfs_file_operations; |
| 413 | #ifdef CONFIG_NFS_V4 | ||
| 414 | extern const struct file_operations nfs4_file_operations; | ||
| 415 | #endif /* CONFIG_NFS_V4 */ | ||
| 413 | extern const struct address_space_operations nfs_file_aops; | 416 | extern const struct address_space_operations nfs_file_aops; |
| 414 | extern const struct address_space_operations nfs_dir_aops; | 417 | extern const struct address_space_operations nfs_dir_aops; |
| 415 | 418 | ||
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index c74595ba7094..2a7c533be5dd 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -1192,6 +1192,7 @@ struct nfs_rpc_ops { | |||
| 1192 | const struct dentry_operations *dentry_ops; | 1192 | const struct dentry_operations *dentry_ops; |
| 1193 | const struct inode_operations *dir_inode_ops; | 1193 | const struct inode_operations *dir_inode_ops; |
| 1194 | const struct inode_operations *file_inode_ops; | 1194 | const struct inode_operations *file_inode_ops; |
| 1195 | const struct file_operations *file_ops; | ||
| 1195 | 1196 | ||
| 1196 | int (*getroot) (struct nfs_server *, struct nfs_fh *, | 1197 | int (*getroot) (struct nfs_server *, struct nfs_fh *, |
| 1197 | struct nfs_fsinfo *); | 1198 | struct nfs_fsinfo *); |
