aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/llite/dcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/lustre/llite/dcache.c')
-rw-r--r--drivers/staging/lustre/lustre/llite/dcache.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c
index 3d6745e63fe3..dd1c827013b9 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -60,9 +60,9 @@ static void ll_release(struct dentry *de)
{
struct ll_dentry_data *lld;
- LASSERT(de != NULL);
+ LASSERT(de);
lld = ll_d2d(de);
- if (lld == NULL) /* NFS copies the de->d_op methods (bug 4655) */
+ if (!lld) /* NFS copies the de->d_op methods (bug 4655) */
return;
if (lld->lld_it) {
@@ -80,7 +80,8 @@ static void ll_release(struct dentry *de)
* This avoids a race where ll_lookup_it() instantiates a dentry, but we get
* an AST before calling d_revalidate_it(). The dentry still exists (marked
* INVALID) so d_lookup() matches it, but we have no lock on it (so
- * lock_match() fails) and we spin around real_lookup(). */
+ * lock_match() fails) and we spin around real_lookup().
+ */
static int ll_dcompare(const struct dentry *parent, const struct dentry *dentry,
unsigned int len, const char *str,
const struct qstr *name)
@@ -117,7 +118,8 @@ static inline int return_if_equal(struct ldlm_lock *lock, void *data)
/* find any ldlm lock of the inode in mdc and lov
* return 0 not find
* 1 find one
- * < 0 error */
+ * < 0 error
+ */
static int find_cbdata(struct inode *inode)
{
struct ll_sb_info *sbi = ll_i2sbi(inode);
@@ -131,7 +133,7 @@ static int find_cbdata(struct inode *inode)
return rc;
lsm = ccc_inode_lsm_get(inode);
- if (lsm == NULL)
+ if (!lsm)
return rc;
rc = obd_find_cbdata(sbi->ll_dt_exp, lsm, return_if_equal, NULL);
@@ -163,10 +165,12 @@ static int ll_ddelete(const struct dentry *de)
/* Disable this piece of code temporarily because this is called
* inside dcache_lock so it's not appropriate to do lots of work
* here. ATTENTION: Before this piece of code enabling, LU-2487 must be
- * resolved. */
+ * resolved.
+ */
#if 0
/* if not ldlm lock for this inode, set i_nlink to 0 so that
- * this inode can be recycled later b=20433 */
+ * this inode can be recycled later b=20433
+ */
if (d_really_is_positive(de) && !find_cbdata(d_inode(de)))
clear_nlink(d_inode(de));
#endif
@@ -178,19 +182,16 @@ static int ll_ddelete(const struct dentry *de)
int ll_d_init(struct dentry *de)
{
- LASSERT(de != NULL);
-
CDEBUG(D_DENTRY, "ldd on dentry %pd (%p) parent %p inode %p refc %d\n",
- de, de, de->d_parent, d_inode(de),
- d_count(de));
+ de, de, de->d_parent, d_inode(de), d_count(de));
- if (de->d_fsdata == NULL) {
+ if (!de->d_fsdata) {
struct ll_dentry_data *lld;
lld = kzalloc(sizeof(*lld), GFP_NOFS);
if (likely(lld)) {
spin_lock(&de->d_lock);
- if (likely(de->d_fsdata == NULL)) {
+ if (likely(!de->d_fsdata)) {
de->d_fsdata = lld;
__d_lustre_invalidate(de);
} else {
@@ -218,7 +219,8 @@ void ll_intent_drop_lock(struct lookup_intent *it)
ldlm_lock_decref(&handle, it->d.lustre.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 */
+ * 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;
@@ -251,8 +253,6 @@ void ll_invalidate_aliases(struct inode *inode)
{
struct dentry *dentry;
- LASSERT(inode != NULL);
-
CDEBUG(D_INODE, "marking dentries for ino %lu/%u(%p) invalid\n",
inode->i_ino, inode->i_generation, inode);
@@ -286,9 +286,7 @@ int ll_revalidate_it_finish(struct ptlrpc_request *request,
void ll_lookup_finish_locks(struct lookup_intent *it, struct inode *inode)
{
- LASSERT(it != NULL);
-
- if (it->d.lustre.it_lock_mode && inode != NULL) {
+ if (it->d.lustre.it_lock_mode && inode) {
struct ll_sb_info *sbi = ll_i2sbi(inode);
CDEBUG(D_DLMTRACE, "setting l_data to inode %p (%lu/%u)\n",
@@ -300,7 +298,8 @@ void ll_lookup_finish_locks(struct lookup_intent *it, struct inode *inode)
if (it->it_op == IT_LOOKUP || it->it_op == IT_GETATTR) {
/* on 2.6 there are situation when several lookups and
* revalidations may be requested during single operation.
- * therefore, we don't release intent here -bzzz */
+ * therefore, we don't release intent here -bzzz
+ */
ll_intent_drop_lock(it);
}
}
@@ -328,7 +327,7 @@ static int ll_revalidate_dentry(struct dentry *dentry,
if (lookup_flags & LOOKUP_RCU)
return -ECHILD;
- do_statahead_enter(dir, &dentry, d_inode(dentry) == NULL);
+ do_statahead_enter(dir, &dentry, !d_inode(dentry));
ll_statahead_mark(dir, dentry);
return 1;
}