2005-04-16 22:20:36 +00:00
|
|
|
/* -*- c -*- --------------------------------------------------------------- *
|
|
|
|
*
|
|
|
|
* linux/fs/autofs/symlink.c
|
|
|
|
*
|
|
|
|
* Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
|
|
|
|
*
|
|
|
|
* This file is part of the Linux kernel and is made available under
|
|
|
|
* the terms of the GNU General Public License, version 2, or at your
|
|
|
|
* option, any later version, incorporated herein by reference.
|
|
|
|
*
|
|
|
|
* ------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
#include "autofs_i.h"
|
|
|
|
|
2015-11-17 15:20:54 +00:00
|
|
|
static const char *autofs4_get_link(struct dentry *dentry,
|
|
|
|
struct inode *inode, void **cookie)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2015-11-17 15:20:54 +00:00
|
|
|
struct autofs_sb_info *sbi;
|
|
|
|
struct autofs_info *ino;
|
|
|
|
if (!dentry)
|
|
|
|
return ERR_PTR(-ECHILD);
|
|
|
|
sbi = autofs4_sbi(dentry->d_sb);
|
|
|
|
ino = autofs4_dentry_ino(dentry);
|
2014-01-23 23:55:01 +00:00
|
|
|
if (ino && !autofs4_oz_mode(sbi))
|
|
|
|
ino->last_used = jiffies;
|
2015-05-02 17:32:22 +00:00
|
|
|
return d_inode(dentry)->i_private;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2007-02-12 08:55:38 +00:00
|
|
|
const struct inode_operations autofs4_symlink_inode_operations = {
|
2005-04-16 22:20:36 +00:00
|
|
|
.readlink = generic_readlink,
|
2015-11-17 15:20:54 +00:00
|
|
|
.get_link = autofs4_get_link
|
2005-04-16 22:20:36 +00:00
|
|
|
};
|