aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hostfs/hostfs_user.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-06-06 20:33:12 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 16:48:10 -0400
commit4754b825571a6f2f7655245e420e8e486c4458f6 (patch)
tree5d24fe048b982c3e321fcde24a883ce999a4a4f5 /fs/hostfs/hostfs_user.c
parent39b743c6199a317ffac67fcae1dd05be3142633a (diff)
hostfs: get rid of file_type(), fold init_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hostfs/hostfs_user.c')
-rw-r--r--fs/hostfs/hostfs_user.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/fs/hostfs/hostfs_user.c b/fs/hostfs/hostfs_user.c
index 701d454a6791..91ebfcefa409 100644
--- a/fs/hostfs/hostfs_user.c
+++ b/fs/hostfs/hostfs_user.c
@@ -53,36 +53,6 @@ int stat_file(const char *path, struct hostfs_stat *p, int fd)
53 return 0; 53 return 0;
54} 54}
55 55
56int file_type(const char *path, int *maj, int *min)
57{
58 struct stat64 buf;
59
60 if (lstat64(path, &buf) < 0)
61 return -errno;
62 /*
63 * We cannot pass rdev as is because glibc and the kernel disagree
64 * about its definition.
65 */
66 if (maj != NULL)
67 *maj = os_major(buf.st_rdev);
68 if (min != NULL)
69 *min = os_minor(buf.st_rdev);
70
71 if (S_ISDIR(buf.st_mode))
72 return OS_TYPE_DIR;
73 else if (S_ISLNK(buf.st_mode))
74 return OS_TYPE_SYMLINK;
75 else if (S_ISCHR(buf.st_mode))
76 return OS_TYPE_CHARDEV;
77 else if (S_ISBLK(buf.st_mode))
78 return OS_TYPE_BLOCKDEV;
79 else if (S_ISFIFO(buf.st_mode))
80 return OS_TYPE_FIFO;
81 else if (S_ISSOCK(buf.st_mode))
82 return OS_TYPE_SOCK;
83 else return OS_TYPE_FILE;
84}
85
86int access_file(char *path, int r, int w, int x) 56int access_file(char *path, int r, int w, int x)
87{ 57{
88 int mode = 0; 58 int mode = 0;