Module Name:    src
Committed By:   drochner
Date:           Mon Nov 26 16:22:22 UTC 2012

Modified Files:
        src/sys/sys: fstypes.h
        src/sys/ufs/ffs: ffs_vfsops.c

Log Message:
allow to enable ffs "discard" by update mounts, make the flag visible
to userland


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/sys/fstypes.h
cvs rdiff -u -r1.279 -r1.280 src/sys/ufs/ffs/ffs_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/fstypes.h
diff -u src/sys/sys/fstypes.h:1.31 src/sys/sys/fstypes.h:1.32
--- src/sys/sys/fstypes.h:1.31	Fri Oct 19 17:09:07 2012
+++ src/sys/sys/fstypes.h	Mon Nov 26 16:22:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstypes.h,v 1.31 2012/10/19 17:09:07 drochner Exp $	*/
+/*	$NetBSD: fstypes.h,v 1.32 2012/11/26 16:22:21 drochner Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -171,6 +171,7 @@ typedef struct fhandle	fhandle_t;
      MNT_ASYNC | \
      MNT_NOCOREDUMP | \
      MNT_IGNORE | \
+     MNT_DISCARD | \
      MNT_NOATIME | \
      MNT_SYMPERM | \
      MNT_NODEVMTIME | \

Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.279 src/sys/ufs/ffs/ffs_vfsops.c:1.280
--- src/sys/ufs/ffs/ffs_vfsops.c:1.279	Fri Oct 19 17:09:08 2012
+++ src/sys/ufs/ffs/ffs_vfsops.c	Mon Nov 26 16:22:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.279 2012/10/19 17:09:08 drochner Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.280 2012/11/26 16:22:21 drochner Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.279 2012/10/19 17:09:08 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.280 2012/11/26 16:22:21 drochner Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -580,6 +580,10 @@ ffs_mount(struct mount *mp, const char *
 			}
 		}
 #endif
+
+		if ((mp->mnt_flag & MNT_DISCARD) && !(ump->um_discarddata))
+			ump->um_discarddata = ffs_discard_init(devvp, fs);
+
 		if (args->fspec == NULL)
 			return 0;
 	}

Reply via email to