mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Josef 'Jeff' Sipek" <jsipek@cs.sunysb.edu>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Cc: akpm@linux-foundation.org, "Josef 'Jeff' Sipek" <jsipek@cs.sunysb.edu>
Subject: [PATCH 13/16] Unionfs: Change free_dentry_private_info to take a struct dentry
Date: Sun, 17 Jun 2007 15:09:20 -0400	[thread overview]
Message-ID: <11821073642904-git-send-email-jsipek@cs.sunysb.edu> (raw)
In-Reply-To: <11821073632989-git-send-email-jsipek@cs.sunysb.edu>

This makes it more symmetric with new_dentry_private_info.

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
---
 fs/unionfs/dentry.c |    3 +--
 fs/unionfs/lookup.c |   13 ++++++-------
 fs/unionfs/main.c   |    2 +-
 fs/unionfs/union.h  |    2 +-
 4 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/fs/unionfs/dentry.c b/fs/unionfs/dentry.c
index db0ef43..9bd521b 100644
--- a/fs/unionfs/dentry.c
+++ b/fs/unionfs/dentry.c
@@ -334,8 +334,7 @@ static void unionfs_d_release(struct dentry *dentry)
 
 out_free:
 	/* No need to unlock it, because it is disappeared. */
-	free_dentry_private_data(UNIONFS_D(dentry));
-	dentry->d_fsdata = NULL;	/* just to be safe */
+	free_dentry_private_data(dentry);
 
 out:
 	return;
diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c
index 246a67a..8a09540 100644
--- a/fs/unionfs/lookup.c
+++ b/fs/unionfs/lookup.c
@@ -452,11 +452,12 @@ void unionfs_destroy_dentry_cache(void)
 		kmem_cache_destroy(unionfs_dentry_cachep);
 }
 
-void free_dentry_private_data(struct unionfs_dentry_info *udi)
+void free_dentry_private_data(struct dentry *dentry)
 {
-	if (!udi)
+	if (!dentry || !dentry->d_fsdata)
 		return;
-	kmem_cache_free(unionfs_dentry_cachep, udi);
+	kmem_cache_free(unionfs_dentry_cachep, dentry->d_fsdata);
+	dentry->d_fsdata = NULL;
 }
 
 static inline int __realloc_dentry_private_data(struct dentry *dentry)
@@ -493,8 +494,7 @@ int realloc_dentry_private_data(struct dentry *dentry)
 		return 0;
 
 	kfree(UNIONFS_D(dentry)->lower_paths);
-	free_dentry_private_data(UNIONFS_D(dentry));
-	dentry->d_fsdata = NULL;
+	free_dentry_private_data(dentry);
 	return -ENOMEM;
 }
 
@@ -520,8 +520,7 @@ int new_dentry_private_data(struct dentry *dentry)
 		return 0;
 
 	mutex_unlock(&info->lock);
-	free_dentry_private_data(info);
-	dentry->d_fsdata = NULL;
+	free_dentry_private_data(dentry);
 	return -ENOMEM;
 }
 
diff --git a/fs/unionfs/main.c b/fs/unionfs/main.c
index 2bcc84c..b9fe431 100644
--- a/fs/unionfs/main.c
+++ b/fs/unionfs/main.c
@@ -632,7 +632,7 @@ static int unionfs_read_super(struct super_block *sb, void *raw_data,
 out_freedpd:
 	if (UNIONFS_D(sb->s_root)) {
 		kfree(UNIONFS_D(sb->s_root)->lower_paths);
-		free_dentry_private_data(UNIONFS_D(sb->s_root));
+		free_dentry_private_data(sb->s_root);
 	}
 	dput(sb->s_root);
 
diff --git a/fs/unionfs/union.h b/fs/unionfs/union.h
index 7e0c318..6eb151e 100644
--- a/fs/unionfs/union.h
+++ b/fs/unionfs/union.h
@@ -235,7 +235,7 @@ static inline void unionfs_double_lock_dentry(struct dentry *d1,
 
 extern int realloc_dentry_private_data(struct dentry *dentry);
 extern int new_dentry_private_data(struct dentry *dentry);
-extern void free_dentry_private_data(struct unionfs_dentry_info *udi);
+extern void free_dentry_private_data(struct dentry *dentry);
 extern void update_bstart(struct dentry *dentry);
 
 /*
-- 
1.5.2.rc1.165.gaf9b


  parent reply	other threads:[~2007-06-17 19:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-17 19:09 [GIT PULL -mm] Unionfs cleanups, fixes, and mmap Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 01/16] [PATCH] unionfs section mismatch Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 02/16] Unionfs: Don't revalidate dropped dentries Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 03/16] Unionfs: Retry lookup for different silly-renamed files Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 04/16] Unionfs: Set lower inodes correctly after branch management succeeds Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 05/16] Unionfs: call statfs on lower file system properly Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 06/16] MAINTAINERS: Add Erez Zadok as a maintainer of Unionfs Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 07/16] Unionfs: Add standard copyright comment to include/linux/union_fs.h Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 08/16] Unionfs: Remove unnecessary #define Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 09/16] Unionfs: mmap implementation Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 10/16] Unionfs: merge find_new_branch_index and branch_id_to_idx into one function Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 11/16] Unionfs: Revalidate dentries passed to all inode/super operations Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 12/16] Unionfs: Cleanup new_dentry_private_data Josef 'Jeff' Sipek
2007-06-17 19:09 ` Josef 'Jeff' Sipek [this message]
2007-06-17 19:09 ` [PATCH 14/16] Unionfs: Add BUG_ONs to unionfs_lower_* Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 15/16] Unionfs: Change the semantics of sb info's rwsem Josef 'Jeff' Sipek
2007-06-17 19:09 ` [PATCH 16/16] Unionfs: Remove superfluous check for NULL pointer Josef 'Jeff' Sipek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11821073642904-git-send-email-jsipek@cs.sunysb.edu \
    --to=jsipek@cs.sunysb.edu \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®