X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fbad_inode.c;h=80599ae339669d3a3a962d64d974f62fb30a58d6;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=3957ad190aa41491fea99e3cc55ce2ec4a9f8fc8;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/fs/bad_inode.c b/fs/bad_inode.c index 3957ad190..80599ae33 100644 --- a/fs/bad_inode.c +++ b/fs/bad_inode.c @@ -15,17 +15,6 @@ #include #include -/* - * The follow_link operation is special: it must behave as a no-op - * so that a bad root inode can at least be unmounted. To do this - * we must dput() the base and return the dentry with a dget(). - */ -static int bad_follow_link(struct dentry *dent, struct nameidata *nd) -{ - nd_set_link(nd, ERR_PTR(-EIO)); - return 0; -} - static int return_EIO(void) { return -EIO; @@ -33,7 +22,7 @@ static int return_EIO(void) #define EIO_ERROR ((void *) (return_EIO)) -static struct file_operations bad_file_ops = +static const struct file_operations bad_file_ops = { .llseek = EIO_ERROR, .aio_read = EIO_ERROR, @@ -58,7 +47,7 @@ static struct file_operations bad_file_ops = .get_unmapped_area = EIO_ERROR, }; -struct inode_operations bad_inode_ops = +static struct inode_operations bad_inode_ops = { .create = EIO_ERROR, .lookup = EIO_ERROR, @@ -70,7 +59,8 @@ struct inode_operations bad_inode_ops = .mknod = EIO_ERROR, .rename = EIO_ERROR, .readlink = EIO_ERROR, - .follow_link = bad_follow_link, + /* follow_link must be no-op, otherwise unmounting this inode + won't work */ .truncate = EIO_ERROR, .permission = EIO_ERROR, .getattr = EIO_ERROR, @@ -105,7 +95,8 @@ void make_bad_inode(struct inode * inode) remove_inode_hash(inode); inode->i_mode = S_IFREG; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = + current_fs_time(inode->i_sb); inode->i_op = &bad_inode_ops; inode->i_fop = &bad_file_ops; }