diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2005-06-22 13:16:27 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 16:07:24 -0400 |
commit | b7fa0554cf1ba6d6895cd0a5b02989a26e0bc704 (patch) | |
tree | 83eb405f3ff78c17695999df38c99484e3aee01f /include/linux | |
parent | a257cdd0e2179630d3201c32ba14d7fcb3c3a055 (diff) |
[PATCH] NFS: Add support for NFSv3 ACLs
This adds acl support fo nfs clients via the NFSACL protocol extension, by
implementing the getxattr, listxattr, setxattr, and removexattr iops for the
system.posix_acl_access and system.posix_acl_default attributes. This patch
implements a dumb version that uses no caching (and thus adds some overhead).
(Another patch in this patchset adds caching as well.)
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Acked-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/nfs_fs.h | 31 | ||||
-rw-r--r-- | include/linux/nfs_fs_sb.h | 1 | ||||
-rw-r--r-- | include/linux/nfs_mount.h | 1 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 27 |
4 files changed, 60 insertions, 0 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index d2b5d7e0e85a..3a5e442ac776 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -301,6 +301,9 @@ extern u32 root_nfs_parse_addr(char *name); /*__init*/ | |||
301 | * linux/fs/nfs/file.c | 301 | * linux/fs/nfs/file.c |
302 | */ | 302 | */ |
303 | extern struct inode_operations nfs_file_inode_operations; | 303 | extern struct inode_operations nfs_file_inode_operations; |
304 | #ifdef CONFIG_NFS_V3 | ||
305 | extern struct inode_operations nfs3_file_inode_operations; | ||
306 | #endif /* CONFIG_NFS_V3 */ | ||
304 | extern struct file_operations nfs_file_operations; | 307 | extern struct file_operations nfs_file_operations; |
305 | extern struct address_space_operations nfs_file_aops; | 308 | extern struct address_space_operations nfs_file_aops; |
306 | 309 | ||
@@ -316,6 +319,22 @@ static inline struct rpc_cred *nfs_file_cred(struct file *file) | |||
316 | } | 319 | } |
317 | 320 | ||
318 | /* | 321 | /* |
322 | * linux/fs/nfs/xattr.c | ||
323 | */ | ||
324 | #ifdef CONFIG_NFS_V3_ACL | ||
325 | extern ssize_t nfs3_listxattr(struct dentry *, char *, size_t); | ||
326 | extern ssize_t nfs3_getxattr(struct dentry *, const char *, void *, size_t); | ||
327 | extern int nfs3_setxattr(struct dentry *, const char *, | ||
328 | const void *, size_t, int); | ||
329 | extern int nfs3_removexattr (struct dentry *, const char *name); | ||
330 | #else | ||
331 | # define nfs3_listxattr NULL | ||
332 | # define nfs3_getxattr NULL | ||
333 | # define nfs3_setxattr NULL | ||
334 | # define nfs3_removexattr NULL | ||
335 | #endif | ||
336 | |||
337 | /* | ||
319 | * linux/fs/nfs/direct.c | 338 | * linux/fs/nfs/direct.c |
320 | */ | 339 | */ |
321 | extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, | 340 | extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, |
@@ -329,6 +348,9 @@ extern ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, | |||
329 | * linux/fs/nfs/dir.c | 348 | * linux/fs/nfs/dir.c |
330 | */ | 349 | */ |
331 | extern struct inode_operations nfs_dir_inode_operations; | 350 | extern struct inode_operations nfs_dir_inode_operations; |
351 | #ifdef CONFIG_NFS_V3 | ||
352 | extern struct inode_operations nfs3_dir_inode_operations; | ||
353 | #endif /* CONFIG_NFS_V3 */ | ||
332 | extern struct file_operations nfs_dir_operations; | 354 | extern struct file_operations nfs_dir_operations; |
333 | extern struct dentry_operations nfs_dentry_operations; | 355 | extern struct dentry_operations nfs_dentry_operations; |
334 | 356 | ||
@@ -450,6 +472,15 @@ static inline void nfs_readdata_free(struct nfs_read_data *p) | |||
450 | extern void nfs_readdata_release(struct rpc_task *task); | 472 | extern void nfs_readdata_release(struct rpc_task *task); |
451 | 473 | ||
452 | /* | 474 | /* |
475 | * linux/fs/nfs3proc.c | ||
476 | */ | ||
477 | #ifdef CONFIG_NFS_V3_ACL | ||
478 | extern struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type); | ||
479 | extern int nfs3_proc_setacl(struct inode *inode, int type, | ||
480 | struct posix_acl *acl); | ||
481 | #endif /* CONFIG_NFS_V3_ACL */ | ||
482 | |||
483 | /* | ||
453 | * linux/fs/mount_clnt.c | 484 | * linux/fs/mount_clnt.c |
454 | * (Used only by nfsroot module) | 485 | * (Used only by nfsroot module) |
455 | */ | 486 | */ |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index fc51645d61ee..3d3a305488cf 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -10,6 +10,7 @@ | |||
10 | struct nfs_server { | 10 | struct nfs_server { |
11 | struct rpc_clnt * client; /* RPC client handle */ | 11 | struct rpc_clnt * client; /* RPC client handle */ |
12 | struct rpc_clnt * client_sys; /* 2nd handle for FSINFO */ | 12 | struct rpc_clnt * client_sys; /* 2nd handle for FSINFO */ |
13 | struct rpc_clnt * client_acl; /* ACL RPC client handle */ | ||
13 | struct nfs_rpc_ops * rpc_ops; /* NFS protocol vector */ | 14 | struct nfs_rpc_ops * rpc_ops; /* NFS protocol vector */ |
14 | struct backing_dev_info backing_dev_info; | 15 | struct backing_dev_info backing_dev_info; |
15 | int flags; /* various flags */ | 16 | int flags; /* various flags */ |
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h index 0071428231f9..659c75438454 100644 --- a/include/linux/nfs_mount.h +++ b/include/linux/nfs_mount.h | |||
@@ -58,6 +58,7 @@ struct nfs_mount_data { | |||
58 | #define NFS_MOUNT_KERBEROS 0x0100 /* 3 */ | 58 | #define NFS_MOUNT_KERBEROS 0x0100 /* 3 */ |
59 | #define NFS_MOUNT_NONLM 0x0200 /* 3 */ | 59 | #define NFS_MOUNT_NONLM 0x0200 /* 3 */ |
60 | #define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */ | 60 | #define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */ |
61 | #define NFS_MOUNT_NOACL 0x0800 /* 4 */ | ||
61 | #define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ | 62 | #define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ |
62 | #define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ | 63 | #define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ |
63 | #define NFS_MOUNT_FLAGMASK 0xFFFF | 64 | #define NFS_MOUNT_FLAGMASK 0xFFFF |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 46b206b460c0..a2bf6914ff1b 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_NFS_XDR_H | 2 | #define _LINUX_NFS_XDR_H |
3 | 3 | ||
4 | #include <linux/sunrpc/xprt.h> | 4 | #include <linux/sunrpc/xprt.h> |
5 | #include <linux/nfsacl.h> | ||
5 | 6 | ||
6 | struct nfs4_fsid { | 7 | struct nfs4_fsid { |
7 | __u64 major; | 8 | __u64 major; |
@@ -368,6 +369,20 @@ struct nfs_readdirargs { | |||
368 | struct page ** pages; | 369 | struct page ** pages; |
369 | }; | 370 | }; |
370 | 371 | ||
372 | struct nfs3_getaclargs { | ||
373 | struct nfs_fh * fh; | ||
374 | int mask; | ||
375 | struct page ** pages; | ||
376 | }; | ||
377 | |||
378 | struct nfs3_setaclargs { | ||
379 | struct inode * inode; | ||
380 | int mask; | ||
381 | struct posix_acl * acl_access; | ||
382 | struct posix_acl * acl_default; | ||
383 | struct page ** pages; | ||
384 | }; | ||
385 | |||
371 | struct nfs_diropok { | 386 | struct nfs_diropok { |
372 | struct nfs_fh * fh; | 387 | struct nfs_fh * fh; |
373 | struct nfs_fattr * fattr; | 388 | struct nfs_fattr * fattr; |
@@ -491,6 +506,15 @@ struct nfs3_readdirres { | |||
491 | int plus; | 506 | int plus; |
492 | }; | 507 | }; |
493 | 508 | ||
509 | struct nfs3_getaclres { | ||
510 | struct nfs_fattr * fattr; | ||
511 | int mask; | ||
512 | unsigned int acl_access_count; | ||
513 | unsigned int acl_default_count; | ||
514 | struct posix_acl * acl_access; | ||
515 | struct posix_acl * acl_default; | ||
516 | }; | ||
517 | |||
494 | #ifdef CONFIG_NFS_V4 | 518 | #ifdef CONFIG_NFS_V4 |
495 | 519 | ||
496 | typedef u64 clientid4; | 520 | typedef u64 clientid4; |
@@ -748,4 +772,7 @@ extern struct rpc_version nfs_version2; | |||
748 | extern struct rpc_version nfs_version3; | 772 | extern struct rpc_version nfs_version3; |
749 | extern struct rpc_version nfs_version4; | 773 | extern struct rpc_version nfs_version4; |
750 | 774 | ||
775 | extern struct rpc_version nfsacl_version3; | ||
776 | extern struct rpc_program nfsacl_program; | ||
777 | |||
751 | #endif | 778 | #endif |