From c58cacaf5126ed6c42c4f5d5d7aa5cfe98e3133c Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Thu, 14 Jul 1994 19:36:39 +0000 Subject: Formerly file-set-trans.c.~10~ --- libdiskfs/file-set-trans.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'libdiskfs/file-set-trans.c') diff --git a/libdiskfs/file-set-trans.c b/libdiskfs/file-set-trans.c index fa556faf..567ab5fa 100644 --- a/libdiskfs/file-set-trans.c +++ b/libdiskfs/file-set-trans.c @@ -134,9 +134,19 @@ diskfs_S_file_set_translator (struct protid *cred, mutex_unlock (&np->lock); return EINVAL; } - /* Store the argument in the file as the - target of the link */ - diskfs_node_rdwr (np, arg, 0, strlen (arg), 1, cred, 0); + + if (diskfs_create_symlink_hook) + error = (*diskfs_create_symlink_hook)(np, arg); + if (!diskfs_create_symlink_hook || error == EINVAL) + /* Store the argument in the file as the + target of the link */ + error = diskfs_node_rdwr (np, arg, 0, strlen (arg), + 1, cred, 0); + if (error) + { + mutex_unlock (&np->lock); + return error; + } } np->dn_stat.st_mode = (np->dn_stat.st_mode & ~S_IFMT) | newmode; diskfs_node_update (np, 1); -- cgit v1.2.3