staging/lustre/llite: change it_data to it_request
[cascardo/linux.git] / drivers / staging / lustre / lustre / llite / dcache.c
index dd1c827..d964f4f 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -108,11 +104,8 @@ static int ll_dcompare(const struct dentry *parent, const struct dentry *dentry,
 
 static inline int return_if_equal(struct ldlm_lock *lock, void *data)
 {
-       if ((lock->l_flags &
-            (LDLM_FL_CANCELING | LDLM_FL_DISCARD_DATA)) ==
-           (LDLM_FL_CANCELING | LDLM_FL_DISCARD_DATA))
-               return LDLM_ITER_CONTINUE;
-       return LDLM_ITER_STOP;
+       return (ldlm_is_canceling(lock) && ldlm_is_discard_data(lock)) ?
+               LDLM_ITER_CONTINUE : LDLM_ITER_STOP;
 }
 
 /* find any ldlm lock of the inode in mdc and lov
@@ -209,27 +202,27 @@ int ll_d_init(struct dentry *de)
 
 void ll_intent_drop_lock(struct lookup_intent *it)
 {
-       if (it->it_op && it->d.lustre.it_lock_mode) {
+       if (it->it_op && it->it_lock_mode) {
                struct lustre_handle handle;
 
-               handle.cookie = it->d.lustre.it_lock_handle;
+               handle.cookie = it->it_lock_handle;
 
                CDEBUG(D_DLMTRACE, "releasing lock with cookie %#llx from it %p\n",
                       handle.cookie, it);
-               ldlm_lock_decref(&handle, it->d.lustre.it_lock_mode);
+               ldlm_lock_decref(&handle, it->it_lock_mode);
 
                /* bug 494: intent_release may be called multiple times, from
                 * this thread and we don't want to double-decref this lock
                 */
-               it->d.lustre.it_lock_mode = 0;
-               if (it->d.lustre.it_remote_lock_mode != 0) {
-                       handle.cookie = it->d.lustre.it_remote_lock_handle;
+               it->it_lock_mode = 0;
+               if (it->it_remote_lock_mode != 0) {
+                       handle.cookie = it->it_remote_lock_handle;
 
                        CDEBUG(D_DLMTRACE, "releasing remote lock with cookie%#llx from it %p\n",
                               handle.cookie, it);
                        ldlm_lock_decref(&handle,
-                                        it->d.lustre.it_remote_lock_mode);
-                       it->d.lustre.it_remote_lock_mode = 0;
+                                        it->it_remote_lock_mode);
+                       it->it_remote_lock_mode = 0;
                }
        }
 }
@@ -240,23 +233,23 @@ void ll_intent_release(struct lookup_intent *it)
        ll_intent_drop_lock(it);
        /* We are still holding extra reference on a request, need to free it */
        if (it_disposition(it, DISP_ENQ_OPEN_REF))
-               ptlrpc_req_finished(it->d.lustre.it_data); /* ll_file_open */
+               ptlrpc_req_finished(it->it_request); /* ll_file_open */
 
        if (it_disposition(it, DISP_ENQ_CREATE_REF)) /* create rec */
-               ptlrpc_req_finished(it->d.lustre.it_data);
+               ptlrpc_req_finished(it->it_request);
 
-       it->d.lustre.it_disposition = 0;
-       it->d.lustre.it_data = NULL;
+       it->it_disposition = 0;
+       it->it_request = NULL;
 }
 
 void ll_invalidate_aliases(struct inode *inode)
 {
        struct dentry *dentry;
 
-       CDEBUG(D_INODE, "marking dentries for ino %lu/%u(%p) invalid\n",
-              inode->i_ino, inode->i_generation, inode);
+       CDEBUG(D_INODE, "marking dentries for ino "DFID"(%p) invalid\n",
+              PFID(ll_inode2fid(inode)), inode);
 
-       ll_lock_dcache(inode);
+       spin_lock(&inode->i_lock);
        hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
                CDEBUG(D_DENTRY, "dentry in drop %pd (%p) parent %p inode %p flags %d\n",
                       dentry, dentry, dentry->d_parent,
@@ -264,7 +257,7 @@ void ll_invalidate_aliases(struct inode *inode)
 
                d_lustre_invalidate(dentry, 0);
        }
-       ll_unlock_dcache(inode);
+       spin_unlock(&inode->i_lock);
 }
 
 int ll_revalidate_it_finish(struct ptlrpc_request *request,
@@ -286,11 +279,11 @@ int ll_revalidate_it_finish(struct ptlrpc_request *request,
 
 void ll_lookup_finish_locks(struct lookup_intent *it, struct inode *inode)
 {
-       if (it->d.lustre.it_lock_mode && inode) {
+       if (it->it_lock_mode && inode) {
                struct ll_sb_info *sbi = ll_i2sbi(inode);
 
-               CDEBUG(D_DLMTRACE, "setting l_data to inode %p (%lu/%u)\n",
-                      inode, inode->i_ino, inode->i_generation);
+               CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"(%p)\n",
+                      PFID(ll_inode2fid(inode)), inode);
                ll_set_lock_data(sbi->ll_md_exp, inode, it, NULL);
        }