Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147952903
D37866.id114525.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
832 B
Referenced Files
None
Subscribers
None
D37866.id114525.diff
View Options
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -2325,29 +2325,19 @@
int
tmpfs_truncate(struct vnode *vp, off_t length)
{
- int error;
struct tmpfs_node *node;
+ int error;
- node = VP_TO_TMPFS_NODE(vp);
-
- if (length < 0) {
- error = EINVAL;
- goto out;
- }
-
- if (node->tn_size == length) {
- error = 0;
- goto out;
- }
-
+ if (length < 0)
+ return (EINVAL);
if (length > VFS_TO_TMPFS(vp->v_mount)->tm_maxfilesize)
return (EFBIG);
- error = tmpfs_reg_resize(vp, length, FALSE);
+ node = VP_TO_TMPFS_NODE(vp);
+ error = node->tn_size == length ? 0 : tmpfs_reg_resize(vp, length,
+ FALSE);
if (error == 0)
node->tn_status |= TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED;
-
-out:
tmpfs_update(vp);
return (error);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 15, 9:13 PM (10 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29734740
Default Alt Text
D37866.id114525.diff (832 B)
Attached To
Mode
D37866: tmpfs: update changed/modified timestamps for truncates that do not change size
Attached
Detach File
Event Timeline
Log In to Comment