diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2017-05-03 17:19:57 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2018-01-03 15:19:25 +0000 |
commit | 16e3d4102eb119fc9816a0ad3f4c487c0d0823b6 (patch) | |
tree | f6cfc37786dbce2d0dca4256d0d32c4a600423fb /libglusterfs/src/inode.h | |
parent | fcdec185173f8da44e879c6fc592c0c0a8876728 (diff) |
gfapi: fix handling of dot and double dot in path
This patch is to handle "." and ".." in file path. Which means
this special dentry names will be resolved before sending fops
on the path.
Change-Id: I5e92f6d1ad1412bf432eb2488e53fb7731edb013
BUG: 1530341
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: https://review.gluster.org/17177
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
(cherry picked from commit 269e2ccf45ddc662d8373eb887ae6cef96e2ef37)
Diffstat (limited to 'libglusterfs/src/inode.h')
-rw-r--r-- | libglusterfs/src/inode.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h index cdc2095a0e8..253196378a8 100644 --- a/libglusterfs/src/inode.h +++ b/libglusterfs/src/inode.h @@ -286,4 +286,21 @@ inode_has_dentry (inode_t *inode); size_t inode_ctx_size (inode_t *inode); +/* + * This function is used to change the dentry from a path + * if it contains any "." or ".." . + * + * It replaces "." and ".." to proper bname after resolving + * and will change the component accordingly. + * + * This fucntion also replaces the parent inode based on the + * bname. + * + * We should give a allocated memory as a third argument to store + * the component in case if we are modifying it. + */ + +void +glusterfs_normalize_dentry (inode_t **parent, char **component, + char *dentry_name); #endif /* _INODE_H */ |