All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 06/10] ovl: rename ovl_fill_cache to ovl_dir_read
Date: Mon, 06 Sep 2010 10:50:29 +1000	[thread overview]
Message-ID: <20100906005029.20775.41664.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100906004829.20775.68828.stgit@localhost.localdomain>

ovl_fill_cache isn't only used for filling the cache - it is also used
to remove all whiteout files.  This can be a bit confusing.
So rename it to a more generic "ovl_dir_read" and rename the data
structure that is passed to it to "ovl_readdir_data".

Signed-off-by: NeilBrown <neilb@suse.de>
---
 fs/overlayfs/overlayfs.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/fs/overlayfs/overlayfs.c b/fs/overlayfs/overlayfs.c
index f9eea96..656cad7 100644
--- a/fs/overlayfs/overlayfs.c
+++ b/fs/overlayfs/overlayfs.c
@@ -88,7 +88,7 @@ struct ovl_cache_entry {
 	bool is_whiteout;
 };
 
-struct ovl_cache_callback {
+struct ovl_readdir_data {
 	struct ovl_cache_entry *list;
 	struct ovl_cache_entry **endp;
 	struct path path;
@@ -102,7 +102,7 @@ struct ovl_dir_file {
 	struct file *realfile;
 };
 
-static int ovl_cache_add_entry(struct ovl_cache_callback *cb,
+static int ovl_cache_add_entry(struct ovl_readdir_data *cb,
 				 const char *name, int namelen, u64 ino,
 				 unsigned int d_type, bool is_whiteout)
 {
@@ -161,7 +161,7 @@ static int ovl_cache_find_entry(struct ovl_cache_entry *start,
 static int ovl_fill_lower(void *buf, const char *name, int namlen,
 			    loff_t offset, u64 ino, unsigned int d_type)
 {
-	struct ovl_cache_callback *cb = buf;
+	struct ovl_readdir_data *cb = buf;
 
 	cb->count++;
 	if (!ovl_cache_find_entry(cb->list, name, namlen))
@@ -173,7 +173,7 @@ static int ovl_fill_lower(void *buf, const char *name, int namlen,
 static int ovl_fill_upper(void *buf, const char *name, int namlen,
 			  loff_t offset, u64 ino, unsigned int d_type)
 {
-	struct ovl_cache_callback *cb = buf;
+	struct ovl_readdir_data *cb = buf;
 	bool is_whiteout = false;
 
 	cb->count++;
@@ -195,7 +195,7 @@ out:
 	return cb->err;
 }
 
-static int ovl_fill_cache(struct path *realpath, struct ovl_cache_callback *cb,
+static int ovl_dir_read(struct path *realpath, struct ovl_readdir_data *cb,
 			  filldir_t filler)
 {
 	const struct cred *old_cred;
@@ -270,15 +270,15 @@ static int ovl_readdir(struct file *file, void *buf, filldir_t filler)
 	}
 
 	if (!od->cache) {
-		struct ovl_cache_callback cb = {
+		struct ovl_readdir_data cb = {
 			.list = NULL,
 			.endp = &cb.list,
 			.path = ue->upperpath,
 		};
 
-		res = ovl_fill_cache(&ue->upperpath, &cb, ovl_fill_upper);
+		res = ovl_dir_read(&ue->upperpath, &cb, ovl_fill_upper);
 		if (!res) {
-			res = ovl_fill_cache(&ue->lowerpath, &cb,
+			res = ovl_dir_read(&ue->lowerpath, &cb,
 					     ovl_fill_lower);
 		}
 		if (res)
@@ -1292,18 +1292,18 @@ static int ovl_check_empty_dir(struct dentry *dentry)
 	int err;
 	struct ovl_entry *ue = dentry->d_fsdata;
 	struct ovl_cache_entry *p;
-	struct ovl_cache_callback cb = {
+	struct ovl_readdir_data cb = {
 		.list = NULL,
 		.endp = &cb.list,
 		.path = ue->upperpath,
 	};
 
 	if (ue->upperpath.dentry) {
-		err = ovl_fill_cache(&ue->upperpath, &cb, ovl_fill_upper);
+		err = ovl_dir_read(&ue->upperpath, &cb, ovl_fill_upper);
 		if (err)
 			return err;
 	}
-	err = ovl_fill_cache(&ue->lowerpath, &cb, ovl_fill_lower);
+	err = ovl_dir_read(&ue->lowerpath, &cb, ovl_fill_lower);
 	if (err)
 		return err;
 
@@ -1330,7 +1330,7 @@ static int ovl_check_empty_dir(struct dentry *dentry)
 static int ovl_unlink_whiteout(void *buf, const char *name, int namlen,
 				 loff_t offset, u64 ino, unsigned int d_type)
 {
-	struct ovl_cache_callback *cb = buf;
+	struct ovl_readdir_data *cb = buf;
 
 	cb->count++;
 	/* check d_type to filter out "." and ".." */
@@ -1352,7 +1352,7 @@ static int ovl_unlink_whiteout(void *buf, const char *name, int namlen,
 static int ovl_remove_whiteouts(struct dentry *dentry)
 {
 	struct ovl_entry *ue = dentry->d_fsdata;
-	struct ovl_cache_callback cb = {
+	struct ovl_readdir_data cb = {
 		.list = NULL,
 		.path = ue->upperpath,
 	};
@@ -1360,7 +1360,7 @@ static int ovl_remove_whiteouts(struct dentry *dentry)
 	if (!ue->upperpath.dentry)
 		return 0;
 
-	return ovl_fill_cache(&ue->upperpath, &cb, ovl_unlink_whiteout);
+	return ovl_dir_read(&ue->upperpath, &cb, ovl_unlink_whiteout);
 }
 
 static int ovl_rmdir(struct inode *dir, struct dentry *dentry)



  parent reply	other threads:[~2010-09-06  0:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-06  0:50 [PATCH 00/10] Assorted fixes/enhancements for overlayfs NeilBrown
2010-09-06  0:50 ` [PATCH 03/10] ovl: use correct seek function for directories NeilBrown
2010-09-06  0:50 ` [PATCH 01/10] ovl: small optimisation for ovl_lookup NeilBrown
2010-09-06 16:57   ` Miklos Szeredi
2010-09-06  0:50 ` [PATCH 02/10] ovl: minimal remount support NeilBrown
2010-09-06  0:50 ` [PATCH 10/10] ovl: Assorted updates to Documentation/filesystems/overlayfs.txt NeilBrown
2010-09-06  0:50 ` [PATCH 09/10] VFS: Remove read-only checks from dentry_permission NeilBrown
2010-09-06 19:10   ` Miklos Szeredi
2010-09-08  7:47     ` Neil Brown
2010-09-08  8:58       ` Miklos Szeredi
2010-09-07 15:58   ` Dave Hansen
2010-09-06  0:50 ` [PATCH 04/10] ovl: initialise is_real before use NeilBrown
2010-09-06  0:50 ` [PATCH 07/10] ovl: add initial revalidate support NeilBrown
2010-09-16 14:47   ` Miklos Szeredi
2010-09-21  2:40     ` Neil Brown
2010-09-06  0:50 ` NeilBrown [this message]
2010-09-06  0:50 ` [PATCH 08/10] VFS: tiny optimisation in open_other handling NeilBrown
2010-09-06  0:50 ` [PATCH 05/10] ovl: make sure fsync is never called on the lower filesystem NeilBrown
2010-09-06 17:16   ` Miklos Szeredi
2010-09-06 19:23 ` [PATCH 00/10] Assorted fixes/enhancements for overlayfs Miklos Szeredi

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=20100906005029.20775.41664.stgit@localhost.localdomain \
    --to=neilb@suse.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.