diff options
author | Steve Dickson <steved@redhat.com> | 2013-05-22 12:50:40 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-06-08 16:20:14 -0400 |
commit | e058f70b8070608fedfd3e39c2ead935beecb552 (patch) | |
tree | 7edaeed13f64d0218d8541321e2a6c780ee59986 /fs/nfs | |
parent | e64a4210f69010d0ff349d5889b50fed51f8bdd0 (diff) |
NFSv4: Introduce new label structure
In order to mimic the way that NFSv4 ACLs are implemented we have created a
structure to be used to pass label data up and down the call chain. This patch
adds the new structure and new members to the required NFSv4 call structures.
Signed-off-by: Matthew N. Dodd <Matthew.Dodd@sparta.com>
Signed-off-by: Miguel Rodel Felipe <Rodel_FM@dsi.a-star.edu.sg>
Signed-off-by: Phua Eu Gene <PHUA_Eu_Gene@dsi.a-star.edu.sg>
Signed-off-by: Khin Mi Mi Aung <Mi_Mi_AUNG@dsi.a-star.edu.sg>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/inode.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index c1c7a9d78722..07fcf0b90669 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -257,6 +257,34 @@ nfs_init_locked(struct inode *inode, void *opaque) | |||
257 | return 0; | 257 | return 0; |
258 | } | 258 | } |
259 | 259 | ||
260 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL | ||
261 | struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) | ||
262 | { | ||
263 | struct nfs4_label *label = NULL; | ||
264 | int minor_version = server->nfs_client->cl_minorversion; | ||
265 | |||
266 | if (minor_version < 2) | ||
267 | return label; | ||
268 | |||
269 | if (!(server->caps & NFS_CAP_SECURITY_LABEL)) | ||
270 | return label; | ||
271 | |||
272 | label = kzalloc(sizeof(struct nfs4_label), flags); | ||
273 | if (label == NULL) | ||
274 | return ERR_PTR(-ENOMEM); | ||
275 | |||
276 | label->label = kzalloc(NFS4_MAXLABELLEN, flags); | ||
277 | if (label->label == NULL) { | ||
278 | kfree(label); | ||
279 | return ERR_PTR(-ENOMEM); | ||
280 | } | ||
281 | label->len = NFS4_MAXLABELLEN; | ||
282 | |||
283 | return label; | ||
284 | } | ||
285 | EXPORT_SYMBOL_GPL(nfs4_label_alloc); | ||
286 | #endif | ||
287 | |||
260 | /* | 288 | /* |
261 | * This is our front-end to iget that looks up inodes by file handle | 289 | * This is our front-end to iget that looks up inodes by file handle |
262 | * instead of inode number. | 290 | * instead of inode number. |