Skip to content

Commit

Permalink
[PATCH] uml: remove empty hostfs_truncate method
Browse files Browse the repository at this point in the history
Calling truncate() on hostfs spits a kernel warning "Something isn't
implemented here", but it still works fine.

Indeed, hostfs i_op->truncate doesn't do anything.  But hostfs_setattr() ->
set_attr() correctly detects ATTR_SIZE and calls truncate() on the host.  So
we should be safe (using ftruncate() may be better, in case the file is
unlinked on the host, but we aren't sure to have the file open for writing,
and reopening it would cause the same races; plus nobody should expect UML to
be so careful).

So, the warning is wrong, because the current implementation is working.  Al,
am I correct, and can the warning be therefore dropped?

CC: Al Viro <[email protected]>
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Sep 30, 2005
1 parent bd94805 commit daa35ed
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions fs/hostfs/hostfs_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,11 +793,6 @@ int hostfs_rename(struct inode *from_ino, struct dentry *from,
return(err);
}

void hostfs_truncate(struct inode *ino)
{
not_implemented();
}

int hostfs_permission(struct inode *ino, int desired, struct nameidata *nd)
{
char *name;
Expand Down Expand Up @@ -894,7 +889,6 @@ static struct inode_operations hostfs_iops = {
.rmdir = hostfs_rmdir,
.mknod = hostfs_mknod,
.rename = hostfs_rename,
.truncate = hostfs_truncate,
.permission = hostfs_permission,
.setattr = hostfs_setattr,
.getattr = hostfs_getattr,
Expand All @@ -910,7 +904,6 @@ static struct inode_operations hostfs_dir_iops = {
.rmdir = hostfs_rmdir,
.mknod = hostfs_mknod,
.rename = hostfs_rename,
.truncate = hostfs_truncate,
.permission = hostfs_permission,
.setattr = hostfs_setattr,
.getattr = hostfs_getattr,
Expand Down

0 comments on commit daa35ed

Please sign in to comment.