1 /* -*- linux-c -*- --------------------------------------------------------- *
3 * linux/fs/autofs/dir.c
5 * Copyright 1997 Transmeta Corporation -- All Rights Reserved
7 * This file is part of the Linux kernel and is made available under
8 * the terms of the GNU General Public License, version 2, or at your
9 * option, any later version, incorporated herein by reference.
11 * ------------------------------------------------------------------------- */
15 static int autofs_dir_readdir(struct file
*filp
,
16 void *dirent
, filldir_t filldir
)
18 struct inode
*inode
=filp
->f_dentry
->d_inode
;
19 if (!inode
|| !S_ISDIR(inode
->i_mode
))
22 switch((unsigned long) filp
->f_pos
)
25 if (filldir(dirent
, ".", 1, 0, inode
->i_ino
) < 0)
30 if (filldir(dirent
, "..", 2, 1, AUTOFS_ROOT_INO
) < 0)
39 * No entries except for "." and "..", both of which are handled by the VFS layer
41 static int autofs_dir_lookup(struct inode
*dir
, struct dentry
* dentry
)
47 static struct file_operations autofs_dir_operations
= {
51 autofs_dir_readdir
, /* readdir */
60 NULL
, /* check_media_change */
61 NULL
, /* revalidate */
65 struct inode_operations autofs_dir_inode_operations
= {
66 &autofs_dir_operations
, /* file operations */
68 autofs_dir_lookup
, /* lookup */
77 NULL
, /* follow_link */
82 NULL
, /* permission */
84 NULL
, /* updatepage */