ovl: use generic_readlink

All filesystems that are backers for overlayfs would also use
generic_readlink(). Move this logic to the overlay itself, which is a nice
cleanup.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>

+1 -20
+1 -20
fs/overlayfs/inode.c
··· 176 176 return p; 177 177 } 178 178 179 - static int ovl_readlink(struct dentry *dentry, char __user *buf, int bufsiz) 180 - { 181 - struct path realpath; 182 - struct inode *realinode; 183 - const struct cred *old_cred; 184 - int err; 185 - 186 - ovl_path_real(dentry, &realpath); 187 - realinode = realpath.dentry->d_inode; 188 - 189 - if (!realinode->i_op->readlink) 190 - return -EINVAL; 191 - 192 - old_cred = ovl_override_creds(dentry->d_sb); 193 - err = realinode->i_op->readlink(realpath.dentry, buf, bufsiz); 194 - revert_creds(old_cred); 195 - return err; 196 - } 197 - 198 179 bool ovl_is_private_xattr(const char *name) 199 180 { 200 181 return strncmp(name, OVL_XATTR_PREFIX, ··· 362 381 static const struct inode_operations ovl_symlink_inode_operations = { 363 382 .setattr = ovl_setattr, 364 383 .get_link = ovl_get_link, 365 - .readlink = ovl_readlink, 384 + .readlink = generic_readlink, 366 385 .getattr = ovl_getattr, 367 386 .setxattr = generic_setxattr, 368 387 .getxattr = generic_getxattr,