Remove duplicated code in tmpfs_chflags()

Antonio Huete Jimenez <[email protected]>
Newsgroups gmane.os.dragonfly-bsd.kernel
Message-ID <CACegU+ubNoQPSXXhwk=sLbeY+ycJ5wToqOT0hzfamL6MDR_Nqw@mail.gmail.com>
Hi,

Please see attached patch:

http://leaf.dragonflybsd.org/~tuxillo/archive/patches/tmpfs_chflags01.diff

The code that was removed seems duplicated to me as
vop_helper_setattr_flags function already does the trick. Also
SF_NOCACHE is set on VOP_MOUNT, see
http://bxr.su/DragonFly/sys/vfs/tmpfs/tmpfs_vfsops.c#267. There is no
need for a check to VROOT in every single chflags call either IMO.

The patch has been tested with schg/noschg:

-rw-r--r--  1 root  wheel  schg 0 Jun 29 13:05 e
vkernel64 # rm e
override rw-r--r--  root/wheel schg for e? y
rm: e: Operation not permitted
vkernel64 # chflags noschg e
vkernel64 # rm e

Cheers,
Antonio Huete
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.