Whamcloud - gitweb
LU-56 libcfs: CPT affinity workitem scheduler
[fs/lustre-release.git] / libsysio / src / link.c
index 4c278b5..638bd7e 100644 (file)
@@ -67,7 +67,7 @@ SYSIO_INTERFACE_NAME(link)(const char *oldpath, const char *newpath)
        err = _sysio_namei(_sysio_cwd, oldpath, 0, &intent, &old);
        if (err)
                goto out;
-       if (S_ISDIR(old->p_base->pb_ino->i_mode)) {
+       if (S_ISDIR(old->p_base->pb_ino->i_stbuf.st_mode)) {
                err = -EPERM;
                goto error1;
        }
@@ -84,7 +84,12 @@ SYSIO_INTERFACE_NAME(link)(const char *oldpath, const char *newpath)
                err = -EXDEV;
                goto error2;
        }
-       err = old->p_base->pb_ino->i_ops.inop_link(old, new);
+       /*
+        * Use the parent node operations to request the task in case the
+        * driver is implemented using differentiated inode operations based
+        * on file type, such as incore does.
+        */
+       err = old->p_parent->p_base->pb_ino->i_ops.inop_link(old, new);
        if (err)
                goto error2;
        /*