Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
From: Bharath Vedartham <linux.bhar@gmail.com>
To: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: Overwriting copy functionality in filesystem
Date: Sun, 24 Mar 2019 18:51:41 +0530
Message-ID: <20190324132141.GB24735@bharath12345-Inspiron-5559> (raw)
In-Reply-To: <2d5aea0b-23ad-ba50-a73a-399d89dbf060@petrovitsch.priv.at>

On Sat, Mar 23, 2019 at 08:03:20PM +0100, Bernd Petrovitsch wrote:
> Hi all!
> 
> On 23/03/2019 17:59, Bharath Vedartham wrote:
> [..]
> > I was wondering how we can overwrite the copy functionality while
> > writing our own filesystem in linux. 
> > VFS does not offer any sort of API for copy. I think it calls create and
> 
> Yes.
> 
> > write when we execute the copy the file/dir.
> > I am interested in overwriting the way copy happens in my
> > filesystem(which I am writing for fun :p). 
> > Any ideas?
> 
> strace a "cp" and see which system calls are used.
> Look into the source code and see how it's implemented.
> 
> There is actually more than one method but the usual (while simplest,
> most versatile and probably fastest) method used is: open source and
> destination files, read from the source, write into the destination
> until EOF.
>
I have observed that it is a mixture of system calls. I am interested in
implementing copy-on-write in my filesystem(for fun). I feel that, it
would require my creat vfs api to be aware of the fact that "cp" is
calling it. I want to keep things as generic as possible. I ll proceed
by reading the source of union filesystems (overlayfs) to see how they
implement copy-on-write.
> MfG,
> 	Bernd
> -- 
> Bernd Petrovitsch                  Email : bernd@petrovitsch.priv.at
>                      LUGA : http://www.luga.at

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-23 16:59 Bharath Vedartham
2019-03-23 19:01 ` Valdis Klētnieks
2019-03-24 13:18   ` Bharath Vedartham
2019-03-24 14:06     ` Valdis Klētnieks
2019-03-28 18:30       ` Bharath Vedartham
2019-03-28 20:07         ` Valdis Klētnieks
2019-03-23 19:03 ` Bernd Petrovitsch
2019-03-24 13:21   ` Bharath Vedartham [this message]
2019-03-23 19:05 ` Greg KH

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190324132141.GB24735@bharath12345-Inspiron-5559 \
    --to=linux.bhar@gmail.com \
    --cc=bernd@petrovitsch.priv.at \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox