[PATCH 14/61] smb: remove cifs_uniqueid_to_ino_t()

Jeff Layton <[email protected]>
Newsgroups org.kernel.vger.ecryptfs,dev.linux.lists.fsverity,dev.linux.lists.netfs,dev.linux.lists.ntfs3,dev.linux.lists.nvdimm,dev.linux.lists.ocfs2-devel,dev.linux.lists.v9fs,net.sourceforge.lists.linux-f2fs-devel,org.freedesktop.lists.amd-gfx,org.infradead.lists.linux-mtd,org.kernel.vger.autofs,org.kernel.vger.ceph-devel,org.kernel.vger.linux-cifs,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fscrypt,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-hams,org.kernel.vger.linux-integrity,org.kernel.vger.linux-kernel,org.kernel.vger.linux-media,org.kernel.vger.linux-nfs,org.kernel.vger.linux-nilfs,org.kernel.vger.linux-perf-users,org.kernel.vger.linux-security-module,org.kernel.vger.linux-trace-kernel,org.kernel.vger.linux-unionfs,org.kernel.vger.linux-x25,org.kernel.vger.linux-xfs,org.kernel.vger.netdev,org.kernel.vger.selinux,org.kvack.linux-mm
Message-ID <[email protected]>
Now that i_ino is u64, cifs_uniqueid_to_ino_t() is a trivial identity
function. Remove it and use fattr->cf_uniqueid directly at both call
sites.

Also remove the now-unused #include <linux/hash.h>, which was only
needed for the old XOR-folding logic.

Signed-off-by: Jeff Layton <[email protected]>
---
 fs/smb/client/cifsfs.h  | 11 -----------
 fs/smb/client/inode.c   |  2 +-
 fs/smb/client/readdir.c |  2 +-
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/fs/smb/client/cifsfs.h b/fs/smb/client/cifsfs.h
index 4a1f18022c711a7ff5b141d08ec6cac8483a6b6a..f71b490b548c0274f314dd0dc76bf570ee3cfd09 100644
--- a/fs/smb/client/cifsfs.h
+++ b/fs/smb/client/cifsfs.h
@@ -9,19 +9,8 @@
 #ifndef _CIFSFS_H
 #define _CIFSFS_H
 
-#include <linux/hash.h>
-
 #define ROOT_I 2
 
-/*
- * With i_ino being u64, we can store the full 64-bit uniqueid directly.
- */
-static inline u64
-cifs_uniqueid_to_ino_t(u64 fileid)
-{
-	return fileid;
-}
-
 static inline void cifs_set_time(struct dentry *dentry, unsigned long time)
 {
 	dentry->d_fsdata = (void *) time;
diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
index 102e7615b658726551e9b01ba25065d1f0c505ac..a82f4fbf8146572e522080bcd7df41153403978d 100644
--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -1618,7 +1618,7 @@ cifs_iget(struct super_block *sb, struct cifs_fattr *fattr)
 	cifs_dbg(FYI, "looking for uniqueid=%llu\n", fattr->cf_uniqueid);
 
 	/* With u64 i_ino, we can use the full uniqueid */
-	hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid);
+	hash = fattr->cf_uniqueid;
 
 	inode = iget5_locked(sb, hash, cifs_find_inode, cifs_init_inode, fattr);
 	if (inode) {
diff --git a/fs/smb/client/readdir.c b/fs/smb/client/readdir.c
index 8615a8747b7f0127a781b9b3795535df4c9b73cd..cec74bd2e2302c3baeba8d7e1348ba5114d4b1e4 100644
--- a/fs/smb/client/readdir.c
+++ b/fs/smb/client/readdir.c
@@ -919,7 +919,7 @@ static bool cifs_dir_emit(struct dir_context *ctx,
 {
 	size_t delta_bytes = 0;
 	bool rc, added = false;
-	ino_t ino = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid);
+	ino_t ino = fattr->cf_uniqueid;
 
 	rc = dir_emit(ctx, name, namelen, ino, fattr->cf_dtype);
 	if (!rc)

-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.