Whamcloud - gitweb
LU-4423 llite: remove ll_readlink as unnecessary
[fs/lustre-release.git] / lustre / llite / symlink.c
index 6b43a05..e394efa 100644 (file)
@@ -86,16 +86,16 @@ static int ll_readlink_internal(struct inode *inode,
 
         body = req_capsule_server_get(&(*request)->rq_pill, &RMF_MDT_BODY);
         LASSERT(body != NULL);
-        if ((body->valid & OBD_MD_LINKNAME) == 0) {
-                CERROR("OBD_MD_LINKNAME not set on reply\n");
-                GOTO(failed, rc = -EPROTO);
-        }
+       if ((body->mbo_valid & OBD_MD_LINKNAME) == 0) {
+               CERROR("OBD_MD_LINKNAME not set on reply\n");
+               GOTO(failed, rc = -EPROTO);
+       }
 
-        LASSERT(symlen != 0);
-        if (body->eadatasize != symlen) {
+       LASSERT(symlen != 0);
+       if (body->mbo_eadatasize != symlen) {
                CERROR("%s: inode "DFID": symlink length %d not expected %d\n",
                       ll_get_fsname(inode->i_sb, NULL, 0),
-                      PFID(ll_inode2fid(inode)), body->eadatasize - 1,
+                      PFID(ll_inode2fid(inode)), body->mbo_eadatasize - 1,
                       symlen - 1);
                 GOTO(failed, rc = -EPROTO);
         }
@@ -122,34 +122,12 @@ failed:
         RETURN (rc);
 }
 
-static int ll_readlink(struct dentry *dentry, char *buffer, int buflen)
-{
-        struct inode *inode = dentry->d_inode;
-        struct ptlrpc_request *request;
-        char *symname;
-        int rc;
-        ENTRY;
-
-        CDEBUG(D_VFSTRACE, "VFS Op\n");
-
-       ll_inode_size_lock(inode);
-        rc = ll_readlink_internal(inode, &request, &symname);
-        if (rc)
-                GOTO(out, rc);
-
-        rc = vfs_readlink(dentry, buffer, buflen, symname);
- out:
-        ptlrpc_req_finished(request);
-       ll_inode_size_unlock(inode);
-       RETURN(rc);
-}
-
 static void *ll_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
        struct inode *inode = dentry->d_inode;
        struct ptlrpc_request *request = NULL;
        int rc;
-       char *symname;
+       char *symname = NULL;
        ENTRY;
 
         CDEBUG(D_VFSTRACE, "VFS Op\n");
@@ -184,7 +162,7 @@ static void ll_put_link(struct dentry *dentry, struct nameidata *nd, void *cooki
 }
 
 struct inode_operations ll_fast_symlink_inode_operations = {
-       .readlink       = ll_readlink,
+       .readlink       = generic_readlink,
        .setattr        = ll_setattr,
        .follow_link    = ll_follow_link,
        .put_link       = ll_put_link,