Whamcloud - gitweb
- Added match_or_enqueue helper function
[fs/lustre-release.git] / lustre / llite / dcache.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * This code is issued under the GNU General Public License.
5  * See the file COPYING in this distribution
6  *
7  * Copyright (C) 2001, 2002 Cluster File Systems, Inc.
8  *
9  */
10
11 #include <linux/fs.h>
12 #include <linux/locks.h>
13 #include <linux/quotaops.h>
14
15 #define DEBUG_SUBSYSTEM S_LLITE
16
17 #include <linux/obd_support.h>
18 #include <linux/lustre_lite.h>
19
20 extern struct address_space_operations ll_aops;
21
22 void ll_intent_release(struct dentry *de)
23 {
24         struct lustre_handle *handle;
25         ENTRY;
26
27         if (de->d_it == NULL) {
28                 EXIT;
29                 return;
30         }
31         if (de->d_it->it_lock_mode) {
32                 handle = (struct lustre_handle *)de->d_it->it_lock_handle;
33                 if (de->d_it->it_op == IT_SETATTR) {
34                         int rc;
35                         ldlm_lock_decref(handle, de->d_it->it_lock_mode);
36                         rc = ldlm_cli_cancel(handle);
37                         if (rc < 0)
38                                 CERROR("ldlm_cli_cancel: %d\n", rc);
39                 } else
40                         ldlm_lock_decref(handle, de->d_it->it_lock_mode);
41         }
42         de->d_it = NULL;
43         EXIT;
44 }
45
46 int ll_revalidate2(struct dentry *de, int flags, struct lookup_intent *it)
47 {
48         ENTRY;
49
50         RETURN(0);
51 }
52
53 struct dentry_operations ll_d_ops = {
54         d_revalidate2: ll_revalidate2,
55         d_intent_release: ll_intent_release
56 };