Using d_is_symlink() is preferred to testing ->get_link or
->follow_link.
A recent patch made this work for foreign files/dirs by making sure
the entry type in d_flags is correct, so we can simplify the code in
ll_revalidate_dentry().
Fixes:
15d44e787e17 ("LU-12682 llite: fake symlink type of foreign file/dir")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ie4c33ae1fb9a660ccbd50e2c70b6cde65cc9b990
Reviewed-on: https://review.whamcloud.com/41770
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
* real symlinks. This will allow to open foreign symlink file/dir
* for get[dir]stripe/unlock ioctl()s.
*/
-#ifdef HAVE_IOP_GET_LINK
- if (dentry->d_inode && dentry->d_inode->i_op->get_link) {
-#else
- if (dentry->d_inode && dentry->d_inode->i_op->follow_link) {
-#endif
+ if (d_is_symlink(dentry)) {
if (!S_ISLNK(dentry->d_inode->i_mode) &&
!(lookup_flags & LOOKUP_FOLLOW))
return 0;