mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 11/11] fs: squashfs: Remove unused function
Date: Mon, 18 Mar 2019 10:14:54 +0100	[thread overview]
Message-ID: <20190318091454.11386-12-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20190318091454.11386-1-s.hauer@pengutronix.de>

squashfs_lookup_next() isn't used in the tree. Remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 fs/squashfs/namei.c | 108 --------------------------------------------
 1 file changed, 108 deletions(-)

diff --git a/fs/squashfs/namei.c b/fs/squashfs/namei.c
index baf1e8b646..62a07d2467 100644
--- a/fs/squashfs/namei.c
+++ b/fs/squashfs/namei.c
@@ -238,114 +238,6 @@ failed:
 	return ERR_PTR(err);
 }
 
-int squashfs_lookup_next(struct inode *dir, char *root_name,
-				 char *cur_name)
-{
-	const unsigned char *name = root_name;
-	int len = strlen(root_name);
-	struct squashfs_sb_info *msblk = dir->i_sb->s_fs_info;
-	struct squashfs_dir_header dirh;
-	struct squashfs_dir_entry *dire;
-	u64 block = squashfs_i(dir)->start + msblk->directory_table;
-	int offset = squashfs_i(dir)->offset;
-	int err, length;
-	unsigned int dir_count, size;
-	int name_found = 0, real_name_found = 0;
-
-	TRACE("Entered squashfs_lookup_next [%llx:%x]\n", block, offset);
-
-	dire = kmalloc(sizeof(*dire) + SQUASHFS_NAME_LEN + 1, GFP_KERNEL);
-	if (dire == NULL) {
-		ERROR("Failed to allocate squashfs_dir_entry\n");
-		return -ENOMEM;
-	}
-
-	if (len > SQUASHFS_NAME_LEN) {
-		err = -ENAMETOOLONG;
-		goto failed;
-	}
-
-	length = get_dir_index_using_name(dir->i_sb, &block, &offset,
-				squashfs_i(dir)->dir_idx_start,
-				squashfs_i(dir)->dir_idx_offset,
-				squashfs_i(dir)->dir_idx_cnt, name, len);
-
-	while (length < i_size_read(dir)) {
-		/*
-		 * Read directory header.
-		 */
-		err = squashfs_read_metadata(dir->i_sb, &dirh, &block,
-				&offset, sizeof(dirh));
-		if (err < 0)
-			goto read_failure;
-
-		length += sizeof(dirh);
-
-		dir_count = le32_to_cpu(dirh.count) + 1;
-
-		if (dir_count > SQUASHFS_DIR_COUNT)
-			goto data_error;
-
-		while (dir_count--) {
-			/*
-			 * Read directory entry.
-			 */
-			err = squashfs_read_metadata(dir->i_sb, dire, &block,
-					&offset, sizeof(*dire));
-			if (err < 0)
-				goto read_failure;
-
-			size = le16_to_cpu(dire->size) + 1;
-
-			/* size should never be larger than SQUASHFS_NAME_LEN */
-			if (size > SQUASHFS_NAME_LEN)
-				goto data_error;
-
-			err = squashfs_read_metadata(dir->i_sb, dire->name,
-					&block, &offset, size);
-			if (err < 0)
-				goto read_failure;
-
-			length += sizeof(*dire) + size;
-			dire->name[size] = '\0';
-
-			if (cur_name[0] == '/')
-				name_found = 1;
-
-			if (!strcmp(cur_name, name))
-				name_found = 1;
-
-			if (cur_name[0] != '/'
-			    && strlen(cur_name) == size
-			    && !strncmp(cur_name, dire->name, size)) {
-				name_found = 1;
-				continue;
-			}
-
-			if (name_found) {
-				sprintf(cur_name, "%s", dire->name);
-				real_name_found = 1;
-				goto exit_lookup;
-			}
-		}
-	}
-
-exit_lookup:
-	kfree(dire);
-	return real_name_found ? 0 : 1;
-
-data_error:
-	err = -EIO;
-
-read_failure:
-	ERROR("Unable to read directory block [%llx:%x]\n",
-		squashfs_i(dir)->start + msblk->directory_table,
-		squashfs_i(dir)->offset);
-failed:
-	kfree(dire);
-	return 1;
-}
-
 const struct inode_operations squashfs_dir_inode_ops = {
 	.lookup = squashfs_lookup,
 };
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2019-03-18  9:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18  9:14 [PATCH 00/11] Fix -Wmissing-prototypes warnings Sascha Hauer
2019-03-18  9:14 ` [PATCH 01/11] ARM: semihosting: Fix function prototype Sascha Hauer
2019-03-18  9:14 ` [PATCH 02/11] treewide: Make locally used functions static Sascha Hauer
2019-03-18  9:14 ` [PATCH 03/11] treewide: Add missing includes Sascha Hauer
2019-03-18  9:14 ` [PATCH 04/11] ARM: i.MX: external-nand-boot: remove unused i.MX21 entry Sascha Hauer
2019-03-18  9:14 ` [PATCH 05/11] ARM: boards: Harmonize barebox_arm_reset_vector() prototype Sascha Hauer
2019-03-18 10:31   ` Roland Hieber
2019-03-18 10:41     ` Sascha Hauer
2019-03-18  9:14 ` [PATCH 06/11] ARM: sha256: Remove unused functions Sascha Hauer
2019-03-18  9:14 ` [PATCH 07/11] ARM: sha256: Remove unused header file Sascha Hauer
2019-03-18  9:14 ` [PATCH 08/11] ARM: PXA: Provide prototype for pxa_clear_reset_source() Sascha Hauer
2019-03-18  9:14 ` [PATCH 09/11] bus: mvebu-mbus: Add missing whitespace Sascha Hauer
2019-03-18  9:14 ` [PATCH 10/11] mfd: twl-core: Add missing prototype for twlcore_get() Sascha Hauer
2019-03-18  9:14 ` Sascha Hauer [this message]

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=20190318091454.11386-12-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.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