summaryrefslogtreecommitdiffstats
path: root/fs/jffs2/jffs2_fs_sb.h
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2012-04-10 22:22:35 +0100
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-05-13 22:51:29 -0500
commit8da8ba2ea6ad52ea8558384f38586b0c1a516e9d (patch)
treed11d632886c481758b51cd5b9129dc0a5b94c7bd /fs/jffs2/jffs2_fs_sb.h
parent886bd33da7cfb1f6c7f3396f7146278ed02e76a7 (diff)
downloadlinux-8da8ba2ea6ad52ea8558384f38586b0c1a516e9d.tar.gz
linux-8da8ba2ea6ad52ea8558384f38586b0c1a516e9d.tar.bz2
linux-8da8ba2ea6ad52ea8558384f38586b0c1a516e9d.zip
JFFS2: Add parameter to reserve disk space for root
Add a new rp_size= parameter which creates a "reserved pool" of disk space which can only be used by root. Other users are not permitted to write to disk when the available space is less than the pool size. Based on original code by Artem Bityutskiy in https://dev.laptop.org/ticket/5317 [dwmw2: use capable(CAP_SYS_RESOURCE) not uid/gid check, fix debug prints] Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2/jffs2_fs_sb.h')
-rw-r--r--fs/jffs2/jffs2_fs_sb.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/jffs2/jffs2_fs_sb.h b/fs/jffs2/jffs2_fs_sb.h
index 55a0c1dceadf..0d00bf26923b 100644
--- a/fs/jffs2/jffs2_fs_sb.h
+++ b/fs/jffs2/jffs2_fs_sb.h
@@ -32,6 +32,13 @@ struct jffs2_inodirty;
struct jffs2_mount_opts {
bool override_compr;
unsigned int compr;
+
+ /* The size of the reserved pool. The reserved pool is the JFFS2 flash
+ * space which may only be used by root cannot be used by the other
+ * users. This is implemented simply by means of not allowing the
+ * latter users to write to the file system if the amount if the
+ * available space is less then 'rp_size'. */
+ unsigned int rp_size;
};
/* A struct for the overall file system control. Pointers to