Skip to contentSkip to conversation

hostfs: get rid of file_type(), fold init_inode()

PATCH In review Al Viro 1 participant 1 message Jun 8, 2010

Subsystems (2)
lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 30/58 hostfs: get rid of file_type(), fold init_inode()

---
 fs/hostfs/hostfs.h      |    1 -
 fs/hostfs/hostfs_kern.c |  107 ++++++++++++++++++++---------------------------
 fs/hostfs/hostfs_user.c |   30 -------------
 3 files changed, 45 insertions(+), 93 deletions(-)
fs/hostfs/hostfs.h +0 -1
index 3a52ede..ea87e22 100644
@@ -70,7 +70,6 @@ struct hostfs_stat {
 extern int stat_file(const char *path, struct hostfs_stat *p, int fd);
 extern int access_file(char *path, int r, int w, int x);
 extern int open_file(char *path, int r, int w, int append);
-extern int file_type(const char *path, int *maj, int *min);
 extern void *open_dir(char *path, int *err_out);
 extern char *read_dir(void *stream, unsigned long long *pos,
 		      unsigned long long *ino_out, int *len_out);
fs/hostfs/hostfs_kern.c +45 -62

161 lines not on this page · raw message

fs/hostfs/hostfs_user.c +0 -30
index 701d454..91ebfce 100644
@@ -53,36 +53,6 @@ int stat_file(const char *path, struct hostfs_stat *p, int fd)
 	return 0;
 }
 
-int file_type(const char *path, int *maj, int *min)
-{
- 	struct stat64 buf;
-
-	if (lstat64(path, &buf) < 0)
-		return -errno;
-	/*
-	 * We cannot pass rdev as is because glibc and the kernel disagree
-	 * about its definition.
-	 */
-	if (maj != NULL)
-		*maj = os_major(buf.st_rdev);
-	if (min != NULL)
-		*min = os_minor(buf.st_rdev);
-
-	if (S_ISDIR(buf.st_mode))
-		return OS_TYPE_DIR;
-	else if (S_ISLNK(buf.st_mode))
-		return OS_TYPE_SYMLINK;
-	else if (S_ISCHR(buf.st_mode))
-		return OS_TYPE_CHARDEV;
-	else if (S_ISBLK(buf.st_mode))
-		return OS_TYPE_BLOCKDEV;
-	else if (S_ISFIFO(buf.st_mode))
-		return OS_TYPE_FIFO;
-	else if (S_ISSOCK(buf.st_mode))
-		return OS_TYPE_SOCK;
-	else return OS_TYPE_FILE;
-}
-
 int access_file(char *path, int r, int w, int x)
 {
 	int mode = 0;
Signature · 1 line
1.5.6.5