mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 00/19] Add Linux dcache implementation
@ 2018-04-03  7:48 Sascha Hauer
  2018-04-03  7:48 ` [PATCH 01/19] rename file_operations -> cdev_operations Sascha Hauer
                   ` (18 more replies)
  0 siblings, 19 replies; 23+ messages in thread
From: Sascha Hauer @ 2018-04-03  7:48 UTC (permalink / raw)
  To: Barebox List

This series adds the Linux dcache implementation to barebox.

Until now every filesystem driver resolves the full path to a file for
itself. This leads to code duplication and is error prone since
resolving paths is a complicated task. Also it can narrow down the
lookup performance since barebox only knows ASCII paths and has no way
of caching lookups. Since with this barebox provides a interface to
dentries much like the Linux Kernel does it gets easier to share
filesystem code between barebox and Linux.

With this series we get the Linux dcache implementation. The path
resolving code from fs/namei.c is nearly taken as-is, minus the RCU and
locking code. Dcaching is made simple as of now: We simply cache
everything and never release any dentries. Although we do reference
counting for inodes and dentries it is effectively not used yet.  We
never free anything until a fs is unmounted in which case we free
everything no matter if references are taken or not.

This patch fundamentally changes the way lookups are done in the
filesystem drivers and I found no sane way to maintain a backwards
compatible code path for not yet converted filesystem drivers. This
means *all* filesystems are marked as broken with the introduction of
the dcache implementation.

I won't apply this series for now (except for the preparatory pathces).
The most important filesystems are already converted with this series,
but there are a few missing like FAT and squashfs and some more no so
prominent ones.

Overall I planned this change for longer now and I can say the new code
feels good. The performance is better, links are resolved more correctly
and the individual filesystem implementations get simpler. I'll continue
on this series soon, but it'll need some time to fix the remaining
filesystems (of course, feel free to do some of the work to speed things
up;)

Sascha

Sascha Hauer (19):
  rename file_operations -> cdev_operations
  ubifs: remove dead code
  ubifs: Remove Linux struct definitions we already have
  ubifs: remove dead code
  fs: Add super_operations
  fs: Move mem_write/mem_read to devfs-core
  fs: Cleanup whitespace damage
  fs: Fix finding correct directory for mkdir/rmdir
  glob: do not unnecessarily opendir() a directory
  ls: Do not depend on normalise_path()
  loadenv: Do not depend on normalise_path()
  fs: dcache implementation
  fs: ramfs: Switch to dcache implementation
  fs: devfs: Switch to dcache implementation
  fs: ext4: Switch to dcache implementation
  fs: ubifs: Switch to dcache implementation
  fs: nfs: Switch to dcache implementation
  fs: tftp: Switch to dcache implementation
  block: Adjust cache sizes

 arch/arm/mach-mxs/ocotp.c     |    2 +-
 arch/sandbox/board/hostfile.c |    2 +-
 commands/loadenv.c            |    6 +-
 commands/ls.c                 |    9 +-
 commands/mem.c                |    2 +-
 commands/stddev.c             |    8 +-
 common/block.c                |    6 +-
 common/firmware.c             |    2 +-
 drivers/base/regmap/regmap.c  |    2 +-
 drivers/eeprom/at24.c         |    2 +-
 drivers/eeprom/at25.c         |    2 +-
 drivers/hw_random/core.c      |    2 +-
 drivers/mfd/act8846.c         |    2 +-
 drivers/mfd/lp3972.c          |    2 +-
 drivers/mfd/mc34704.c         |    2 +-
 drivers/mfd/mc9sdz60.c        |    2 +-
 drivers/mfd/stmpe-i2c.c       |    2 +-
 drivers/mfd/twl-core.c        |    2 +-
 drivers/misc/jtag.c           |    2 +-
 drivers/misc/sram.c           |    2 +-
 drivers/mtd/core.c            |    2 +-
 drivers/mtd/mtdoob.c          |    2 +-
 drivers/mtd/mtdraw.c          |    4 +-
 drivers/mtd/nand/nand-bb.c    |    2 +-
 drivers/mtd/ubi/barebox.c     |    4 +-
 drivers/net/e1000/eeprom.c    |    4 +-
 drivers/net/ksz8864rmn.c      |    2 +-
 drivers/net/phy/mdio_bus.c    |    2 +-
 drivers/nvmem/core.c          |    2 +-
 drivers/video/fb.c            |    2 +-
 drivers/w1/slaves/w1_ds2431.c |    2 +-
 drivers/w1/slaves/w1_ds2433.c |    2 +-
 fs/Kconfig                    |    8 +
 fs/Makefile                   |    2 +-
 fs/devfs-core.c               |   70 +-
 fs/devfs.c                    |  150 +-
 fs/ext4/ext_barebox.c         |  280 ++--
 fs/ext4/ext_common.h          |    3 +
 fs/fat/Kconfig                |    1 +
 fs/fs.c                       | 3696 ++++++++++++++++++++++++++---------------
 fs/libfs.c                    |   87 +
 fs/nfs.c                      |  542 +++---
 fs/pstore/Kconfig             |    1 +
 fs/ramfs.c                    |  412 ++---
 fs/squashfs/Kconfig           |    1 +
 fs/tftp.c                     |   96 +-
 fs/ubifs/Makefile             |    2 +-
 fs/ubifs/dir.c                |  410 +++++
 fs/ubifs/super.c              |  157 +-
 fs/ubifs/ubifs.c              |  816 +--------
 fs/ubifs/ubifs.h              |  547 +-----
 include/console.h             |    2 +-
 include/dirent.h              |    3 +
 include/driver.h              |    4 +-
 include/fs.h                  |   25 +-
 include/linux/dcache.h        |  109 +-
 include/linux/fs.h            |  136 +-
 include/linux/mount.h         |    3 +
 include/linux/namei.h         |   52 +
 include/linux/stat.h          |    2 +
 include/mfd/twl-core.h        |    2 +-
 lib/glob.c                    |   15 +-
 62 files changed, 3960 insertions(+), 3765 deletions(-)
 create mode 100644 fs/libfs.c
 create mode 100644 fs/ubifs/dir.c
 create mode 100644 include/linux/namei.h

-- 
2.16.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2018-05-22  8:21 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03  7:48 [PATCH 00/19] Add Linux dcache implementation Sascha Hauer
2018-04-03  7:48 ` [PATCH 01/19] rename file_operations -> cdev_operations Sascha Hauer
2018-04-03  7:48 ` [PATCH 02/19] ubifs: remove dead code Sascha Hauer
2018-04-03  7:48 ` [PATCH 03/19] ubifs: Remove Linux struct definitions we already have Sascha Hauer
2018-04-03  7:48 ` [PATCH 04/19] ubifs: remove dead code Sascha Hauer
2018-04-03  7:48 ` [PATCH 05/19] fs: Add super_operations Sascha Hauer
2018-04-03  7:48 ` [PATCH 06/19] fs: Move mem_write/mem_read to devfs-core Sascha Hauer
2018-04-03  7:48 ` [PATCH 07/19] fs: Cleanup whitespace damage Sascha Hauer
2018-04-03  7:48 ` [PATCH 08/19] fs: Fix finding correct directory for mkdir/rmdir Sascha Hauer
2018-04-03  7:48 ` [PATCH 09/19] glob: do not unnecessarily opendir() a directory Sascha Hauer
2018-04-03  7:48 ` [PATCH 10/19] ls: Do not depend on normalise_path() Sascha Hauer
2018-04-03  7:48 ` [PATCH 11/19] loadenv: " Sascha Hauer
2018-04-03  7:48 ` [PATCH 12/19] fs: dcache implementation Sascha Hauer
2018-04-03  7:48 ` [PATCH 13/19] fs: ramfs: Switch to " Sascha Hauer
2018-04-03  7:48 ` [PATCH 14/19] fs: devfs: " Sascha Hauer
2018-04-03  7:48 ` [PATCH 15/19] fs: ext4: " Sascha Hauer
2018-04-03  7:48 ` [PATCH 16/19] fs: ubifs: " Sascha Hauer
2018-04-03  7:48 ` [PATCH 17/19] fs: nfs: " Sascha Hauer
2018-04-03  7:48 ` [PATCH 18/19] fs: tftp: " Sascha Hauer
2018-05-18 11:54   ` Philipp Zabel
2018-05-22  7:12     ` Sascha Hauer
2018-05-22  8:21       ` Philipp Zabel
2018-04-03  7:48 ` [PATCH 19/19] block: Adjust cache sizes Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox