mirror of
https://github.com/meizu-m86/twrp_multirom_m86
synced 2025-11-03 21:45:40 +08:00
fuse: Update to 2.9.4
Change-Id: I0877c624531286f47da29a7ab16c7ff3cfac0090
This commit is contained in:
9
fuse/AUTHORS
Normal file
9
fuse/AUTHORS
Normal file
@@ -0,0 +1,9 @@
|
||||
FUSE
|
||||
----
|
||||
|
||||
Miklos Szeredi <miklos@szeredi.hu>
|
||||
|
||||
CUSE
|
||||
----
|
||||
|
||||
Tejun Heo <teheo@suse.de>
|
||||
@@ -17,6 +17,7 @@ LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
android/statvfs.c \
|
||||
buffer.c \
|
||||
cuse_lowlevel.c \
|
||||
fuse.c \
|
||||
@@ -33,10 +34,11 @@ LOCAL_SRC_FILES := \
|
||||
ulockmgr.c
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(LOCAL_PATH)/android \
|
||||
$(LOCAL_PATH)/include
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libutils libdl
|
||||
libutils
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-D_FILE_OFFSET_BITS=64 \
|
||||
@@ -47,24 +49,3 @@ LOCAL_MODULE := libfusetwrp
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
#include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
fusexmp.c
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(LOCAL_PATH)/include
|
||||
|
||||
LOCAL_CFLAGS := -D_FILE_OFFSET_BITS=64
|
||||
|
||||
LOCAL_MODULE := fusexmp
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libfusetwrp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libutils libdl
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
339
fuse/COPYING
Normal file
339
fuse/COPYING
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
502
fuse/COPYING.LIB
Normal file
502
fuse/COPYING.LIB
Normal file
@@ -0,0 +1,502 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
3535
fuse/ChangeLog
Normal file
3535
fuse/ChangeLog
Normal file
File diff suppressed because it is too large
Load Diff
384
fuse/README
384
fuse/README
@@ -1,12 +1,380 @@
|
||||
Libfuse for Android
|
||||
General Information
|
||||
===================
|
||||
|
||||
FUSE[1] is a framework to develop userspace file systems for linux. Since Android is based on linux, it won't be too difficult to port libfuse to Android.
|
||||
FUSE (Filesystem in Userspace) is a simple interface for userspace
|
||||
programs to export a virtual filesystem to the Linux kernel. FUSE
|
||||
also aims to provide a secure method for non privileged users to
|
||||
create and mount their own filesystem implementations.
|
||||
|
||||
The main problem of building and running libfuse on Android is that the bionic c library lacks support for pthread_cancel(), which is necessary for libfuse multi-thread code. This stackoverflow entry[2] has suggested a solution, which uses SIGUSR1 as an alternative. It seems to work.
|
||||
You can download the source code releases from
|
||||
|
||||
Libfuse can be build with Android NDK[3]. If success, you will get libfuse.a and an example program fusexmp. To run the example, the android kernel should be built with FUSE kernel support.
|
||||
http://sourceforge.net/projects/fuse
|
||||
|
||||
References:
|
||||
[1]. http://fuse.sourceforge.net
|
||||
[2]. http://stackoverflow.com/questions/4610086/pthread-cancel-alternatives-in-android-ndk
|
||||
[3]. http://developer.android.com/sdk/ndk/index.html
|
||||
or alternatively you can use CVS to get the very latest development
|
||||
version:
|
||||
|
||||
cvs -d :pserver:anonymous@fuse.cvs.sourceforge.net:/cvsroot/fuse co fuse
|
||||
|
||||
|
||||
Dependencies
|
||||
============
|
||||
|
||||
Linux kernel version 2.6.X where X >= 9.
|
||||
|
||||
Alternatively a kernel module from FUSE release 2.5.* can be used with
|
||||
this release, which supports kernels >= 2.4.21.
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
modprobe fuse
|
||||
|
||||
You may also need to add '/usr/local/lib' to '/etc/ld.so.conf' and/or
|
||||
run ldconfig.
|
||||
|
||||
You'll also need a fuse kernel module, Linux kernels 2.6.14 or later
|
||||
contain FUSE support.
|
||||
|
||||
For more details see the file 'INSTALL'
|
||||
|
||||
How To Use
|
||||
==========
|
||||
|
||||
FUSE is made up of three main parts:
|
||||
|
||||
- A kernel filesystem module
|
||||
|
||||
- A userspace library
|
||||
|
||||
- A mount/unmount program
|
||||
|
||||
|
||||
Here's how to create your very own virtual filesystem in five easy
|
||||
steps (after installing FUSE):
|
||||
|
||||
1) Edit the file example/fusexmp.c to do whatever you want...
|
||||
|
||||
2) Build the fusexmp program
|
||||
|
||||
3) run 'example/fusexmp /mnt/fuse -d'
|
||||
|
||||
4) ls -al /mnt/fuse
|
||||
|
||||
5) Be glad
|
||||
|
||||
If it doesn't work out, please ask! Also see the file 'include/fuse.h' for
|
||||
detailed documentation of the library interface.
|
||||
|
||||
Security
|
||||
========
|
||||
|
||||
If you run 'make install', the fusermount program is installed
|
||||
set-user-id to root. This is done to allow normal users to mount
|
||||
their own filesystem implementations.
|
||||
|
||||
There must however be some limitations, in order to prevent Bad User from
|
||||
doing nasty things. Currently those limitations are:
|
||||
|
||||
- The user can only mount on a mountpoint, for which it has write
|
||||
permission
|
||||
|
||||
- The mountpoint is not a sticky directory which isn't owned by the
|
||||
user (like /tmp usually is)
|
||||
|
||||
- No other user (including root) can access the contents of the mounted
|
||||
filesystem.
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
Some options regarding mount policy can be set in the file
|
||||
'/etc/fuse.conf'
|
||||
|
||||
Currently these options are:
|
||||
|
||||
mount_max = NNN
|
||||
|
||||
Set the maximum number of FUSE mounts allowed to non-root users.
|
||||
The default is 1000.
|
||||
|
||||
user_allow_other
|
||||
|
||||
Allow non-root users to specify the 'allow_other' or 'allow_root'
|
||||
mount options.
|
||||
|
||||
|
||||
Mount options
|
||||
=============
|
||||
|
||||
Most of the generic mount options described in 'man mount' are
|
||||
supported (ro, rw, suid, nosuid, dev, nodev, exec, noexec, atime,
|
||||
noatime, sync async, dirsync). Filesystems are mounted with
|
||||
'-onodev,nosuid' by default, which can only be overridden by a
|
||||
privileged user.
|
||||
|
||||
These are FUSE specific mount options that can be specified for all
|
||||
filesystems:
|
||||
|
||||
default_permissions
|
||||
|
||||
By default FUSE doesn't check file access permissions, the
|
||||
filesystem is free to implement it's access policy or leave it to
|
||||
the underlying file access mechanism (e.g. in case of network
|
||||
filesystems). This option enables permission checking, restricting
|
||||
access based on file mode. This is option is usually useful
|
||||
together with the 'allow_other' mount option.
|
||||
|
||||
allow_other
|
||||
|
||||
This option overrides the security measure restricting file access
|
||||
to the user mounting the filesystem. So all users (including root)
|
||||
can access the files. This option is by default only allowed to
|
||||
root, but this restriction can be removed with a configuration
|
||||
option described in the previous section.
|
||||
|
||||
allow_root
|
||||
|
||||
This option is similar to 'allow_other' but file access is limited
|
||||
to the user mounting the filesystem and root. This option and
|
||||
'allow_other' are mutually exclusive.
|
||||
|
||||
kernel_cache
|
||||
|
||||
This option disables flushing the cache of the file contents on
|
||||
every open(). This should only be enabled on filesystems, where the
|
||||
file data is never changed externally (not through the mounted FUSE
|
||||
filesystem). Thus it is not suitable for network filesystems and
|
||||
other "intermediate" filesystems.
|
||||
|
||||
NOTE: if this option is not specified (and neither 'direct_io') data
|
||||
is still cached after the open(), so a read() system call will not
|
||||
always initiate a read operation.
|
||||
|
||||
auto_cache
|
||||
|
||||
This option enables automatic flushing of the data cache on open().
|
||||
The cache will only be flushed if the modification time or the size
|
||||
of the file has changed.
|
||||
|
||||
large_read
|
||||
|
||||
Issue large read requests. This can improve performance for some
|
||||
filesystems, but can also degrade performance. This option is only
|
||||
useful on 2.4.X kernels, as on 2.6 kernels requests size is
|
||||
automatically determined for optimum performance.
|
||||
|
||||
direct_io
|
||||
|
||||
This option disables the use of page cache (file content cache) in
|
||||
the kernel for this filesystem. This has several affects:
|
||||
|
||||
- Each read() or write() system call will initiate one or more
|
||||
read or write operations, data will not be cached in the
|
||||
kernel.
|
||||
|
||||
- The return value of the read() and write() system calls will
|
||||
correspond to the return values of the read and write
|
||||
operations. This is useful for example if the file size is not
|
||||
known in advance (before reading it).
|
||||
|
||||
max_read=N
|
||||
|
||||
With this option the maximum size of read operations can be set.
|
||||
The default is infinite. Note that the size of read requests is
|
||||
limited anyway to 32 pages (which is 128kbyte on i386).
|
||||
|
||||
max_readahead=N
|
||||
|
||||
Set the maximum number of bytes to read-ahead. The default is
|
||||
determined by the kernel. On linux-2.6.22 or earlier it's 131072
|
||||
(128kbytes)
|
||||
|
||||
max_write=N
|
||||
|
||||
Set the maximum number of bytes in a single write operation. The
|
||||
default is 128kbytes. Note, that due to various limitations, the
|
||||
size of write requests can be much smaller (4kbytes). This
|
||||
limitation will be removed in the future.
|
||||
|
||||
async_read
|
||||
|
||||
Perform reads asynchronously. This is the default
|
||||
|
||||
sync_read
|
||||
|
||||
Perform all reads (even read-ahead) synchronously.
|
||||
|
||||
hard_remove
|
||||
|
||||
The default behavior is that if an open file is deleted, the file is
|
||||
renamed to a hidden file (.fuse_hiddenXXX), and only removed when
|
||||
the file is finally released. This relieves the filesystem
|
||||
implementation of having to deal with this problem. This option
|
||||
disables the hiding behavior, and files are removed immediately in
|
||||
an unlink operation (or in a rename operation which overwrites an
|
||||
existing file).
|
||||
|
||||
It is recommended that you not use the hard_remove option. When
|
||||
hard_remove is set, the following libc functions fail on unlinked
|
||||
files (returning errno of ENOENT):
|
||||
- read()
|
||||
- write()
|
||||
- fsync()
|
||||
- close()
|
||||
- f*xattr()
|
||||
- ftruncate()
|
||||
- fstat()
|
||||
- fchmod()
|
||||
- fchown()
|
||||
|
||||
debug
|
||||
|
||||
Turns on debug information printing by the library.
|
||||
|
||||
fsname=NAME
|
||||
|
||||
Sets the filesystem source (first field in /etc/mtab). The default
|
||||
is the program name.
|
||||
|
||||
subtype=TYPE
|
||||
|
||||
Sets the filesystem type (third field in /etc/mtab). The default is
|
||||
the program name.
|
||||
|
||||
If the kernel suppports it, /etc/mtab and /proc/mounts will show the
|
||||
filesystem type as "fuse.TYPE"
|
||||
|
||||
If the kernel doesn't support subtypes, the source filed will be
|
||||
"TYPE#NAME", or if fsname option is not specified, just "TYPE".
|
||||
|
||||
use_ino
|
||||
|
||||
Honor the 'st_ino' field in getattr() and fill_dir(). This value is
|
||||
used to fill in the 'st_ino' field in the stat()/lstat()/fstat()
|
||||
functions and the 'd_ino' field in the readdir() function. The
|
||||
filesystem does not have to guarantee uniqueness, however some
|
||||
applications rely on this value being unique for the whole
|
||||
filesystem.
|
||||
|
||||
readdir_ino
|
||||
|
||||
If 'use_ino' option is not given, still try to fill in the 'd_ino'
|
||||
field in readdir(). If the name was previously looked up, and is
|
||||
still in the cache, the inode number found there will be used.
|
||||
Otherwise it will be set to '-1'. If 'use_ino' option is given,
|
||||
this option is ignored.
|
||||
|
||||
nonempty
|
||||
|
||||
Allows mounts over a non-empty file or directory. By default these
|
||||
mounts are rejected (from version 2.3.1) to prevent accidental
|
||||
covering up of data, which could for example prevent automatic
|
||||
backup.
|
||||
|
||||
umask=M
|
||||
|
||||
Override the permission bits in 'st_mode' set by the filesystem.
|
||||
The resulting permission bits are the ones missing from the given
|
||||
umask value. The value is given in octal representation.
|
||||
|
||||
uid=N
|
||||
|
||||
Override the 'st_uid' field set by the filesystem.
|
||||
|
||||
gid=N
|
||||
|
||||
Override the 'st_gid' field set by the filesystem.
|
||||
|
||||
blkdev
|
||||
|
||||
Mount a filesystem backed by a block device. This is a privileged
|
||||
option. The device must be specified with the 'fsname=NAME' option.
|
||||
|
||||
entry_timeout=T
|
||||
|
||||
The timeout in seconds for which name lookups will be cached. The
|
||||
default is 1.0 second. For all the timeout options, it is possible
|
||||
to give fractions of a second as well (e.g. "-oentry_timeout=2.8")
|
||||
|
||||
negative_timeout=T
|
||||
|
||||
The timeout in seconds for which a negative lookup will be cached.
|
||||
This means, that if file did not exist (lookup retuned ENOENT), the
|
||||
lookup will only be redone after the timeout, and the file/directory
|
||||
will be assumed to not exist until then. The default is 0.0 second,
|
||||
meaning that caching negative lookups are disabled.
|
||||
|
||||
attr_timeout=T
|
||||
|
||||
The timeout in seconds for which file/directory attributes are
|
||||
cached. The default is 1.0 second.
|
||||
|
||||
ac_attr_timeout=T
|
||||
|
||||
The timeout in seconds for which file attributes are cached for the
|
||||
purpose of checking if "auto_cache" should flush the file data on
|
||||
open. The default is the value of 'attr_timeout'
|
||||
|
||||
intr
|
||||
|
||||
Allow requests to be interrupted. Turning on this option may result
|
||||
in unexpected behavior, if the filesystem does not support request
|
||||
interruption.
|
||||
|
||||
intr_signal=NUM
|
||||
|
||||
Specify which signal number to send to the filesystem when a request
|
||||
is interrupted. The default is 10 (USR1).
|
||||
|
||||
modules=M1[:M2...]
|
||||
|
||||
Add modules to the filesystem stack. Modules are pushed in the
|
||||
order they are specified, with the original filesystem being on the
|
||||
bottom of the stack.
|
||||
|
||||
|
||||
Modules distributed with fuse
|
||||
-----------------------------
|
||||
|
||||
iconv
|
||||
`````
|
||||
Perform file name character set conversion. Options are:
|
||||
|
||||
from_code=CHARSET
|
||||
|
||||
Character set to convert from (see iconv -l for a list of possible
|
||||
values). Default is UTF-8.
|
||||
|
||||
to_code=CHARSET
|
||||
|
||||
Character set to convert to. Default is determined by the current
|
||||
locale.
|
||||
|
||||
|
||||
subdir
|
||||
``````
|
||||
Prepend a given directory to each path. Options are:
|
||||
|
||||
subdir=DIR
|
||||
|
||||
Directory to prepend to all paths. This option is mandatory.
|
||||
|
||||
rellinks
|
||||
|
||||
Transform absolute symlinks into relative
|
||||
|
||||
norellinks
|
||||
|
||||
Do not transform absolute symlinks into relative. This is the default.
|
||||
|
||||
|
||||
Reporting bugs
|
||||
==============
|
||||
|
||||
Please send bug reports to the <fuse-devel@lists.sourceforge.net>
|
||||
mailing list.
|
||||
|
||||
The list is open, you need not be subscribed to post.
|
||||
|
||||
@@ -72,16 +72,16 @@
|
||||
#define PACKAGE_NAME "fuse"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "fuse 2.8.5"
|
||||
#define PACKAGE_STRING "fuse 2.9.3"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "fuse"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "2.8.5"
|
||||
#define PACKAGE_VERSION "2.9.3"
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "2.8.5"
|
||||
#define VERSION "2.9.3"
|
||||
48
fuse/android/statvfs.c
Normal file
48
fuse/android/statvfs.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include "sys/statvfs.h"
|
||||
#include <sys/statfs.h>
|
||||
|
||||
#define MAP(to,from) vfs->to = sfs.from
|
||||
|
||||
int statvfs(const char *path, struct statvfs *vfs) {
|
||||
struct statfs sfs;
|
||||
int ret;
|
||||
int *fsid;
|
||||
if ((ret = statfs(path, &sfs)) != 0)
|
||||
return ret;
|
||||
|
||||
MAP(f_bsize, f_bsize);
|
||||
MAP(f_frsize, f_frsize);
|
||||
MAP(f_blocks, f_blocks);
|
||||
MAP(f_bfree, f_bfree);
|
||||
MAP(f_bavail, f_bavail);
|
||||
MAP(f_files, f_files);
|
||||
MAP(f_ffree, f_ffree);
|
||||
MAP(f_namemax, f_namelen);
|
||||
|
||||
vfs->f_favail = 0;
|
||||
vfs->f_flag = 0;
|
||||
|
||||
fsid = (int *)&sfs.f_fsid;
|
||||
vfs->f_fsid = (fsid[0] << sizeof(fsid[0])) | fsid[1];
|
||||
|
||||
return ret;
|
||||
}
|
||||
39
fuse/android/sys/statvfs.h
Normal file
39
fuse/android/sys/statvfs.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _SYS_STATVFS_H_
|
||||
#define _SYS_STATVFS_H_
|
||||
#include <sys/types.h>
|
||||
|
||||
struct statvfs {
|
||||
unsigned long f_bsize; /* file system block size */
|
||||
unsigned long f_frsize; /* fragment size */
|
||||
fsblkcnt_t f_blocks; /* size of fs in f_frsize units */
|
||||
fsblkcnt_t f_bfree; /* # free blocks */
|
||||
fsblkcnt_t f_bavail; /* # free blocks for non-root */
|
||||
fsfilcnt_t f_files; /* # inodes */
|
||||
fsfilcnt_t f_ffree; /* # free inodes */
|
||||
fsfilcnt_t f_favail; /* # free inodes for non-root */
|
||||
unsigned long f_fsid; /* file system ID */
|
||||
unsigned long f_flag; /* mount flags */
|
||||
unsigned long f_namemax; /* maximum filename length */
|
||||
};
|
||||
|
||||
int statvfs(const char *, struct statvfs *);
|
||||
#endif
|
||||
@@ -45,7 +45,7 @@ static ssize_t fuse_buf_write(const struct fuse_buf *dst, size_t dst_off,
|
||||
|
||||
while (len) {
|
||||
if (dst->flags & FUSE_BUF_FD_SEEK) {
|
||||
res = pwrite(dst->fd, src->mem + src_off, len,
|
||||
res = pwrite64(dst->fd, src->mem + src_off, len,
|
||||
dst->pos + dst_off);
|
||||
} else {
|
||||
res = write(dst->fd, src->mem + src_off, len);
|
||||
@@ -160,10 +160,10 @@ static ssize_t fuse_buf_splice(const struct fuse_buf *dst, size_t dst_off,
|
||||
size_t len, enum fuse_buf_copy_flags flags)
|
||||
{
|
||||
int splice_flags = 0;
|
||||
off64_t *srcpos = NULL;
|
||||
off64_t *dstpos = NULL;
|
||||
off64_t srcpos_val;
|
||||
off64_t dstpos_val;
|
||||
loff_t *srcpos = NULL;
|
||||
loff_t *dstpos = NULL;
|
||||
loff_t srcpos_val;
|
||||
loff_t dstpos_val;
|
||||
ssize_t res;
|
||||
size_t copied = 0;
|
||||
|
||||
|
||||
@@ -43,14 +43,14 @@ static void cuse_fll_open(fuse_req_t req, fuse_ino_t ino,
|
||||
}
|
||||
|
||||
static void cuse_fll_read(fuse_req_t req, fuse_ino_t ino, size_t size,
|
||||
off64_t off, struct fuse_file_info *fi)
|
||||
loff_t off, struct fuse_file_info *fi)
|
||||
{
|
||||
(void)ino;
|
||||
req_clop(req)->read(req, size, off, fi);
|
||||
}
|
||||
|
||||
static void cuse_fll_write(fuse_req_t req, fuse_ino_t ino, const char *buf,
|
||||
size_t size, off64_t off, struct fuse_file_info *fi)
|
||||
size_t size, loff_t off, struct fuse_file_info *fi)
|
||||
{
|
||||
(void)ino;
|
||||
req_clop(req)->write(req, buf, size, off, fi);
|
||||
|
||||
110
fuse/fuse.c
110
fuse/fuse.c
@@ -30,13 +30,17 @@
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <dlfcn.h>
|
||||
#include <assert.h>
|
||||
#include <poll.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/file.h>
|
||||
|
||||
#ifdef USE_MODULES
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#define FUSE_NODE_SLAB 1
|
||||
|
||||
@@ -156,8 +160,8 @@ struct fuse {
|
||||
|
||||
struct lock {
|
||||
int type;
|
||||
off64_t start;
|
||||
off64_t end;
|
||||
loff_t start;
|
||||
loff_t end;
|
||||
pid_t pid;
|
||||
uint64_t owner;
|
||||
struct lock *next;
|
||||
@@ -175,7 +179,7 @@ struct node {
|
||||
int open_count;
|
||||
struct timespec stat_updated;
|
||||
struct timespec mtime;
|
||||
off64_t size;
|
||||
loff_t size;
|
||||
struct lock *locks;
|
||||
unsigned int is_hidden : 1;
|
||||
unsigned int cache_valid : 1;
|
||||
@@ -221,6 +225,8 @@ struct fuse_context_i {
|
||||
static pthread_key_t fuse_context_key;
|
||||
static pthread_mutex_t fuse_context_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static int fuse_context_ref;
|
||||
|
||||
#ifdef USE_MODULES
|
||||
static struct fusemod_so *fuse_current_so;
|
||||
static struct fuse_module *fuse_modules;
|
||||
|
||||
@@ -319,6 +325,7 @@ static void fuse_put_module(struct fuse_module *m)
|
||||
}
|
||||
pthread_mutex_unlock(&fuse_context_lock);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void init_list_head(struct list_head *list)
|
||||
{
|
||||
@@ -1021,10 +1028,12 @@ static void queue_element_unlock(struct fuse *f, struct lock_queue_element *qe)
|
||||
if (qe->first_locked) {
|
||||
wnode = qe->wnode1 ? *qe->wnode1 : NULL;
|
||||
unlock_path(f, qe->nodeid1, wnode, NULL);
|
||||
qe->first_locked = false;
|
||||
}
|
||||
if (qe->second_locked) {
|
||||
wnode = qe->wnode2 ? *qe->wnode2 : NULL;
|
||||
unlock_path(f, qe->nodeid2, wnode, NULL);
|
||||
qe->second_locked = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1757,7 +1766,7 @@ static void fuse_free_buf(struct fuse_bufvec *buf)
|
||||
}
|
||||
|
||||
int fuse_fs_read_buf(struct fuse_fs *fs, const char *path,
|
||||
struct fuse_bufvec **bufp, size_t size, off64_t off,
|
||||
struct fuse_bufvec **bufp, size_t size, loff_t off,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
fuse_get_context()->private_data = fs->user_data;
|
||||
@@ -1812,7 +1821,7 @@ int fuse_fs_read_buf(struct fuse_fs *fs, const char *path,
|
||||
}
|
||||
|
||||
int fuse_fs_read(struct fuse_fs *fs, const char *path, char *mem, size_t size,
|
||||
off64_t off, struct fuse_file_info *fi)
|
||||
loff_t off, struct fuse_file_info *fi)
|
||||
{
|
||||
int res;
|
||||
struct fuse_bufvec *buf = NULL;
|
||||
@@ -1830,7 +1839,7 @@ int fuse_fs_read(struct fuse_fs *fs, const char *path, char *mem, size_t size,
|
||||
}
|
||||
|
||||
int fuse_fs_write_buf(struct fuse_fs *fs, const char *path,
|
||||
struct fuse_bufvec *buf, off64_t off,
|
||||
struct fuse_bufvec *buf, loff_t off,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
fuse_get_context()->private_data = fs->user_data;
|
||||
@@ -1894,7 +1903,7 @@ out:
|
||||
}
|
||||
|
||||
int fuse_fs_write(struct fuse_fs *fs, const char *path, const char *mem,
|
||||
size_t size, off64_t off, struct fuse_file_info *fi)
|
||||
size_t size, loff_t off, struct fuse_file_info *fi)
|
||||
{
|
||||
struct fuse_bufvec bufv = FUSE_BUFVEC_INIT(size);
|
||||
|
||||
@@ -1993,7 +2002,7 @@ static int fill_dir_old(struct fuse_dirhandle *dh, const char *name, int type,
|
||||
}
|
||||
|
||||
int fuse_fs_readdir(struct fuse_fs *fs, const char *path, void *buf,
|
||||
fuse_fill_dir_t filler, off64_t off,
|
||||
fuse_fill_dir_t filler, loff_t off,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
fuse_get_context()->private_data = fs->user_data;
|
||||
@@ -2104,7 +2113,7 @@ int fuse_fs_chown(struct fuse_fs *fs, const char *path, uid_t uid, gid_t gid)
|
||||
}
|
||||
}
|
||||
|
||||
int fuse_fs_truncate(struct fuse_fs *fs, const char *path, off64_t size)
|
||||
int fuse_fs_truncate(struct fuse_fs *fs, const char *path, loff_t size)
|
||||
{
|
||||
fuse_get_context()->private_data = fs->user_data;
|
||||
if (fs->op.truncate) {
|
||||
@@ -2118,7 +2127,7 @@ int fuse_fs_truncate(struct fuse_fs *fs, const char *path, off64_t size)
|
||||
}
|
||||
}
|
||||
|
||||
int fuse_fs_ftruncate(struct fuse_fs *fs, const char *path, off64_t size,
|
||||
int fuse_fs_ftruncate(struct fuse_fs *fs, const char *path, loff_t size,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
fuse_get_context()->private_data = fs->user_data;
|
||||
@@ -2336,7 +2345,7 @@ int fuse_fs_poll(struct fuse_fs *fs, const char *path,
|
||||
}
|
||||
|
||||
int fuse_fs_fallocate(struct fuse_fs *fs, const char *path, int mode,
|
||||
off64_t offset, off64_t length, struct fuse_file_info *fi)
|
||||
loff_t offset, loff_t length, struct fuse_file_info *fi)
|
||||
{
|
||||
fuse_get_context()->private_data = fs->user_data;
|
||||
if (fs->op.fallocate) {
|
||||
@@ -2393,6 +2402,7 @@ static char *hidden_name(struct fuse *f, fuse_ino_t dir, const char *oldname,
|
||||
if (res)
|
||||
break;
|
||||
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
res = fuse_fs_getattr(f->fs, newpath, &buf);
|
||||
if (res == -ENOENT)
|
||||
break;
|
||||
@@ -2608,8 +2618,10 @@ void fuse_fs_destroy(struct fuse_fs *fs)
|
||||
fuse_get_context()->private_data = fs->user_data;
|
||||
if (fs->op.destroy)
|
||||
fs->op.destroy(fs->user_data);
|
||||
#ifdef USE_MODULES
|
||||
if (fs->m)
|
||||
fuse_put_module(fs->m);
|
||||
#endif
|
||||
free(fs);
|
||||
}
|
||||
|
||||
@@ -2766,6 +2778,7 @@ static void fuse_lib_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
|
||||
char *path;
|
||||
int err;
|
||||
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
if (valid == FUSE_SET_ATTR_SIZE && fi != NULL &&
|
||||
f->fs->op.ftruncate && f->fs->op.fgetattr)
|
||||
err = get_path_nullok(f, ino, &path);
|
||||
@@ -3235,7 +3248,7 @@ static void fuse_lib_open(fuse_req_t req, fuse_ino_t ino,
|
||||
}
|
||||
|
||||
static void fuse_lib_read(fuse_req_t req, fuse_ino_t ino, size_t size,
|
||||
off64_t off, struct fuse_file_info *fi)
|
||||
loff_t off, struct fuse_file_info *fi)
|
||||
{
|
||||
struct fuse *f = req_fuse_prepare(req);
|
||||
struct fuse_bufvec *buf = NULL;
|
||||
@@ -3261,7 +3274,7 @@ static void fuse_lib_read(fuse_req_t req, fuse_ino_t ino, size_t size,
|
||||
}
|
||||
|
||||
static void fuse_lib_write_buf(fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_bufvec *buf, off64_t off,
|
||||
struct fuse_bufvec *buf, loff_t off,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
struct fuse *f = req_fuse_prepare(req);
|
||||
@@ -3390,7 +3403,7 @@ static int extend_contents(struct fuse_dh *dh, unsigned minsize)
|
||||
}
|
||||
|
||||
static int fill_dir(void *dh_, const char *name, const struct stat *statp,
|
||||
off64_t off)
|
||||
loff_t off)
|
||||
{
|
||||
struct fuse_dh *dh = (struct fuse_dh *) dh_;
|
||||
struct stat stbuf;
|
||||
@@ -3440,7 +3453,7 @@ static int fill_dir(void *dh_, const char *name, const struct stat *statp,
|
||||
}
|
||||
|
||||
static int readdir_fill(struct fuse *f, fuse_req_t req, fuse_ino_t ino,
|
||||
size_t size, off64_t off, struct fuse_dh *dh,
|
||||
size_t size, loff_t off, struct fuse_dh *dh,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
char *path;
|
||||
@@ -3472,7 +3485,7 @@ static int readdir_fill(struct fuse *f, fuse_req_t req, fuse_ino_t ino,
|
||||
}
|
||||
|
||||
static void fuse_lib_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
|
||||
off64_t off, struct fuse_file_info *llfi)
|
||||
loff_t off, struct fuse_file_info *llfi)
|
||||
{
|
||||
struct fuse *f = req_fuse_prepare(req);
|
||||
struct fuse_file_info fi;
|
||||
@@ -3995,12 +4008,13 @@ static void fuse_lib_bmap(fuse_req_t req, fuse_ino_t ino, size_t blocksize,
|
||||
}
|
||||
|
||||
static void fuse_lib_ioctl(fuse_req_t req, fuse_ino_t ino, int cmd, void *arg,
|
||||
struct fuse_file_info *fi, unsigned int flags,
|
||||
struct fuse_file_info *llfi, unsigned int flags,
|
||||
const void *in_buf, size_t in_bufsz,
|
||||
size_t out_bufsz)
|
||||
{
|
||||
struct fuse *f = req_fuse_prepare(req);
|
||||
struct fuse_intr_data d;
|
||||
struct fuse_file_info fi;
|
||||
char *path, *out_buf = NULL;
|
||||
int err;
|
||||
|
||||
@@ -4008,6 +4022,11 @@ static void fuse_lib_ioctl(fuse_req_t req, fuse_ino_t ino, int cmd, void *arg,
|
||||
if (flags & FUSE_IOCTL_UNRESTRICTED)
|
||||
goto err;
|
||||
|
||||
if (flags & FUSE_IOCTL_DIR)
|
||||
get_dirhandle(llfi, &fi);
|
||||
else
|
||||
fi = *llfi;
|
||||
|
||||
if (out_bufsz) {
|
||||
err = -ENOMEM;
|
||||
out_buf = malloc(out_bufsz);
|
||||
@@ -4025,7 +4044,7 @@ static void fuse_lib_ioctl(fuse_req_t req, fuse_ino_t ino, int cmd, void *arg,
|
||||
|
||||
fuse_prepare_interrupt(f, req, &d);
|
||||
|
||||
err = fuse_fs_ioctl(f->fs, path, cmd, arg, fi, flags,
|
||||
err = fuse_fs_ioctl(f->fs, path, cmd, arg, &fi, flags,
|
||||
out_buf ?: (void *)in_buf);
|
||||
|
||||
fuse_finish_interrupt(f, req, &d);
|
||||
@@ -4062,7 +4081,7 @@ static void fuse_lib_poll(fuse_req_t req, fuse_ino_t ino,
|
||||
}
|
||||
|
||||
static void fuse_lib_fallocate(fuse_req_t req, fuse_ino_t ino, int mode,
|
||||
off64_t offset, off64_t length, struct fuse_file_info *fi)
|
||||
loff_t offset, loff_t length, struct fuse_file_info *fi)
|
||||
{
|
||||
struct fuse *f = req_fuse_prepare(req);
|
||||
struct fuse_intr_data d;
|
||||
@@ -4415,12 +4434,14 @@ static void fuse_lib_help(void)
|
||||
" -o ac_attr_timeout=T auto cache timeout for attributes (attr_timeout)\n"
|
||||
" -o noforget never forget cached inodes\n"
|
||||
" -o remember=T remember cached inodes for T seconds (0s)\n"
|
||||
" -o nopath don't supply path if not necessary\n"
|
||||
" -o intr allow requests to be interrupted\n"
|
||||
" -o intr_signal=NUM signal to send on interrupt (%i)\n"
|
||||
" -o modules=M1[:M2...] names of modules to push onto filesystem stack\n"
|
||||
"\n", FUSE_DEFAULT_INTR_SIGNAL);
|
||||
}
|
||||
|
||||
#ifdef USE_MODULES
|
||||
static void fuse_lib_help_modules(void)
|
||||
{
|
||||
struct fuse_module *m;
|
||||
@@ -4440,6 +4461,7 @@ static void fuse_lib_help_modules(void)
|
||||
}
|
||||
pthread_mutex_unlock(&fuse_context_lock);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fuse_lib_opt_proc(void *data, const char *arg, int key,
|
||||
struct fuse_args *outargs)
|
||||
@@ -4495,7 +4517,7 @@ static void fuse_restore_intr_signal(int signum)
|
||||
sigaction(signum, &sa, NULL);
|
||||
}
|
||||
|
||||
|
||||
#ifdef USE_MODULES
|
||||
static int fuse_push_module(struct fuse *f, const char *module,
|
||||
struct fuse_args *args)
|
||||
{
|
||||
@@ -4518,6 +4540,7 @@ static int fuse_push_module(struct fuse *f, const char *module,
|
||||
f->utime_omit_ok = newfs->op.flag_utime_omit_ok && f->utime_omit_ok;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
struct fuse_fs *fuse_fs_new(const struct fuse_operations *op, size_t op_size,
|
||||
void *user_data)
|
||||
@@ -4555,11 +4578,30 @@ static int node_table_init(struct node_table *t)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void thread_exit_handler(int sig)
|
||||
{
|
||||
pthread_exit(0);
|
||||
}
|
||||
|
||||
static void *fuse_prune_nodes(void *fuse)
|
||||
{
|
||||
struct fuse *f = fuse;
|
||||
int sleep_time;
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
struct sigaction actions;
|
||||
memset(&actions, 0, sizeof(actions));
|
||||
sigemptyset(&actions.sa_mask);
|
||||
actions.sa_flags = 0;
|
||||
actions.sa_handler = thread_exit_handler;
|
||||
sigaction(SIGUSR1, &actions, NULL);
|
||||
|
||||
sigset_t setusr1;
|
||||
sigemptyset(&setusr1);
|
||||
sigaddset(&setusr1, SIGUSR1);
|
||||
pthread_sigmask(SIG_BLOCK, &setusr1, NULL);
|
||||
#endif
|
||||
|
||||
while(1) {
|
||||
sleep_time = fuse_clean_cache(f);
|
||||
sleep(sleep_time);
|
||||
@@ -4579,10 +4621,10 @@ void fuse_stop_cleanup_thread(struct fuse *f)
|
||||
{
|
||||
if (lru_enabled(f)) {
|
||||
pthread_mutex_lock(&f->lock);
|
||||
#ifndef ANDROID
|
||||
pthread_cancel(f->prune_thread);
|
||||
#else
|
||||
#if defined(__ANDROID__)
|
||||
pthread_kill(f->prune_thread, SIGUSR1);
|
||||
#else
|
||||
pthread_cancel(f->prune_thread);
|
||||
#endif
|
||||
pthread_mutex_unlock(&f->lock);
|
||||
pthread_join(f->prune_thread, NULL);
|
||||
@@ -4637,6 +4679,7 @@ struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
|
||||
fuse_lib_opt_proc) == -1)
|
||||
goto out_free_fs;
|
||||
|
||||
#ifdef USE_MODULES
|
||||
if (f->conf.modules) {
|
||||
char *module;
|
||||
char *next;
|
||||
@@ -4651,6 +4694,7 @@ struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
|
||||
goto out_free_fs;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!f->conf.ac_attr_timeout_set)
|
||||
f->conf.ac_attr_timeout = f->conf.attr_timeout;
|
||||
@@ -4670,8 +4714,10 @@ struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
|
||||
|
||||
f->se = fuse_lowlevel_new_common(args, &llop, sizeof(llop), f);
|
||||
if (f->se == NULL) {
|
||||
#ifdef USE_MODULES
|
||||
if (f->conf.help)
|
||||
fuse_lib_help_modules();
|
||||
#endif
|
||||
goto out_free_fs;
|
||||
}
|
||||
|
||||
@@ -4700,6 +4746,10 @@ struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
|
||||
fprintf(stderr, "fuse: memory allocation failed\n");
|
||||
goto out_free_id_table;
|
||||
}
|
||||
if (lru_enabled(f)) {
|
||||
struct node_lru *lnode = node_lru(root);
|
||||
init_list_head(&lnode->lru);
|
||||
}
|
||||
|
||||
strcpy(root->inline_name, "/");
|
||||
root->name = root->inline_name;
|
||||
@@ -4808,6 +4858,7 @@ static struct fuse *fuse_new_common_compat25(int fd, struct fuse_args *args,
|
||||
return f;
|
||||
}
|
||||
|
||||
#ifdef USE_MODULES
|
||||
/* called with fuse_context_lock held or during initialization (before
|
||||
main() has been called) */
|
||||
void fuse_register_module(struct fuse_module *mod)
|
||||
@@ -4819,6 +4870,7 @@ void fuse_register_module(struct fuse_module *mod)
|
||||
mod->next = fuse_modules;
|
||||
fuse_modules = mod;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
|
||||
|
||||
@@ -4870,11 +4922,11 @@ struct fuse *fuse_new_compat1(int fd, int flags,
|
||||
11);
|
||||
}
|
||||
|
||||
FUSE_SYMVER(".symver fuse_exited,__fuse_exited@");
|
||||
FUSE_SYMVER(".symver fuse_process_cmd,__fuse_process_cmd@");
|
||||
FUSE_SYMVER(".symver fuse_read_cmd,__fuse_read_cmd@");
|
||||
FUSE_SYMVER(".symver fuse_set_getcontext_func,__fuse_set_getcontext_func@");
|
||||
FUSE_SYMVER(".symver fuse_new_compat2,fuse_new@");
|
||||
FUSE_SYMVER(".symver fuse_exited,__fuse_exited@FUSE_UNVERSIONED");
|
||||
FUSE_SYMVER(".symver fuse_process_cmd,__fuse_process_cmd@FUSE_UNVERSIONED");
|
||||
FUSE_SYMVER(".symver fuse_read_cmd,__fuse_read_cmd@FUSE_UNVERSIONED");
|
||||
FUSE_SYMVER(".symver fuse_set_getcontext_func,__fuse_set_getcontext_func@FUSE_UNVERSIONED");
|
||||
FUSE_SYMVER(".symver fuse_new_compat2,fuse_new@FUSE_UNVERSIONED");
|
||||
FUSE_SYMVER(".symver fuse_new_compat22,fuse_new@FUSE_2.2");
|
||||
|
||||
#endif /* __FreeBSD__ || __NetBSD__ */
|
||||
|
||||
@@ -106,6 +106,8 @@ struct fuse_session *fuse_lowlevel_new_common(struct fuse_args *args,
|
||||
size_t op_size, void *userdata);
|
||||
|
||||
void fuse_kern_unmount_compat22(const char *mountpoint);
|
||||
int fuse_chan_clearfd(struct fuse_chan *ch);
|
||||
|
||||
void fuse_kern_unmount(const char *mountpoint, int fd);
|
||||
int fuse_kern_mount(const char *mountpoint, struct fuse_args *args);
|
||||
|
||||
|
||||
@@ -77,7 +77,10 @@ static int fuse_kern_chan_send(struct fuse_chan *ch, const struct iovec iov[],
|
||||
|
||||
static void fuse_kern_chan_destroy(struct fuse_chan *ch)
|
||||
{
|
||||
close(fuse_chan_fd(ch));
|
||||
int fd = fuse_chan_fd(ch);
|
||||
|
||||
if (fd != -1)
|
||||
close(fd);
|
||||
}
|
||||
|
||||
#define MIN_BUFSIZE 0x21000
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <semaphore.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <pthread.h>
|
||||
|
||||
/* Environment var controlling the thread stack size */
|
||||
#define ENVNAME_THREAD_STACK "FUSE_THREAD_STACK"
|
||||
@@ -62,16 +61,32 @@ static void list_del_worker(struct fuse_worker *w)
|
||||
next->prev = prev;
|
||||
}
|
||||
|
||||
#define PTHREAD_CANCEL_ENABLE 0
|
||||
#define PTHREAD_CANCEL_DISABLE 1
|
||||
|
||||
static int fuse_loop_start_thread(struct fuse_mt *mt);
|
||||
|
||||
static void thread_exit_handler(int sig)
|
||||
{
|
||||
pthread_exit(0);
|
||||
}
|
||||
|
||||
static void *fuse_do_work(void *data)
|
||||
{
|
||||
struct fuse_worker *w = (struct fuse_worker *) data;
|
||||
struct fuse_mt *mt = w->mt;
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
struct sigaction actions;
|
||||
memset(&actions, 0, sizeof(actions));
|
||||
sigemptyset(&actions.sa_mask);
|
||||
actions.sa_flags = 0;
|
||||
actions.sa_handler = thread_exit_handler;
|
||||
sigaction(SIGUSR1, &actions, NULL);
|
||||
|
||||
sigset_t setusr1;
|
||||
sigemptyset(&setusr1);
|
||||
sigaddset(&setusr1, SIGUSR1);
|
||||
pthread_sigmask(SIG_BLOCK, &setusr1, NULL);
|
||||
#endif
|
||||
|
||||
while (!fuse_session_exited(mt->se)) {
|
||||
int isforget = 0;
|
||||
struct fuse_chan *ch = mt->prevch;
|
||||
@@ -81,11 +96,15 @@ static void *fuse_do_work(void *data)
|
||||
};
|
||||
int res;
|
||||
|
||||
#ifndef ANDROID
|
||||
#if defined(__ANDROID__)
|
||||
pthread_sigmask(SIG_UNBLOCK, &setusr1, NULL);
|
||||
#else
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
#endif
|
||||
res = fuse_session_receive_buf(mt->se, &fbuf, &ch);
|
||||
#ifndef ANDROID
|
||||
#if defined(__ANDROID__)
|
||||
pthread_sigmask(SIG_BLOCK, &setusr1, NULL);
|
||||
#else
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
|
||||
#endif
|
||||
if (res == -EINTR)
|
||||
@@ -249,14 +268,15 @@ int fuse_session_loop_mt(struct fuse_session *se)
|
||||
while (!fuse_session_exited(se))
|
||||
sem_wait(&mt.finish);
|
||||
|
||||
#ifndef ANDROID
|
||||
pthread_mutex_lock(&mt.lock);
|
||||
for (w = mt.main.next; w != &mt.main; w = w->next)
|
||||
pthread_cancel(w->thread_id);
|
||||
#else
|
||||
for (w = mt.main.next; w != &mt.main; w = w->next)
|
||||
#if defined(__ANDROID__)
|
||||
pthread_kill(w->thread_id, SIGUSR1);
|
||||
#else
|
||||
pthread_cancel(w->thread_id);
|
||||
#endif
|
||||
mt.exit = 1;
|
||||
pthread_mutex_unlock(&mt.lock);
|
||||
|
||||
while (mt.main.next != &mt.main)
|
||||
fuse_join_worker(&mt, mt.main.next);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <sys/file.h>
|
||||
|
||||
#ifndef F_LINUX_SPECIFIC_BASE
|
||||
#define F_LINUX_SPECIFIC_BASE 1024
|
||||
@@ -247,7 +248,7 @@ size_t fuse_dirent_size(size_t namelen)
|
||||
}
|
||||
|
||||
char *fuse_add_dirent(char *buf, const char *name, const struct stat *stbuf,
|
||||
off64_t off)
|
||||
loff_t off)
|
||||
{
|
||||
unsigned namelen = strlen(name);
|
||||
unsigned entlen = FUSE_NAME_OFFSET + namelen;
|
||||
@@ -267,7 +268,7 @@ char *fuse_add_dirent(char *buf, const char *name, const struct stat *stbuf,
|
||||
}
|
||||
|
||||
size_t fuse_add_direntry(fuse_req_t req, char *buf, size_t bufsize,
|
||||
const char *name, const struct stat *stbuf, off64_t off)
|
||||
const char *name, const struct stat *stbuf, loff_t off)
|
||||
{
|
||||
size_t entsize;
|
||||
|
||||
@@ -1979,7 +1980,7 @@ int fuse_lowlevel_notify_poll(struct fuse_pollhandle *ph)
|
||||
}
|
||||
|
||||
int fuse_lowlevel_notify_inval_inode(struct fuse_chan *ch, fuse_ino_t ino,
|
||||
off64_t off, off64_t len)
|
||||
loff_t off, loff_t len)
|
||||
{
|
||||
struct fuse_notify_inval_inode_out outarg;
|
||||
struct fuse_ll *f;
|
||||
@@ -2060,7 +2061,7 @@ int fuse_lowlevel_notify_delete(struct fuse_chan *ch,
|
||||
}
|
||||
|
||||
int fuse_lowlevel_notify_store(struct fuse_chan *ch, fuse_ino_t ino,
|
||||
off64_t offset, struct fuse_bufvec *bufv,
|
||||
loff_t offset, struct fuse_bufvec *bufv,
|
||||
enum fuse_buf_copy_flags flags)
|
||||
{
|
||||
struct fuse_out_header out;
|
||||
@@ -2144,7 +2145,7 @@ out:
|
||||
}
|
||||
|
||||
int fuse_lowlevel_notify_retrieve(struct fuse_chan *ch, fuse_ino_t ino,
|
||||
size_t size, off64_t offset, void *cookie)
|
||||
size_t size, loff_t offset, void *cookie)
|
||||
{
|
||||
struct fuse_notify_retrieve_out outarg;
|
||||
struct fuse_ll *f;
|
||||
|
||||
@@ -119,4 +119,4 @@ int fuse_loop_mt(struct fuse *f)
|
||||
return res;
|
||||
}
|
||||
|
||||
FUSE_SYMVER(".symver fuse_loop_mt_proc,__fuse_loop_mt@");
|
||||
FUSE_SYMVER(".symver fuse_loop_mt_proc,__fuse_loop_mt@FUSE_UNVERSIONED");
|
||||
|
||||
@@ -182,6 +182,16 @@ int fuse_chan_fd(struct fuse_chan *ch)
|
||||
return ch->fd;
|
||||
}
|
||||
|
||||
int fuse_chan_clearfd(struct fuse_chan *ch)
|
||||
{
|
||||
if (ch == NULL)
|
||||
return -1;
|
||||
|
||||
int fd = ch->fd;
|
||||
ch->fd = -1;
|
||||
return fd;
|
||||
}
|
||||
|
||||
size_t fuse_chan_bufsize(struct fuse_chan *ch)
|
||||
{
|
||||
return ch->bufsize;
|
||||
|
||||
@@ -21,13 +21,13 @@ static void exit_handler(int sig)
|
||||
fuse_session_exit(fuse_instance);
|
||||
}
|
||||
|
||||
static int set_one_signal_handler(int sig, void (*handler)(int))
|
||||
static int set_one_signal_handler(int sig, void (*handler)(int), int remove)
|
||||
{
|
||||
struct sigaction sa;
|
||||
struct sigaction old_sa;
|
||||
|
||||
memset(&sa, 0, sizeof(struct sigaction));
|
||||
sa.sa_handler = handler;
|
||||
sa.sa_handler = remove ? SIG_DFL : handler;
|
||||
sigemptyset(&(sa.sa_mask));
|
||||
sa.sa_flags = 0;
|
||||
|
||||
@@ -36,7 +36,7 @@ static int set_one_signal_handler(int sig, void (*handler)(int))
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (old_sa.sa_handler == SIG_DFL &&
|
||||
if (old_sa.sa_handler == (remove ? handler : SIG_DFL) &&
|
||||
sigaction(sig, &sa, NULL) == -1) {
|
||||
perror("fuse: cannot set signal handler");
|
||||
return -1;
|
||||
@@ -46,10 +46,10 @@ static int set_one_signal_handler(int sig, void (*handler)(int))
|
||||
|
||||
int fuse_set_signal_handlers(struct fuse_session *se)
|
||||
{
|
||||
if (set_one_signal_handler(SIGHUP, exit_handler) == -1 ||
|
||||
set_one_signal_handler(SIGINT, exit_handler) == -1 ||
|
||||
set_one_signal_handler(SIGTERM, exit_handler) == -1 ||
|
||||
set_one_signal_handler(SIGPIPE, SIG_IGN) == -1)
|
||||
if (set_one_signal_handler(SIGHUP, exit_handler, 0) == -1 ||
|
||||
set_one_signal_handler(SIGINT, exit_handler, 0) == -1 ||
|
||||
set_one_signal_handler(SIGTERM, exit_handler, 0) == -1 ||
|
||||
set_one_signal_handler(SIGPIPE, SIG_IGN, 0) == -1)
|
||||
return -1;
|
||||
|
||||
fuse_instance = se;
|
||||
@@ -64,9 +64,9 @@ void fuse_remove_signal_handlers(struct fuse_session *se)
|
||||
else
|
||||
fuse_instance = NULL;
|
||||
|
||||
set_one_signal_handler(SIGHUP, SIG_DFL);
|
||||
set_one_signal_handler(SIGINT, SIG_DFL);
|
||||
set_one_signal_handler(SIGTERM, SIG_DFL);
|
||||
set_one_signal_handler(SIGPIPE, SIG_DFL);
|
||||
set_one_signal_handler(SIGHUP, exit_handler, 1);
|
||||
set_one_signal_handler(SIGINT, exit_handler, 1);
|
||||
set_one_signal_handler(SIGTERM, exit_handler, 1);
|
||||
set_one_signal_handler(SIGPIPE, SIG_IGN, 1);
|
||||
}
|
||||
|
||||
|
||||
210
fuse/fuse_versionscript
Normal file
210
fuse/fuse_versionscript
Normal file
@@ -0,0 +1,210 @@
|
||||
FUSE_UNVERSIONED {
|
||||
};
|
||||
|
||||
FUSE_2.2 {
|
||||
global:
|
||||
fuse_destroy;
|
||||
fuse_exit;
|
||||
fuse_exited;
|
||||
fuse_invalidate;
|
||||
fuse_is_lib_option;
|
||||
fuse_loop;
|
||||
fuse_loop_mt;
|
||||
fuse_loop_mt_proc;
|
||||
fuse_main;
|
||||
fuse_main_compat1;
|
||||
fuse_main_compat2;
|
||||
fuse_mount_compat1;
|
||||
fuse_new_compat1;
|
||||
fuse_new_compat2;
|
||||
fuse_process_cmd;
|
||||
fuse_read_cmd;
|
||||
fuse_set_getcontext_func;
|
||||
fuse_setup_compat2;
|
||||
};
|
||||
|
||||
FUSE_2.4 {
|
||||
global:
|
||||
fuse_add_dirent;
|
||||
fuse_chan_bufsize;
|
||||
fuse_chan_data;
|
||||
fuse_chan_destroy;
|
||||
fuse_chan_fd;
|
||||
fuse_chan_receive;
|
||||
fuse_chan_send;
|
||||
fuse_chan_session;
|
||||
fuse_dirent_size;
|
||||
fuse_kern_chan_new;
|
||||
fuse_lowlevel_is_lib_option;
|
||||
fuse_reply_attr;
|
||||
fuse_reply_buf;
|
||||
fuse_reply_entry;
|
||||
fuse_reply_err;
|
||||
fuse_reply_none;
|
||||
fuse_reply_readlink;
|
||||
fuse_reply_write;
|
||||
fuse_reply_xattr;
|
||||
fuse_req_userdata;
|
||||
fuse_session_add_chan;
|
||||
fuse_session_destroy;
|
||||
fuse_session_exit;
|
||||
fuse_session_exited;
|
||||
fuse_session_loop;
|
||||
fuse_session_loop_mt;
|
||||
fuse_session_new;
|
||||
fuse_session_next_chan;
|
||||
fuse_session_process;
|
||||
fuse_session_reset;
|
||||
} FUSE_2.2;
|
||||
|
||||
FUSE_2.5 {
|
||||
global:
|
||||
fuse_lowlevel_new_compat;
|
||||
fuse_main_real_compat22;
|
||||
fuse_mount_compat22;
|
||||
fuse_new_compat22;
|
||||
fuse_opt_parse;
|
||||
fuse_opt_add_opt;
|
||||
fuse_opt_add_arg;
|
||||
fuse_opt_free_args;
|
||||
fuse_opt_match;
|
||||
fuse_parse_cmdline;
|
||||
fuse_remove_signal_handlers;
|
||||
fuse_reply_create;
|
||||
fuse_reply_open;
|
||||
fuse_reply_open_compat;
|
||||
fuse_reply_statfs;
|
||||
fuse_reply_statfs_compat;
|
||||
fuse_setup_compat22;
|
||||
fuse_set_signal_handlers;
|
||||
} FUSE_2.4;
|
||||
|
||||
FUSE_2.6 {
|
||||
global:
|
||||
fuse_add_direntry;
|
||||
fuse_chan_new;
|
||||
fuse_chan_new_compat24;
|
||||
fuse_chan_recv;
|
||||
fuse_daemonize;
|
||||
fuse_get_session;
|
||||
fuse_interrupted;
|
||||
fuse_lowlevel_new;
|
||||
fuse_lowlevel_new_compat25;
|
||||
fuse_main_real;
|
||||
fuse_main_real_compat25;
|
||||
fuse_mount;
|
||||
fuse_mount_compat25;
|
||||
fuse_new;
|
||||
fuse_new_compat25;
|
||||
fuse_opt_insert_arg;
|
||||
fuse_reply_lock;
|
||||
fuse_req_interrupt_func;
|
||||
fuse_req_interrupted;
|
||||
fuse_session_remove_chan;
|
||||
fuse_setup;
|
||||
fuse_setup_compat25;
|
||||
fuse_teardown;
|
||||
fuse_teardown_compat22;
|
||||
fuse_unmount;
|
||||
fuse_unmount_compat22;
|
||||
} FUSE_2.5;
|
||||
|
||||
FUSE_2.7 {
|
||||
global:
|
||||
fuse_fs_access;
|
||||
fuse_fs_bmap;
|
||||
fuse_fs_chmod;
|
||||
fuse_fs_chown;
|
||||
fuse_fs_create;
|
||||
fuse_fs_destroy;
|
||||
fuse_fs_fgetattr;
|
||||
fuse_fs_flush;
|
||||
fuse_fs_fsync;
|
||||
fuse_fs_fsyncdir;
|
||||
fuse_fs_ftruncate;
|
||||
fuse_fs_getattr;
|
||||
fuse_fs_getxattr;
|
||||
fuse_fs_init;
|
||||
fuse_fs_link;
|
||||
fuse_fs_listxattr;
|
||||
fuse_fs_lock;
|
||||
fuse_fs_mkdir;
|
||||
fuse_fs_mknod;
|
||||
fuse_fs_new;
|
||||
fuse_fs_open;
|
||||
fuse_fs_opendir;
|
||||
fuse_fs_read;
|
||||
fuse_fs_readdir;
|
||||
fuse_fs_readlink;
|
||||
fuse_fs_release;
|
||||
fuse_fs_releasedir;
|
||||
fuse_fs_removexattr;
|
||||
fuse_fs_rename;
|
||||
fuse_fs_rmdir;
|
||||
fuse_fs_setxattr;
|
||||
fuse_fs_statfs;
|
||||
fuse_fs_symlink;
|
||||
fuse_fs_truncate;
|
||||
fuse_fs_unlink;
|
||||
fuse_fs_utimens;
|
||||
fuse_fs_write;
|
||||
fuse_register_module;
|
||||
fuse_reply_iov;
|
||||
fuse_version;
|
||||
} FUSE_2.6;
|
||||
|
||||
FUSE_2.7.5 {
|
||||
global:
|
||||
fuse_reply_bmap;
|
||||
} FUSE_2.7;
|
||||
|
||||
FUSE_2.8 {
|
||||
global:
|
||||
cuse_lowlevel_new;
|
||||
cuse_lowlevel_main;
|
||||
cuse_lowlevel_setup;
|
||||
cuse_lowlevel_teardown;
|
||||
fuse_fs_ioctl;
|
||||
fuse_fs_poll;
|
||||
fuse_get_context;
|
||||
fuse_getgroups;
|
||||
fuse_lowlevel_notify_inval_entry;
|
||||
fuse_lowlevel_notify_inval_inode;
|
||||
fuse_lowlevel_notify_poll;
|
||||
fuse_notify_poll;
|
||||
fuse_opt_add_opt_escaped;
|
||||
fuse_pollhandle_destroy;
|
||||
fuse_reply_ioctl;
|
||||
fuse_reply_ioctl_iov;
|
||||
fuse_reply_ioctl_retry;
|
||||
fuse_reply_poll;
|
||||
fuse_req_ctx;
|
||||
fuse_req_getgroups;
|
||||
fuse_session_data;
|
||||
} FUSE_2.7.5;
|
||||
|
||||
FUSE_2.9 {
|
||||
global:
|
||||
fuse_buf_copy;
|
||||
fuse_buf_size;
|
||||
fuse_fs_read_buf;
|
||||
fuse_fs_write_buf;
|
||||
fuse_lowlevel_notify_retrieve;
|
||||
fuse_lowlevel_notify_store;
|
||||
fuse_reply_data;
|
||||
fuse_session_process_buf;
|
||||
fuse_session_receive_buf;
|
||||
fuse_start_cleanup_thread;
|
||||
fuse_stop_cleanup_thread;
|
||||
fuse_clean_cache;
|
||||
fuse_lowlevel_notify_delete;
|
||||
fuse_fs_flock;
|
||||
} FUSE_2.8;
|
||||
|
||||
FUSE_2.9.1 {
|
||||
global:
|
||||
fuse_fs_fallocate;
|
||||
|
||||
local:
|
||||
*;
|
||||
} FUSE_2.9;
|
||||
385
fuse/fusexmp.c
385
fuse/fusexmp.c
@@ -1,385 +0,0 @@
|
||||
/*
|
||||
FUSE: Filesystem in Userspace
|
||||
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
|
||||
|
||||
This program can be distributed under the terms of the GNU GPL.
|
||||
See the file COPYING.
|
||||
|
||||
gcc -Wall `pkg-config fuse --cflags --libs` fusexmp.c -o fusexmp
|
||||
*/
|
||||
|
||||
#define FUSE_USE_VERSION 26
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef linux
|
||||
/* For pread()/pwrite() */
|
||||
#define _XOPEN_SOURCE 500
|
||||
#endif
|
||||
|
||||
#include <fuse.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
#ifdef HAVE_SETXATTR
|
||||
#include <sys/xattr.h>
|
||||
#endif
|
||||
|
||||
static int xmp_getattr(const char *path, struct stat *stbuf)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = lstat(path, stbuf);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_access(const char *path, int mask)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = access(path, mask);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_readlink(const char *path, char *buf, size_t size)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = readlink(path, buf, size - 1);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
buf[res] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int xmp_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
|
||||
off64_t offset, struct fuse_file_info *fi)
|
||||
{
|
||||
DIR *dp;
|
||||
struct dirent *de;
|
||||
|
||||
(void) offset;
|
||||
(void) fi;
|
||||
|
||||
dp = opendir(path);
|
||||
if (dp == NULL)
|
||||
return -errno;
|
||||
|
||||
while ((de = readdir(dp)) != NULL) {
|
||||
struct stat st;
|
||||
memset(&st, 0, sizeof(st));
|
||||
st.st_ino = de->d_ino;
|
||||
st.st_mode = de->d_type << 12;
|
||||
if (filler(buf, de->d_name, &st, 0))
|
||||
break;
|
||||
}
|
||||
|
||||
closedir(dp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_mknod(const char *path, mode_t mode, dev_t rdev)
|
||||
{
|
||||
int res;
|
||||
|
||||
/* On Linux this could just be 'mknod(path, mode, rdev)' but this
|
||||
is more portable */
|
||||
if (S_ISREG(mode)) {
|
||||
res = open(path, O_CREAT | O_EXCL | O_WRONLY, mode);
|
||||
if (res >= 0)
|
||||
res = close(res);
|
||||
} else if (S_ISFIFO(mode))
|
||||
res = mkfifo(path, mode);
|
||||
else
|
||||
res = mknod(path, mode, rdev);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_mkdir(const char *path, mode_t mode)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = mkdir(path, mode);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_unlink(const char *path)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = unlink(path);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_rmdir(const char *path)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = rmdir(path);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_symlink(const char *from, const char *to)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = symlink(from, to);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_rename(const char *from, const char *to)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = rename(from, to);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_link(const char *from, const char *to)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = link(from, to);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_chmod(const char *path, mode_t mode)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = chmod(path, mode);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_chown(const char *path, uid_t uid, gid_t gid)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = lchown(path, uid, gid);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_truncate(const char *path, off64_t size)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = truncate(path, size);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_utimens(const char *path, const struct timespec ts[2])
|
||||
{
|
||||
int res;
|
||||
struct timeval tv[2];
|
||||
|
||||
tv[0].tv_sec = ts[0].tv_sec;
|
||||
tv[0].tv_usec = ts[0].tv_nsec / 1000;
|
||||
tv[1].tv_sec = ts[1].tv_sec;
|
||||
tv[1].tv_usec = ts[1].tv_nsec / 1000;
|
||||
|
||||
res = utimes(path, tv);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_open(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = open(path, fi->flags);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
close(res);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_read(const char *path, char *buf, size_t size, off64_t offset,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
int fd;
|
||||
int res;
|
||||
|
||||
(void) fi;
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd == -1)
|
||||
return -errno;
|
||||
|
||||
res = pread(fd, buf, size, offset);
|
||||
if (res == -1)
|
||||
res = -errno;
|
||||
|
||||
close(fd);
|
||||
return res;
|
||||
}
|
||||
|
||||
static int xmp_write(const char *path, const char *buf, size_t size,
|
||||
off64_t offset, struct fuse_file_info *fi)
|
||||
{
|
||||
int fd;
|
||||
int res;
|
||||
|
||||
(void) fi;
|
||||
fd = open(path, O_WRONLY);
|
||||
if (fd == -1)
|
||||
return -errno;
|
||||
|
||||
res = pwrite(fd, buf, size, offset);
|
||||
if (res == -1)
|
||||
res = -errno;
|
||||
|
||||
close(fd);
|
||||
return res;
|
||||
}
|
||||
|
||||
static int xmp_statfs(const char *path, struct statvfs *stbuf)
|
||||
{
|
||||
int res;
|
||||
|
||||
//res = statvfs(path, stbuf);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_release(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
/* Just a stub. This method is optional and can safely be left
|
||||
unimplemented */
|
||||
|
||||
(void) path;
|
||||
(void) fi;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_fsync(const char *path, int isdatasync,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
/* Just a stub. This method is optional and can safely be left
|
||||
unimplemented */
|
||||
|
||||
(void) path;
|
||||
(void) isdatasync;
|
||||
(void) fi;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SETXATTR
|
||||
/* xattr operations are optional and can safely be left unimplemented */
|
||||
static int xmp_setxattr(const char *path, const char *name, const char *value,
|
||||
size_t size, int flags)
|
||||
{
|
||||
int res = lsetxattr(path, name, value, size, flags);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_getxattr(const char *path, const char *name, char *value,
|
||||
size_t size)
|
||||
{
|
||||
int res = lgetxattr(path, name, value, size);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
return res;
|
||||
}
|
||||
|
||||
static int xmp_listxattr(const char *path, char *list, size_t size)
|
||||
{
|
||||
int res = llistxattr(path, list, size);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
return res;
|
||||
}
|
||||
|
||||
static int xmp_removexattr(const char *path, const char *name)
|
||||
{
|
||||
int res = lremovexattr(path, name);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
#endif /* HAVE_SETXATTR */
|
||||
|
||||
static struct fuse_operations xmp_oper = {
|
||||
.getattr = xmp_getattr,
|
||||
.access = xmp_access,
|
||||
.readlink = xmp_readlink,
|
||||
.readdir = xmp_readdir,
|
||||
.mknod = xmp_mknod,
|
||||
.mkdir = xmp_mkdir,
|
||||
.symlink = xmp_symlink,
|
||||
.unlink = xmp_unlink,
|
||||
.rmdir = xmp_rmdir,
|
||||
.rename = xmp_rename,
|
||||
.link = xmp_link,
|
||||
.chmod = xmp_chmod,
|
||||
.chown = xmp_chown,
|
||||
.truncate = xmp_truncate,
|
||||
.utimens = xmp_utimens,
|
||||
.open = xmp_open,
|
||||
.read = xmp_read,
|
||||
.write = xmp_write,
|
||||
.statfs = xmp_statfs,
|
||||
.release = xmp_release,
|
||||
.fsync = xmp_fsync,
|
||||
#ifdef HAVE_SETXATTR
|
||||
.setxattr = xmp_setxattr,
|
||||
.getxattr = xmp_getxattr,
|
||||
.listxattr = xmp_listxattr,
|
||||
.removexattr = xmp_removexattr,
|
||||
#endif
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
umask(0);
|
||||
return fuse_main(argc, argv, &xmp_oper, NULL);
|
||||
}
|
||||
@@ -249,10 +249,12 @@ struct fuse_chan *fuse_mount(const char *mountpoint, struct fuse_args *args)
|
||||
|
||||
static void fuse_unmount_common(const char *mountpoint, struct fuse_chan *ch)
|
||||
{
|
||||
int fd = ch ? fuse_chan_fd(ch) : -1;
|
||||
fuse_kern_unmount(mountpoint, fd);
|
||||
if (ch)
|
||||
fuse_chan_destroy(ch);
|
||||
if (mountpoint) {
|
||||
int fd = ch ? fuse_chan_clearfd(ch) : -1;
|
||||
fuse_kern_unmount(mountpoint, fd);
|
||||
if (ch)
|
||||
fuse_chan_destroy(ch);
|
||||
}
|
||||
}
|
||||
|
||||
void fuse_unmount(const char *mountpoint, struct fuse_chan *ch)
|
||||
@@ -434,10 +436,10 @@ int fuse_mount_compat1(const char *mountpoint, const char *args[])
|
||||
return fuse_mount_compat22(mountpoint, NULL);
|
||||
}
|
||||
|
||||
FUSE_SYMVER(".symver fuse_setup_compat2,__fuse_setup@");
|
||||
FUSE_SYMVER(".symver fuse_setup_compat2,__fuse_setup@FUSE_UNVERSIONED");
|
||||
FUSE_SYMVER(".symver fuse_setup_compat22,fuse_setup@FUSE_2.2");
|
||||
FUSE_SYMVER(".symver fuse_teardown,__fuse_teardown@");
|
||||
FUSE_SYMVER(".symver fuse_main_compat2,fuse_main@");
|
||||
FUSE_SYMVER(".symver fuse_teardown,__fuse_teardown@FUSE_UNVERSIONED");
|
||||
FUSE_SYMVER(".symver fuse_main_compat2,fuse_main@FUSE_UNVERSIONED");
|
||||
FUSE_SYMVER(".symver fuse_main_real_compat22,fuse_main_real@FUSE_2.2");
|
||||
|
||||
#endif /* __FreeBSD__ || __NetBSD__ */
|
||||
|
||||
@@ -1,515 +0,0 @@
|
||||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# include/Makefile. Generated from Makefile.in by configure.
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
|
||||
|
||||
pkgdatadir = $(datadir)/fuse
|
||||
pkgincludedir = $(includedir)/fuse
|
||||
pkglibdir = $(libdir)/fuse
|
||||
pkglibexecdir = $(libexecdir)/fuse
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = i686-pc-linux-gnu
|
||||
host_triplet = i686-pc-linux-gnu
|
||||
target_triplet = i686-pc-linux-gnu
|
||||
subdir = include
|
||||
DIST_COMMON = $(fuseinclude_HEADERS) $(include_HEADERS) \
|
||||
$(noinst_HEADERS) $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/config.h.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__installdirs = "$(DESTDIR)$(fuseincludedir)" \
|
||||
"$(DESTDIR)$(includedir)"
|
||||
HEADERS = $(fuseinclude_HEADERS) $(include_HEADERS) $(noinst_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = ${SHELL} /root/fuse-2.8.5/missing --run aclocal-1.11
|
||||
AMTAR = ${SHELL} /root/fuse-2.8.5/missing --run tar
|
||||
AR = ar
|
||||
AUTOCONF = ${SHELL} /root/fuse-2.8.5/missing --run autoconf
|
||||
AUTOHEADER = ${SHELL} /root/fuse-2.8.5/missing --run autoheader
|
||||
AUTOMAKE = ${SHELL} /root/fuse-2.8.5/missing --run automake-1.11
|
||||
AWK = mawk
|
||||
CC = gcc
|
||||
CCDEPMODE = depmode=gcc3
|
||||
CFLAGS = -Wall -W -Wno-sign-compare -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings -g -O2 -fno-strict-aliasing
|
||||
CPP = gcc -E
|
||||
CPPFLAGS =
|
||||
CYGPATH_W = echo
|
||||
DEFS = -DHAVE_CONFIG_H
|
||||
DEPDIR = .deps
|
||||
DSYMUTIL =
|
||||
DUMPBIN =
|
||||
ECHO_C =
|
||||
ECHO_N = -n
|
||||
ECHO_T =
|
||||
EGREP = /bin/grep -E
|
||||
EXEEXT =
|
||||
FGREP = /bin/grep -F
|
||||
GREP = /bin/grep
|
||||
INIT_D_PATH = /etc/init.d
|
||||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_SCRIPT = ${INSTALL}
|
||||
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
|
||||
LD = /usr/bin/ld
|
||||
LDFLAGS =
|
||||
LIBICONV =
|
||||
LIBOBJS =
|
||||
LIBS =
|
||||
LIBTOOL = $(SHELL) $(top_builddir)/libtool
|
||||
LIPO =
|
||||
LN_S = ln -s
|
||||
LTLIBICONV =
|
||||
LTLIBOBJS =
|
||||
MAKEINFO = ${SHELL} /root/fuse-2.8.5/missing --run makeinfo
|
||||
MKDIR_P = /bin/mkdir -p
|
||||
MOUNT_FUSE_PATH = /sbin
|
||||
NM = /usr/bin/nm -B
|
||||
NMEDIT =
|
||||
OBJDUMP = objdump
|
||||
OBJEXT = o
|
||||
OTOOL =
|
||||
OTOOL64 =
|
||||
PACKAGE = fuse
|
||||
PACKAGE_BUGREPORT =
|
||||
PACKAGE_NAME = fuse
|
||||
PACKAGE_STRING = fuse 2.8.5
|
||||
PACKAGE_TARNAME = fuse
|
||||
PACKAGE_VERSION = 2.8.5
|
||||
PATH_SEPARATOR = :
|
||||
RANLIB = ranlib
|
||||
SED = /bin/sed
|
||||
SET_MAKE =
|
||||
SHELL = /bin/bash
|
||||
STRIP = strip
|
||||
UDEV_RULES_PATH = /etc/udev/rules.d
|
||||
VERSION = 2.8.5
|
||||
abs_builddir = /root/fuse-2.8.5/include
|
||||
abs_srcdir = /root/fuse-2.8.5/include
|
||||
abs_top_builddir = /root/fuse-2.8.5
|
||||
abs_top_srcdir = /root/fuse-2.8.5
|
||||
ac_ct_CC = gcc
|
||||
ac_ct_DUMPBIN =
|
||||
am__include = include
|
||||
am__leading_dot = .
|
||||
am__quote =
|
||||
am__tar = ${AMTAR} chof - "$$tardir"
|
||||
am__untar = ${AMTAR} xf -
|
||||
bindir = ${exec_prefix}/bin
|
||||
build = i686-pc-linux-gnu
|
||||
build_alias =
|
||||
build_cpu = i686
|
||||
build_os = linux-gnu
|
||||
build_vendor = pc
|
||||
builddir = .
|
||||
datadir = ${datarootdir}
|
||||
datarootdir = ${prefix}/share
|
||||
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
|
||||
dvidir = ${docdir}
|
||||
exec_prefix = ${prefix}
|
||||
host = i686-pc-linux-gnu
|
||||
host_alias =
|
||||
host_cpu = i686
|
||||
host_os = linux-gnu
|
||||
host_vendor = pc
|
||||
htmldir = ${docdir}
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${datarootdir}/info
|
||||
install_sh = ${SHELL} /root/fuse-2.8.5/install-sh
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
libfuse_libs = -pthread -lrt -ldl
|
||||
localedir = ${datarootdir}/locale
|
||||
localstatedir = ${prefix}/var
|
||||
lt_ECHO = echo
|
||||
mandir = ${datarootdir}/man
|
||||
mkdir_p = /bin/mkdir -p
|
||||
oldincludedir = /usr/include
|
||||
pdfdir = ${docdir}
|
||||
pkgconfigdir = ${libdir}/pkgconfig
|
||||
prefix = /usr/local
|
||||
program_transform_name = s,x,x,
|
||||
psdir = ${docdir}
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
sharedstatedir = ${prefix}/com
|
||||
srcdir = .
|
||||
subdirs2 = include lib util example
|
||||
sysconfdir = ${prefix}/etc
|
||||
target = i686-pc-linux-gnu
|
||||
target_alias =
|
||||
target_cpu = i686
|
||||
target_os = linux-gnu
|
||||
target_vendor = pc
|
||||
top_build_prefix = ../
|
||||
top_builddir = ..
|
||||
top_srcdir = ..
|
||||
fuseincludedir = $(includedir)/fuse
|
||||
fuseinclude_HEADERS = \
|
||||
fuse.h \
|
||||
fuse_compat.h \
|
||||
fuse_common.h \
|
||||
fuse_common_compat.h \
|
||||
fuse_lowlevel.h \
|
||||
fuse_lowlevel_compat.h \
|
||||
fuse_opt.h \
|
||||
cuse_lowlevel.h
|
||||
|
||||
include_HEADERS = old/fuse.h ulockmgr.h
|
||||
noinst_HEADERS = fuse_kernel.h
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu include/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status include/config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-fuseincludeHEADERS: $(fuseinclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(fuseincludedir)" || $(MKDIR_P) "$(DESTDIR)$(fuseincludedir)"
|
||||
@list='$(fuseinclude_HEADERS)'; test -n "$(fuseincludedir)" || list=; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(fuseincludedir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(fuseincludedir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-fuseincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(fuseinclude_HEADERS)'; test -n "$(fuseincludedir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(fuseincludedir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(fuseincludedir)" && rm -f $$files
|
||||
install-includeHEADERS: $(include_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
|
||||
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-includeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(includedir)" && rm -f $$files
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(HEADERS) config.h
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(fuseincludedir)" "$(DESTDIR)$(includedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-fuseincludeHEADERS install-includeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-fuseincludeHEADERS uninstall-includeHEADERS
|
||||
|
||||
.MAKE: all install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool ctags distclean distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-fuseincludeHEADERS install-html \
|
||||
install-html-am install-includeHEADERS install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-fuseincludeHEADERS \
|
||||
uninstall-includeHEADERS
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -1,515 +0,0 @@
|
||||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = include
|
||||
DIST_COMMON = $(fuseinclude_HEADERS) $(include_HEADERS) \
|
||||
$(noinst_HEADERS) $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/config.h.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__installdirs = "$(DESTDIR)$(fuseincludedir)" \
|
||||
"$(DESTDIR)$(includedir)"
|
||||
HEADERS = $(fuseinclude_HEADERS) $(include_HEADERS) $(noinst_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
INIT_D_PATH = @INIT_D_PATH@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MOUNT_FUSE_PATH = @MOUNT_FUSE_PATH@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
UDEV_RULES_PATH = @UDEV_RULES_PATH@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
libfuse_libs = @libfuse_libs@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
subdirs2 = @subdirs2@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
fuseincludedir = $(includedir)/fuse
|
||||
fuseinclude_HEADERS = \
|
||||
fuse.h \
|
||||
fuse_compat.h \
|
||||
fuse_common.h \
|
||||
fuse_common_compat.h \
|
||||
fuse_lowlevel.h \
|
||||
fuse_lowlevel_compat.h \
|
||||
fuse_opt.h \
|
||||
cuse_lowlevel.h
|
||||
|
||||
include_HEADERS = old/fuse.h ulockmgr.h
|
||||
noinst_HEADERS = fuse_kernel.h
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu include/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status include/config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-fuseincludeHEADERS: $(fuseinclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(fuseincludedir)" || $(MKDIR_P) "$(DESTDIR)$(fuseincludedir)"
|
||||
@list='$(fuseinclude_HEADERS)'; test -n "$(fuseincludedir)" || list=; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(fuseincludedir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(fuseincludedir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-fuseincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(fuseinclude_HEADERS)'; test -n "$(fuseincludedir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(fuseincludedir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(fuseincludedir)" && rm -f $$files
|
||||
install-includeHEADERS: $(include_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
|
||||
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-includeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(includedir)" && rm -f $$files
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(HEADERS) config.h
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(fuseincludedir)" "$(DESTDIR)$(includedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-fuseincludeHEADERS install-includeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-fuseincludeHEADERS uninstall-includeHEADERS
|
||||
|
||||
.MAKE: all install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool ctags distclean distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-fuseincludeHEADERS install-html \
|
||||
install-html-am install-includeHEADERS install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-fuseincludeHEADERS \
|
||||
uninstall-includeHEADERS
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -1,86 +0,0 @@
|
||||
/* include/config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the `fdatasync' function. */
|
||||
#undef HAVE_FDATASYNC
|
||||
|
||||
/* Define to 1 if you have the `fork' function. */
|
||||
#undef HAVE_FORK
|
||||
|
||||
/* Define if you have the iconv() function and it works. */
|
||||
#undef HAVE_ICONV
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `setxattr' function. */
|
||||
#undef HAVE_SETXATTR
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if `st_atim' is member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_ATIM
|
||||
|
||||
/* Define to 1 if `st_atimespec' is member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_ATIMESPEC
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
#undef ICONV_CONST
|
||||
|
||||
/* Don't update /etc/mtab */
|
||||
#undef IGNORE_MTAB
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
@@ -51,9 +51,9 @@ struct cuse_lowlevel_ops {
|
||||
void (*init_done) (void *userdata);
|
||||
void (*destroy) (void *userdata);
|
||||
void (*open) (fuse_req_t req, struct fuse_file_info *fi);
|
||||
void (*read) (fuse_req_t req, size_t size, off64_t off,
|
||||
void (*read) (fuse_req_t req, size_t size, loff_t off,
|
||||
struct fuse_file_info *fi);
|
||||
void (*write) (fuse_req_t req, const char *buf, size_t size, off64_t off,
|
||||
void (*write) (fuse_req_t req, const char *buf, size_t size, loff_t off,
|
||||
struct fuse_file_info *fi);
|
||||
void (*flush) (fuse_req_t req, struct fuse_file_info *fi);
|
||||
void (*release) (fuse_req_t req, struct fuse_file_info *fi);
|
||||
|
||||
@@ -30,9 +30,11 @@
|
||||
#include <utime.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#if defined(__ANDROID__)
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/uio.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -57,7 +59,7 @@ struct fuse_cmd;
|
||||
* @return 1 if buffer is full, zero otherwise
|
||||
*/
|
||||
typedef int (*fuse_fill_dir_t) (void *buf, const char *name,
|
||||
const struct stat *stbuf, off64_t off);
|
||||
const struct stat *stbuf, loff_t off);
|
||||
|
||||
/* Used by deprecated getdir() method */
|
||||
typedef struct fuse_dirhandle *fuse_dirh_t;
|
||||
@@ -146,7 +148,7 @@ struct fuse_operations {
|
||||
int (*chown) (const char *, uid_t, gid_t);
|
||||
|
||||
/** Change the size of a file */
|
||||
int (*truncate) (const char *, off64_t);
|
||||
int (*truncate) (const char *, loff_t);
|
||||
|
||||
/** Change the access and/or modification times of a file
|
||||
*
|
||||
@@ -184,7 +186,7 @@ struct fuse_operations {
|
||||
*
|
||||
* Changed in version 2.2
|
||||
*/
|
||||
int (*read) (const char *, char *, size_t, off64_t,
|
||||
int (*read) (const char *, char *, size_t, loff_t,
|
||||
struct fuse_file_info *);
|
||||
|
||||
/** Write data to an open file
|
||||
@@ -195,7 +197,7 @@ struct fuse_operations {
|
||||
*
|
||||
* Changed in version 2.2
|
||||
*/
|
||||
int (*write) (const char *, const char *, size_t, off64_t,
|
||||
int (*write) (const char *, const char *, size_t, loff_t,
|
||||
struct fuse_file_info *);
|
||||
|
||||
/** Get file system statistics
|
||||
@@ -302,7 +304,7 @@ struct fuse_operations {
|
||||
*
|
||||
* Introduced in version 2.3
|
||||
*/
|
||||
int (*readdir) (const char *, void *, fuse_fill_dir_t, off64_t,
|
||||
int (*readdir) (const char *, void *, fuse_fill_dir_t, loff_t,
|
||||
struct fuse_file_info *);
|
||||
|
||||
/** Release directory
|
||||
@@ -380,7 +382,7 @@ struct fuse_operations {
|
||||
*
|
||||
* Introduced in version 2.5
|
||||
*/
|
||||
int (*ftruncate) (const char *, off64_t, struct fuse_file_info *);
|
||||
int (*ftruncate) (const char *, loff_t, struct fuse_file_info *);
|
||||
|
||||
/**
|
||||
* Get attributes from an open file
|
||||
@@ -501,6 +503,9 @@ struct fuse_operations {
|
||||
* _IOC_READ in area and if both are set in/out area. In all
|
||||
* non-NULL cases, the area is of _IOC_SIZE(cmd) bytes.
|
||||
*
|
||||
* If flags has FUSE_IOCTL_DIR then the fuse_file_info refers to a
|
||||
* directory file handle.
|
||||
*
|
||||
* Introduced in version 2.8
|
||||
*/
|
||||
int (*ioctl) (const char *, int cmd, void *arg,
|
||||
@@ -534,7 +539,7 @@ struct fuse_operations {
|
||||
*
|
||||
* Introduced in version 2.9
|
||||
*/
|
||||
int (*write_buf) (const char *, struct fuse_bufvec *buf, off64_t off,
|
||||
int (*write_buf) (const char *, struct fuse_bufvec *buf, loff_t off,
|
||||
struct fuse_file_info *);
|
||||
|
||||
/** Store data from an open file in a buffer
|
||||
@@ -554,7 +559,7 @@ struct fuse_operations {
|
||||
* Introduced in version 2.9
|
||||
*/
|
||||
int (*read_buf) (const char *, struct fuse_bufvec **bufp,
|
||||
size_t size, off64_t off, struct fuse_file_info *);
|
||||
size_t size, loff_t off, struct fuse_file_info *);
|
||||
/**
|
||||
* Perform BSD file locking operation
|
||||
*
|
||||
@@ -587,7 +592,7 @@ struct fuse_operations {
|
||||
*
|
||||
* Introduced in version 2.9.1
|
||||
*/
|
||||
int (*fallocate) (const char *, int, off64_t, off64_t,
|
||||
int (*fallocate) (const char *, int, loff_t, loff_t,
|
||||
struct fuse_file_info *);
|
||||
};
|
||||
|
||||
@@ -827,14 +832,14 @@ int fuse_fs_release(struct fuse_fs *fs, const char *path,
|
||||
int fuse_fs_open(struct fuse_fs *fs, const char *path,
|
||||
struct fuse_file_info *fi);
|
||||
int fuse_fs_read(struct fuse_fs *fs, const char *path, char *buf, size_t size,
|
||||
off64_t off, struct fuse_file_info *fi);
|
||||
loff_t off, struct fuse_file_info *fi);
|
||||
int fuse_fs_read_buf(struct fuse_fs *fs, const char *path,
|
||||
struct fuse_bufvec **bufp, size_t size, off64_t off,
|
||||
struct fuse_bufvec **bufp, size_t size, loff_t off,
|
||||
struct fuse_file_info *fi);
|
||||
int fuse_fs_write(struct fuse_fs *fs, const char *path, const char *buf,
|
||||
size_t size, off64_t off, struct fuse_file_info *fi);
|
||||
size_t size, loff_t off, struct fuse_file_info *fi);
|
||||
int fuse_fs_write_buf(struct fuse_fs *fs, const char *path,
|
||||
struct fuse_bufvec *buf, off64_t off,
|
||||
struct fuse_bufvec *buf, loff_t off,
|
||||
struct fuse_file_info *fi);
|
||||
int fuse_fs_fsync(struct fuse_fs *fs, const char *path, int datasync,
|
||||
struct fuse_file_info *fi);
|
||||
@@ -844,7 +849,7 @@ int fuse_fs_statfs(struct fuse_fs *fs, const char *path, struct statvfs *buf);
|
||||
int fuse_fs_opendir(struct fuse_fs *fs, const char *path,
|
||||
struct fuse_file_info *fi);
|
||||
int fuse_fs_readdir(struct fuse_fs *fs, const char *path, void *buf,
|
||||
fuse_fill_dir_t filler, off64_t off,
|
||||
fuse_fill_dir_t filler, loff_t off,
|
||||
struct fuse_file_info *fi);
|
||||
int fuse_fs_fsyncdir(struct fuse_fs *fs, const char *path, int datasync,
|
||||
struct fuse_file_info *fi);
|
||||
@@ -858,8 +863,8 @@ int fuse_fs_flock(struct fuse_fs *fs, const char *path,
|
||||
struct fuse_file_info *fi, int op);
|
||||
int fuse_fs_chmod(struct fuse_fs *fs, const char *path, mode_t mode);
|
||||
int fuse_fs_chown(struct fuse_fs *fs, const char *path, uid_t uid, gid_t gid);
|
||||
int fuse_fs_truncate(struct fuse_fs *fs, const char *path, off64_t size);
|
||||
int fuse_fs_ftruncate(struct fuse_fs *fs, const char *path, off64_t size,
|
||||
int fuse_fs_truncate(struct fuse_fs *fs, const char *path, loff_t size);
|
||||
int fuse_fs_ftruncate(struct fuse_fs *fs, const char *path, loff_t size,
|
||||
struct fuse_file_info *fi);
|
||||
int fuse_fs_utimens(struct fuse_fs *fs, const char *path,
|
||||
const struct timespec tv[2]);
|
||||
@@ -885,7 +890,7 @@ int fuse_fs_poll(struct fuse_fs *fs, const char *path,
|
||||
struct fuse_file_info *fi, struct fuse_pollhandle *ph,
|
||||
unsigned *reventsp);
|
||||
int fuse_fs_fallocate(struct fuse_fs *fs, const char *path, int mode,
|
||||
off64_t offset, off64_t length, struct fuse_file_info *fi);
|
||||
loff_t offset, loff_t length, struct fuse_file_info *fi);
|
||||
void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn);
|
||||
void fuse_fs_destroy(struct fuse_fs *fs);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#define FUSE_MAKE_VERSION(maj, min) ((maj) * 10 + (min))
|
||||
#define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION)
|
||||
|
||||
/* This interface uses 64 bit off64_t */
|
||||
/* This interface uses 64 bit off_t */
|
||||
#if _FILE_OFFSET_BITS != 64
|
||||
#error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
|
||||
#endif
|
||||
@@ -372,7 +372,7 @@ struct fuse_buf {
|
||||
*
|
||||
* Used if FUSE_BUF_FD_SEEK flag is set.
|
||||
*/
|
||||
off64_t pos;
|
||||
loff_t pos;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
/* these definitions provide source compatibility to prior versions.
|
||||
Do not include this file directly! */
|
||||
|
||||
#include "fuse_lowlevel.h"
|
||||
|
||||
struct fuse_operations_compat25 {
|
||||
int (*getattr) (const char *, struct stat *);
|
||||
int (*readlink) (const char *, char *, size_t);
|
||||
@@ -22,12 +24,12 @@ struct fuse_operations_compat25 {
|
||||
int (*link) (const char *, const char *);
|
||||
int (*chmod) (const char *, mode_t);
|
||||
int (*chown) (const char *, uid_t, gid_t);
|
||||
int (*truncate) (const char *, off64_t);
|
||||
int (*truncate) (const char *, loff_t);
|
||||
int (*utime) (const char *, struct utimbuf *);
|
||||
int (*open) (const char *, struct fuse_file_info *);
|
||||
int (*read) (const char *, char *, size_t, off64_t,
|
||||
int (*read) (const char *, char *, size_t, loff_t,
|
||||
struct fuse_file_info *);
|
||||
int (*write) (const char *, const char *, size_t, off64_t,
|
||||
int (*write) (const char *, const char *, size_t, loff_t,
|
||||
struct fuse_file_info *);
|
||||
int (*statfs) (const char *, struct statvfs *);
|
||||
int (*flush) (const char *, struct fuse_file_info *);
|
||||
@@ -38,7 +40,7 @@ struct fuse_operations_compat25 {
|
||||
int (*listxattr) (const char *, char *, size_t);
|
||||
int (*removexattr) (const char *, const char *);
|
||||
int (*opendir) (const char *, struct fuse_file_info *);
|
||||
int (*readdir) (const char *, void *, fuse_fill_dir_t, off64_t,
|
||||
int (*readdir) (const char *, void *, fuse_fill_dir_t, loff_t,
|
||||
struct fuse_file_info *);
|
||||
int (*releasedir) (const char *, struct fuse_file_info *);
|
||||
int (*fsyncdir) (const char *, int, struct fuse_file_info *);
|
||||
@@ -46,7 +48,7 @@ struct fuse_operations_compat25 {
|
||||
void (*destroy) (void *);
|
||||
int (*access) (const char *, int);
|
||||
int (*create) (const char *, mode_t, struct fuse_file_info *);
|
||||
int (*ftruncate) (const char *, off64_t, struct fuse_file_info *);
|
||||
int (*ftruncate) (const char *, loff_t, struct fuse_file_info *);
|
||||
int (*fgetattr) (const char *, struct stat *, struct fuse_file_info *);
|
||||
};
|
||||
|
||||
@@ -81,12 +83,12 @@ struct fuse_operations_compat22 {
|
||||
int (*link) (const char *, const char *);
|
||||
int (*chmod) (const char *, mode_t);
|
||||
int (*chown) (const char *, uid_t, gid_t);
|
||||
int (*truncate) (const char *, off64_t);
|
||||
int (*truncate) (const char *, loff_t);
|
||||
int (*utime) (const char *, struct utimbuf *);
|
||||
int (*open) (const char *, struct fuse_file_info_compat *);
|
||||
int (*read) (const char *, char *, size_t, off64_t,
|
||||
int (*read) (const char *, char *, size_t, loff_t,
|
||||
struct fuse_file_info_compat *);
|
||||
int (*write) (const char *, const char *, size_t, off64_t,
|
||||
int (*write) (const char *, const char *, size_t, loff_t,
|
||||
struct fuse_file_info_compat *);
|
||||
int (*statfs) (const char *, struct statfs *);
|
||||
int (*flush) (const char *, struct fuse_file_info_compat *);
|
||||
@@ -97,7 +99,7 @@ struct fuse_operations_compat22 {
|
||||
int (*listxattr) (const char *, char *, size_t);
|
||||
int (*removexattr) (const char *, const char *);
|
||||
int (*opendir) (const char *, struct fuse_file_info_compat *);
|
||||
int (*readdir) (const char *, void *, fuse_fill_dir_t, off64_t,
|
||||
int (*readdir) (const char *, void *, fuse_fill_dir_t, loff_t,
|
||||
struct fuse_file_info_compat *);
|
||||
int (*releasedir) (const char *, struct fuse_file_info_compat *);
|
||||
int (*fsyncdir) (const char *, int, struct fuse_file_info_compat *);
|
||||
@@ -132,11 +134,11 @@ struct fuse_operations_compat2 {
|
||||
int (*link) (const char *, const char *);
|
||||
int (*chmod) (const char *, mode_t);
|
||||
int (*chown) (const char *, uid_t, gid_t);
|
||||
int (*truncate) (const char *, off64_t);
|
||||
int (*truncate) (const char *, loff_t);
|
||||
int (*utime) (const char *, struct utimbuf *);
|
||||
int (*open) (const char *, int);
|
||||
int (*read) (const char *, char *, size_t, off64_t);
|
||||
int (*write) (const char *, const char *, size_t, off64_t);
|
||||
int (*read) (const char *, char *, size_t, loff_t);
|
||||
int (*write) (const char *, const char *, size_t, loff_t);
|
||||
int (*statfs) (const char *, struct statfs *);
|
||||
int (*flush) (const char *);
|
||||
int (*release) (const char *, int);
|
||||
@@ -180,11 +182,11 @@ struct fuse_operations_compat1 {
|
||||
int (*link) (const char *, const char *);
|
||||
int (*chmod) (const char *, mode_t);
|
||||
int (*chown) (const char *, uid_t, gid_t);
|
||||
int (*truncate) (const char *, off64_t);
|
||||
int (*truncate) (const char *, loff_t);
|
||||
int (*utime) (const char *, struct utimbuf *);
|
||||
int (*open) (const char *, int);
|
||||
int (*read) (const char *, char *, size_t, off64_t);
|
||||
int (*write) (const char *, const char *, size_t, off64_t);
|
||||
int (*read) (const char *, char *, size_t, loff_t);
|
||||
int (*write) (const char *, const char *, size_t, loff_t);
|
||||
int (*statfs) (struct fuse_statfs_compat1 *);
|
||||
int (*release) (const char *, int);
|
||||
int (*fsync) (const char *, int);
|
||||
|
||||
@@ -462,7 +462,7 @@ struct fuse_lowlevel_ops {
|
||||
* @param off offset to read from
|
||||
* @param fi file information
|
||||
*/
|
||||
void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, off64_t off,
|
||||
void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, loff_t off,
|
||||
struct fuse_file_info *fi);
|
||||
|
||||
/**
|
||||
@@ -489,7 +489,7 @@ struct fuse_lowlevel_ops {
|
||||
* @param fi file information
|
||||
*/
|
||||
void (*write) (fuse_req_t req, fuse_ino_t ino, const char *buf,
|
||||
size_t size, off64_t off, struct fuse_file_info *fi);
|
||||
size_t size, loff_t off, struct fuse_file_info *fi);
|
||||
|
||||
/**
|
||||
* Flush method
|
||||
@@ -612,7 +612,7 @@ struct fuse_lowlevel_ops {
|
||||
* @param off offset to continue reading the directory stream
|
||||
* @param fi file information
|
||||
*/
|
||||
void (*readdir) (fuse_req_t req, fuse_ino_t ino, size_t size, off64_t off,
|
||||
void (*readdir) (fuse_req_t req, fuse_ino_t ino, size_t size, loff_t off,
|
||||
struct fuse_file_info *fi);
|
||||
|
||||
/**
|
||||
@@ -941,7 +941,7 @@ struct fuse_lowlevel_ops {
|
||||
* @param fi file information
|
||||
*/
|
||||
void (*write_buf) (fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_bufvec *bufv, off64_t off,
|
||||
struct fuse_bufvec *bufv, loff_t off,
|
||||
struct fuse_file_info *fi);
|
||||
|
||||
/**
|
||||
@@ -959,7 +959,7 @@ struct fuse_lowlevel_ops {
|
||||
* @param bufv the buffer containing the returned data
|
||||
*/
|
||||
void (*retrieve_reply) (fuse_req_t req, void *cookie, fuse_ino_t ino,
|
||||
off64_t offset, struct fuse_bufvec *bufv);
|
||||
loff_t offset, struct fuse_bufvec *bufv);
|
||||
|
||||
/**
|
||||
* Forget about multiple inodes
|
||||
@@ -1015,7 +1015,7 @@ struct fuse_lowlevel_ops {
|
||||
* see fallocate(2)
|
||||
*/
|
||||
void (*fallocate) (fuse_req_t req, fuse_ino_t ino, int mode,
|
||||
off64_t offset, off64_t length, struct fuse_file_info *fi);
|
||||
loff_t offset, loff_t length, struct fuse_file_info *fi);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1249,7 +1249,7 @@ int fuse_reply_bmap(fuse_req_t req, uint64_t idx);
|
||||
*/
|
||||
size_t fuse_add_direntry(fuse_req_t req, char *buf, size_t bufsize,
|
||||
const char *name, const struct stat *stbuf,
|
||||
off64_t off);
|
||||
loff_t off);
|
||||
|
||||
/**
|
||||
* Reply to ask for data fetch and output buffer preparation. ioctl
|
||||
@@ -1329,12 +1329,16 @@ int fuse_lowlevel_notify_poll(struct fuse_pollhandle *ph);
|
||||
* @return zero for success, -errno for failure
|
||||
*/
|
||||
int fuse_lowlevel_notify_inval_inode(struct fuse_chan *ch, fuse_ino_t ino,
|
||||
off64_t off, off64_t len);
|
||||
loff_t off, loff_t len);
|
||||
|
||||
/**
|
||||
* Notify to invalidate parent attributes and the dentry matching
|
||||
* parent/name
|
||||
*
|
||||
* To avoid a deadlock don't call this function from a filesystem operation and
|
||||
* don't call it with a lock held that can also be held by a filesystem
|
||||
* operation.
|
||||
*
|
||||
* @param ch the channel through which to send the invalidation
|
||||
* @param parent inode number
|
||||
* @param name file name
|
||||
@@ -1349,6 +1353,10 @@ int fuse_lowlevel_notify_inval_entry(struct fuse_chan *ch, fuse_ino_t parent,
|
||||
* parent/name if the dentry's inode number matches child (otherwise it
|
||||
* will invalidate the matching dentry).
|
||||
*
|
||||
* To avoid a deadlock don't call this function from a filesystem operation and
|
||||
* don't call it with a lock held that can also be held by a filesystem
|
||||
* operation.
|
||||
*
|
||||
* @param ch the channel through which to send the notification
|
||||
* @param parent inode number
|
||||
* @param child inode number
|
||||
@@ -1382,7 +1390,7 @@ int fuse_lowlevel_notify_delete(struct fuse_chan *ch,
|
||||
* @return zero for success, -errno for failure
|
||||
*/
|
||||
int fuse_lowlevel_notify_store(struct fuse_chan *ch, fuse_ino_t ino,
|
||||
off64_t offset, struct fuse_bufvec *bufv,
|
||||
loff_t offset, struct fuse_bufvec *bufv,
|
||||
enum fuse_buf_copy_flags flags);
|
||||
/**
|
||||
* Retrieve data from the kernel buffers
|
||||
@@ -1410,7 +1418,7 @@ int fuse_lowlevel_notify_store(struct fuse_chan *ch, fuse_ino_t ino,
|
||||
* @return zero for success, -errno for failure
|
||||
*/
|
||||
int fuse_lowlevel_notify_retrieve(struct fuse_chan *ch, fuse_ino_t ino,
|
||||
size_t size, off64_t offset, void *cookie);
|
||||
size_t size, loff_t offset, void *cookie);
|
||||
|
||||
|
||||
/* ----------------------------------------------------------- *
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
/* these definitions provide source compatibility to prior versions.
|
||||
Do not include this file directly! */
|
||||
|
||||
#include "fuse_common.h"
|
||||
|
||||
struct fuse_lowlevel_ops_compat25 {
|
||||
void (*init) (void *userdata);
|
||||
void (*destroy) (void *userdata);
|
||||
@@ -33,10 +35,10 @@ struct fuse_lowlevel_ops_compat25 {
|
||||
const char *newname);
|
||||
void (*open) (fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info *fi);
|
||||
void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, off64_t off,
|
||||
void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, loff_t off,
|
||||
struct fuse_file_info *fi);
|
||||
void (*write) (fuse_req_t req, fuse_ino_t ino, const char *buf,
|
||||
size_t size, off64_t off, struct fuse_file_info *fi);
|
||||
size_t size, loff_t off, struct fuse_file_info *fi);
|
||||
void (*flush) (fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info *fi);
|
||||
void (*release) (fuse_req_t req, fuse_ino_t ino,
|
||||
@@ -45,7 +47,7 @@ struct fuse_lowlevel_ops_compat25 {
|
||||
struct fuse_file_info *fi);
|
||||
void (*opendir) (fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info *fi);
|
||||
void (*readdir) (fuse_req_t req, fuse_ino_t ino, size_t size, off64_t off,
|
||||
void (*readdir) (fuse_req_t req, fuse_ino_t ino, size_t size, loff_t off,
|
||||
struct fuse_file_info *fi);
|
||||
void (*releasedir) (fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info *fi);
|
||||
@@ -70,7 +72,7 @@ struct fuse_session *fuse_lowlevel_new_compat25(struct fuse_args *args,
|
||||
size_t fuse_dirent_size(size_t namelen);
|
||||
|
||||
char *fuse_add_dirent(char *buf, const char *name, const struct stat *stbuf,
|
||||
off64_t off);
|
||||
loff_t off);
|
||||
|
||||
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
|
||||
|
||||
@@ -100,10 +102,10 @@ struct fuse_lowlevel_ops_compat {
|
||||
const char *newname);
|
||||
void (*open) (fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info_compat *fi);
|
||||
void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, off64_t off,
|
||||
void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, loff_t off,
|
||||
struct fuse_file_info_compat *fi);
|
||||
void (*write) (fuse_req_t req, fuse_ino_t ino, const char *buf,
|
||||
size_t size, off64_t off, struct fuse_file_info_compat *fi);
|
||||
size_t size, loff_t off, struct fuse_file_info_compat *fi);
|
||||
void (*flush) (fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info_compat *fi);
|
||||
void (*release) (fuse_req_t req, fuse_ino_t ino,
|
||||
@@ -112,7 +114,7 @@ struct fuse_lowlevel_ops_compat {
|
||||
struct fuse_file_info_compat *fi);
|
||||
void (*opendir) (fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info_compat *fi);
|
||||
void (*readdir) (fuse_req_t req, fuse_ino_t ino, size_t size, off64_t off,
|
||||
void (*readdir) (fuse_req_t req, fuse_ino_t ino, size_t size, loff_t off,
|
||||
struct fuse_file_info_compat *fi);
|
||||
void (*releasedir) (fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info_compat *fi);
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
timestamp for include/config.h
|
||||
@@ -1,18 +0,0 @@
|
||||
#ifndef __STATVFS_H
|
||||
#define __STATVFS_H
|
||||
|
||||
struct statvfs {
|
||||
unsigned long f_bsize; /* file system block size */
|
||||
unsigned long f_frsize; /* fragment size */
|
||||
fsblkcnt_t f_blocks; /* size of fs in f_frsize units */
|
||||
fsblkcnt_t f_bfree; /* # free blocks */
|
||||
fsblkcnt_t f_bavail; /* # free blocks for non-root */
|
||||
fsfilcnt_t f_files; /* # inodes */
|
||||
fsfilcnt_t f_ffree; /* # free inodes */
|
||||
fsfilcnt_t f_favail; /* # free inodes for non-root */
|
||||
unsigned long f_fsid; /* file system ID */
|
||||
unsigned long f_flag; /* mount flags */
|
||||
unsigned long f_namemax; /* maximum filename length */
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -6,6 +6,8 @@
|
||||
See the file COPYING.LIB.
|
||||
*/
|
||||
|
||||
#include "fuse_lowlevel.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
739
fuse/modules/iconv.c
Normal file
739
fuse/modules/iconv.c
Normal file
@@ -0,0 +1,739 @@
|
||||
/*
|
||||
fuse iconv module: file name charset conversion
|
||||
Copyright (C) 2007 Miklos Szeredi <miklos@szeredi.hu>
|
||||
|
||||
This program can be distributed under the terms of the GNU LGPLv2.
|
||||
See the file COPYING.LIB
|
||||
*/
|
||||
|
||||
#define FUSE_USE_VERSION 26
|
||||
|
||||
#include <fuse.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <iconv.h>
|
||||
#include <pthread.h>
|
||||
#include <locale.h>
|
||||
#include <langinfo.h>
|
||||
|
||||
struct iconv {
|
||||
struct fuse_fs *next;
|
||||
pthread_mutex_t lock;
|
||||
char *from_code;
|
||||
char *to_code;
|
||||
iconv_t tofs;
|
||||
iconv_t fromfs;
|
||||
};
|
||||
|
||||
struct iconv_dh {
|
||||
struct iconv *ic;
|
||||
void *prev_buf;
|
||||
fuse_fill_dir_t prev_filler;
|
||||
};
|
||||
|
||||
static struct iconv *iconv_get(void)
|
||||
{
|
||||
return fuse_get_context()->private_data;
|
||||
}
|
||||
|
||||
static int iconv_convpath(struct iconv *ic, const char *path, char **newpathp,
|
||||
int fromfs)
|
||||
{
|
||||
size_t pathlen;
|
||||
size_t newpathlen;
|
||||
char *newpath;
|
||||
size_t plen;
|
||||
char *p;
|
||||
size_t res;
|
||||
int err;
|
||||
|
||||
if (path == NULL) {
|
||||
*newpathp = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
pathlen = strlen(path);
|
||||
newpathlen = pathlen * 4;
|
||||
newpath = malloc(newpathlen + 1);
|
||||
if (!newpath)
|
||||
return -ENOMEM;
|
||||
|
||||
plen = newpathlen;
|
||||
p = newpath;
|
||||
pthread_mutex_lock(&ic->lock);
|
||||
do {
|
||||
res = iconv(fromfs ? ic->fromfs : ic->tofs, (char **) &path,
|
||||
&pathlen, &p, &plen);
|
||||
if (res == (size_t) -1) {
|
||||
char *tmp;
|
||||
size_t inc;
|
||||
|
||||
err = -EILSEQ;
|
||||
if (errno != E2BIG)
|
||||
goto err;
|
||||
|
||||
inc = (pathlen + 1) * 4;
|
||||
newpathlen += inc;
|
||||
tmp = realloc(newpath, newpathlen + 1);
|
||||
err = -ENOMEM;
|
||||
if (!tmp)
|
||||
goto err;
|
||||
|
||||
p = tmp + (p - newpath);
|
||||
plen += inc;
|
||||
newpath = tmp;
|
||||
}
|
||||
} while (res == (size_t) -1);
|
||||
pthread_mutex_unlock(&ic->lock);
|
||||
*p = '\0';
|
||||
*newpathp = newpath;
|
||||
return 0;
|
||||
|
||||
err:
|
||||
iconv(fromfs ? ic->fromfs : ic->tofs, NULL, NULL, NULL, NULL);
|
||||
pthread_mutex_unlock(&ic->lock);
|
||||
free(newpath);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_getattr(const char *path, struct stat *stbuf)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_getattr(ic->next, newpath, stbuf);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_fgetattr(const char *path, struct stat *stbuf,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_fgetattr(ic->next, newpath, stbuf, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_access(const char *path, int mask)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_access(ic->next, newpath, mask);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_readlink(const char *path, char *buf, size_t size)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_readlink(ic->next, newpath, buf, size);
|
||||
if (!err) {
|
||||
char *newlink;
|
||||
err = iconv_convpath(ic, buf, &newlink, 1);
|
||||
if (!err) {
|
||||
strncpy(buf, newlink, size - 1);
|
||||
buf[size - 1] = '\0';
|
||||
free(newlink);
|
||||
}
|
||||
}
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_opendir(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_opendir(ic->next, newpath, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_dir_fill(void *buf, const char *name,
|
||||
const struct stat *stbuf, loff_t off)
|
||||
{
|
||||
struct iconv_dh *dh = buf;
|
||||
char *newname;
|
||||
int res = 0;
|
||||
if (iconv_convpath(dh->ic, name, &newname, 1) == 0) {
|
||||
res = dh->prev_filler(dh->prev_buf, newname, stbuf, off);
|
||||
free(newname);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static int iconv_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
|
||||
loff_t offset, struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
struct iconv_dh dh;
|
||||
dh.ic = ic;
|
||||
dh.prev_buf = buf;
|
||||
dh.prev_filler = filler;
|
||||
err = fuse_fs_readdir(ic->next, newpath, &dh, iconv_dir_fill,
|
||||
offset, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_releasedir(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_releasedir(ic->next, newpath, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_mknod(const char *path, mode_t mode, dev_t rdev)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_mknod(ic->next, newpath, mode, rdev);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_mkdir(const char *path, mode_t mode)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_mkdir(ic->next, newpath, mode);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_unlink(const char *path)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_unlink(ic->next, newpath);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_rmdir(const char *path)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_rmdir(ic->next, newpath);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_symlink(const char *from, const char *to)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newfrom;
|
||||
char *newto;
|
||||
int err = iconv_convpath(ic, from, &newfrom, 0);
|
||||
if (!err) {
|
||||
err = iconv_convpath(ic, to, &newto, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_symlink(ic->next, newfrom, newto);
|
||||
free(newto);
|
||||
}
|
||||
free(newfrom);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_rename(const char *from, const char *to)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newfrom;
|
||||
char *newto;
|
||||
int err = iconv_convpath(ic, from, &newfrom, 0);
|
||||
if (!err) {
|
||||
err = iconv_convpath(ic, to, &newto, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_rename(ic->next, newfrom, newto);
|
||||
free(newto);
|
||||
}
|
||||
free(newfrom);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_link(const char *from, const char *to)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newfrom;
|
||||
char *newto;
|
||||
int err = iconv_convpath(ic, from, &newfrom, 0);
|
||||
if (!err) {
|
||||
err = iconv_convpath(ic, to, &newto, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_link(ic->next, newfrom, newto);
|
||||
free(newto);
|
||||
}
|
||||
free(newfrom);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_chmod(const char *path, mode_t mode)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_chmod(ic->next, newpath, mode);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_chown(const char *path, uid_t uid, gid_t gid)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_chown(ic->next, newpath, uid, gid);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_truncate(const char *path, loff_t size)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_truncate(ic->next, newpath, size);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_ftruncate(const char *path, loff_t size,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_ftruncate(ic->next, newpath, size, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_utimens(const char *path, const struct timespec ts[2])
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_utimens(ic->next, newpath, ts);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_create(const char *path, mode_t mode,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_create(ic->next, newpath, mode, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_open_file(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_open(ic->next, newpath, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_read_buf(const char *path, struct fuse_bufvec **bufp,
|
||||
size_t size, loff_t offset, struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_read_buf(ic->next, newpath, bufp, size, offset, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_write_buf(const char *path, struct fuse_bufvec *buf,
|
||||
loff_t offset, struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_write_buf(ic->next, newpath, buf, offset, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_statfs(const char *path, struct statvfs *stbuf)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_statfs(ic->next, newpath, stbuf);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_flush(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_flush(ic->next, newpath, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_release(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_release(ic->next, newpath, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_fsync(const char *path, int isdatasync,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_fsync(ic->next, newpath, isdatasync, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_fsyncdir(const char *path, int isdatasync,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_fsyncdir(ic->next, newpath, isdatasync, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_setxattr(const char *path, const char *name,
|
||||
const char *value, size_t size, int flags)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_setxattr(ic->next, newpath, name, value, size,
|
||||
flags);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_getxattr(const char *path, const char *name, char *value,
|
||||
size_t size)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_getxattr(ic->next, newpath, name, value, size);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_listxattr(const char *path, char *list, size_t size)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_listxattr(ic->next, newpath, list, size);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_removexattr(const char *path, const char *name)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_removexattr(ic->next, newpath, name);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_lock(const char *path, struct fuse_file_info *fi, int cmd,
|
||||
struct flock *lock)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_lock(ic->next, newpath, fi, cmd, lock);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_flock(const char *path, struct fuse_file_info *fi, int op)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_flock(ic->next, newpath, fi, op);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int iconv_bmap(const char *path, size_t blocksize, uint64_t *idx)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
char *newpath;
|
||||
int err = iconv_convpath(ic, path, &newpath, 0);
|
||||
if (!err) {
|
||||
err = fuse_fs_bmap(ic->next, newpath, blocksize, idx);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static void *iconv_init(struct fuse_conn_info *conn)
|
||||
{
|
||||
struct iconv *ic = iconv_get();
|
||||
fuse_fs_init(ic->next, conn);
|
||||
return ic;
|
||||
}
|
||||
|
||||
static void iconv_destroy(void *data)
|
||||
{
|
||||
struct iconv *ic = data;
|
||||
fuse_fs_destroy(ic->next);
|
||||
iconv_close(ic->tofs);
|
||||
iconv_close(ic->fromfs);
|
||||
pthread_mutex_destroy(&ic->lock);
|
||||
free(ic->from_code);
|
||||
free(ic->to_code);
|
||||
free(ic);
|
||||
}
|
||||
|
||||
static const struct fuse_operations iconv_oper = {
|
||||
.destroy = iconv_destroy,
|
||||
.init = iconv_init,
|
||||
.getattr = iconv_getattr,
|
||||
.fgetattr = iconv_fgetattr,
|
||||
.access = iconv_access,
|
||||
.readlink = iconv_readlink,
|
||||
.opendir = iconv_opendir,
|
||||
.readdir = iconv_readdir,
|
||||
.releasedir = iconv_releasedir,
|
||||
.mknod = iconv_mknod,
|
||||
.mkdir = iconv_mkdir,
|
||||
.symlink = iconv_symlink,
|
||||
.unlink = iconv_unlink,
|
||||
.rmdir = iconv_rmdir,
|
||||
.rename = iconv_rename,
|
||||
.link = iconv_link,
|
||||
.chmod = iconv_chmod,
|
||||
.chown = iconv_chown,
|
||||
.truncate = iconv_truncate,
|
||||
.ftruncate = iconv_ftruncate,
|
||||
.utimens = iconv_utimens,
|
||||
.create = iconv_create,
|
||||
.open = iconv_open_file,
|
||||
.read_buf = iconv_read_buf,
|
||||
.write_buf = iconv_write_buf,
|
||||
.statfs = iconv_statfs,
|
||||
.flush = iconv_flush,
|
||||
.release = iconv_release,
|
||||
.fsync = iconv_fsync,
|
||||
.fsyncdir = iconv_fsyncdir,
|
||||
.setxattr = iconv_setxattr,
|
||||
.getxattr = iconv_getxattr,
|
||||
.listxattr = iconv_listxattr,
|
||||
.removexattr = iconv_removexattr,
|
||||
.lock = iconv_lock,
|
||||
.flock = iconv_flock,
|
||||
.bmap = iconv_bmap,
|
||||
|
||||
.flag_nullpath_ok = 1,
|
||||
.flag_nopath = 1,
|
||||
};
|
||||
|
||||
static const struct fuse_opt iconv_opts[] = {
|
||||
FUSE_OPT_KEY("-h", 0),
|
||||
FUSE_OPT_KEY("--help", 0),
|
||||
{ "from_code=%s", offsetof(struct iconv, from_code), 0 },
|
||||
{ "to_code=%s", offsetof(struct iconv, to_code), 1 },
|
||||
FUSE_OPT_END
|
||||
};
|
||||
|
||||
static void iconv_help(void)
|
||||
{
|
||||
char *old = strdup(setlocale(LC_CTYPE, ""));
|
||||
char *charmap = strdup(nl_langinfo(CODESET));
|
||||
setlocale(LC_CTYPE, old);
|
||||
free(old);
|
||||
fprintf(stderr,
|
||||
" -o from_code=CHARSET original encoding of file names (default: UTF-8)\n"
|
||||
" -o to_code=CHARSET new encoding of the file names (default: %s)\n",
|
||||
charmap);
|
||||
free(charmap);
|
||||
}
|
||||
|
||||
static int iconv_opt_proc(void *data, const char *arg, int key,
|
||||
struct fuse_args *outargs)
|
||||
{
|
||||
(void) data; (void) arg; (void) outargs;
|
||||
|
||||
if (!key) {
|
||||
iconv_help();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct fuse_fs *iconv_new(struct fuse_args *args,
|
||||
struct fuse_fs *next[])
|
||||
{
|
||||
struct fuse_fs *fs;
|
||||
struct iconv *ic;
|
||||
char *old = NULL;
|
||||
const char *from;
|
||||
const char *to;
|
||||
|
||||
ic = calloc(1, sizeof(struct iconv));
|
||||
if (ic == NULL) {
|
||||
fprintf(stderr, "fuse-iconv: memory allocation failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fuse_opt_parse(args, ic, iconv_opts, iconv_opt_proc) == -1)
|
||||
goto out_free;
|
||||
|
||||
if (!next[0] || next[1]) {
|
||||
fprintf(stderr, "fuse-iconv: exactly one next filesystem required\n");
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
from = ic->from_code ? ic->from_code : "UTF-8";
|
||||
to = ic->to_code ? ic->to_code : "";
|
||||
/* FIXME: detect charset equivalence? */
|
||||
if (!to[0])
|
||||
old = strdup(setlocale(LC_CTYPE, ""));
|
||||
ic->tofs = iconv_open(from, to);
|
||||
if (ic->tofs == (iconv_t) -1) {
|
||||
fprintf(stderr, "fuse-iconv: cannot convert from %s to %s\n",
|
||||
to, from);
|
||||
goto out_free;
|
||||
}
|
||||
ic->fromfs = iconv_open(to, from);
|
||||
if (ic->tofs == (iconv_t) -1) {
|
||||
fprintf(stderr, "fuse-iconv: cannot convert from %s to %s\n",
|
||||
from, to);
|
||||
goto out_iconv_close_to;
|
||||
}
|
||||
if (old) {
|
||||
setlocale(LC_CTYPE, old);
|
||||
free(old);
|
||||
}
|
||||
|
||||
ic->next = next[0];
|
||||
fs = fuse_fs_new(&iconv_oper, sizeof(iconv_oper), ic);
|
||||
if (!fs)
|
||||
goto out_iconv_close_from;
|
||||
|
||||
return fs;
|
||||
|
||||
out_iconv_close_from:
|
||||
iconv_close(ic->fromfs);
|
||||
out_iconv_close_to:
|
||||
iconv_close(ic->tofs);
|
||||
out_free:
|
||||
free(ic->from_code);
|
||||
free(ic->to_code);
|
||||
free(ic);
|
||||
if (old) {
|
||||
setlocale(LC_CTYPE, old);
|
||||
free(old);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FUSE_REGISTER_MODULE(iconv, iconv_new);
|
||||
697
fuse/modules/subdir.c
Normal file
697
fuse/modules/subdir.c
Normal file
@@ -0,0 +1,697 @@
|
||||
/*
|
||||
fuse subdir module: offset paths with a base directory
|
||||
Copyright (C) 2007 Miklos Szeredi <miklos@szeredi.hu>
|
||||
|
||||
This program can be distributed under the terms of the GNU LGPLv2.
|
||||
See the file COPYING.LIB
|
||||
*/
|
||||
|
||||
#define FUSE_USE_VERSION 26
|
||||
|
||||
#include <fuse.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
struct subdir {
|
||||
char *base;
|
||||
size_t baselen;
|
||||
int rellinks;
|
||||
struct fuse_fs *next;
|
||||
};
|
||||
|
||||
static struct subdir *subdir_get(void)
|
||||
{
|
||||
return fuse_get_context()->private_data;
|
||||
}
|
||||
|
||||
static int subdir_addpath(struct subdir *d, const char *path, char **newpathp)
|
||||
{
|
||||
char *newpath = NULL;
|
||||
|
||||
if (path != NULL) {
|
||||
unsigned newlen = d->baselen + strlen(path);
|
||||
|
||||
newpath = malloc(newlen + 2);
|
||||
if (!newpath)
|
||||
return -ENOMEM;
|
||||
|
||||
if (path[0] == '/')
|
||||
path++;
|
||||
strcpy(newpath, d->base);
|
||||
strcpy(newpath + d->baselen, path);
|
||||
if (!newpath[0])
|
||||
strcpy(newpath, ".");
|
||||
}
|
||||
*newpathp = newpath;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int subdir_getattr(const char *path, struct stat *stbuf)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_getattr(d->next, newpath, stbuf);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_fgetattr(const char *path, struct stat *stbuf,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_fgetattr(d->next, newpath, stbuf, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_access(const char *path, int mask)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_access(d->next, newpath, mask);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
static int count_components(const char *p)
|
||||
{
|
||||
int ctr;
|
||||
|
||||
for (; *p == '/'; p++);
|
||||
for (ctr = 0; *p; ctr++) {
|
||||
for (; *p && *p != '/'; p++);
|
||||
for (; *p == '/'; p++);
|
||||
}
|
||||
return ctr;
|
||||
}
|
||||
|
||||
static void strip_common(const char **sp, const char **tp)
|
||||
{
|
||||
const char *s = *sp;
|
||||
const char *t = *tp;
|
||||
do {
|
||||
for (; *s == '/'; s++);
|
||||
for (; *t == '/'; t++);
|
||||
*tp = t;
|
||||
*sp = s;
|
||||
for (; *s == *t && *s && *s != '/'; s++, t++);
|
||||
} while ((*s == *t && *s) || (!*s && *t == '/') || (*s == '/' && !*t));
|
||||
}
|
||||
|
||||
static void transform_symlink(struct subdir *d, const char *path,
|
||||
char *buf, size_t size)
|
||||
{
|
||||
const char *l = buf;
|
||||
size_t llen;
|
||||
char *s;
|
||||
int dotdots;
|
||||
int i;
|
||||
|
||||
if (l[0] != '/' || d->base[0] != '/')
|
||||
return;
|
||||
|
||||
strip_common(&l, &path);
|
||||
if (l - buf < (long) d->baselen)
|
||||
return;
|
||||
|
||||
dotdots = count_components(path);
|
||||
if (!dotdots)
|
||||
return;
|
||||
dotdots--;
|
||||
|
||||
llen = strlen(l);
|
||||
if (dotdots * 3 + llen + 2 > size)
|
||||
return;
|
||||
|
||||
s = buf + dotdots * 3;
|
||||
if (llen)
|
||||
memmove(s, l, llen + 1);
|
||||
else if (!dotdots)
|
||||
strcpy(s, ".");
|
||||
else
|
||||
*s = '\0';
|
||||
|
||||
for (s = buf, i = 0; i < dotdots; i++, s += 3)
|
||||
memcpy(s, "../", 3);
|
||||
}
|
||||
|
||||
|
||||
static int subdir_readlink(const char *path, char *buf, size_t size)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_readlink(d->next, newpath, buf, size);
|
||||
if (!err && d->rellinks)
|
||||
transform_symlink(d, newpath, buf, size);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_opendir(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_opendir(d->next, newpath, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_readdir(const char *path, void *buf,
|
||||
fuse_fill_dir_t filler, loff_t offset,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_readdir(d->next, newpath, buf, filler, offset,
|
||||
fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_releasedir(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_releasedir(d->next, newpath, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_mknod(const char *path, mode_t mode, dev_t rdev)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_mknod(d->next, newpath, mode, rdev);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_mkdir(const char *path, mode_t mode)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_mkdir(d->next, newpath, mode);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_unlink(const char *path)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_unlink(d->next, newpath);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_rmdir(const char *path)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_rmdir(d->next, newpath);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_symlink(const char *from, const char *path)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_symlink(d->next, from, newpath);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_rename(const char *from, const char *to)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newfrom;
|
||||
char *newto;
|
||||
int err = subdir_addpath(d, from, &newfrom);
|
||||
if (!err) {
|
||||
err = subdir_addpath(d, to, &newto);
|
||||
if (!err) {
|
||||
err = fuse_fs_rename(d->next, newfrom, newto);
|
||||
free(newto);
|
||||
}
|
||||
free(newfrom);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_link(const char *from, const char *to)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newfrom;
|
||||
char *newto;
|
||||
int err = subdir_addpath(d, from, &newfrom);
|
||||
if (!err) {
|
||||
err = subdir_addpath(d, to, &newto);
|
||||
if (!err) {
|
||||
err = fuse_fs_link(d->next, newfrom, newto);
|
||||
free(newto);
|
||||
}
|
||||
free(newfrom);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_chmod(const char *path, mode_t mode)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_chmod(d->next, newpath, mode);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_chown(const char *path, uid_t uid, gid_t gid)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_chown(d->next, newpath, uid, gid);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_truncate(const char *path, loff_t size)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_truncate(d->next, newpath, size);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_ftruncate(const char *path, loff_t size,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_ftruncate(d->next, newpath, size, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_utimens(const char *path, const struct timespec ts[2])
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_utimens(d->next, newpath, ts);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_create(const char *path, mode_t mode,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_create(d->next, newpath, mode, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_open(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_open(d->next, newpath, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_read_buf(const char *path, struct fuse_bufvec **bufp,
|
||||
size_t size, loff_t offset, struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_read_buf(d->next, newpath, bufp, size, offset, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_write_buf(const char *path, struct fuse_bufvec *buf,
|
||||
loff_t offset, struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_write_buf(d->next, newpath, buf, offset, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_statfs(const char *path, struct statvfs *stbuf)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_statfs(d->next, newpath, stbuf);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_flush(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_flush(d->next, newpath, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_release(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_release(d->next, newpath, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_fsync(const char *path, int isdatasync,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_fsync(d->next, newpath, isdatasync, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_fsyncdir(const char *path, int isdatasync,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_fsyncdir(d->next, newpath, isdatasync, fi);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_setxattr(const char *path, const char *name,
|
||||
const char *value, size_t size, int flags)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_setxattr(d->next, newpath, name, value, size,
|
||||
flags);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_getxattr(const char *path, const char *name, char *value,
|
||||
size_t size)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_getxattr(d->next, newpath, name, value, size);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_listxattr(const char *path, char *list, size_t size)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_listxattr(d->next, newpath, list, size);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_removexattr(const char *path, const char *name)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_removexattr(d->next, newpath, name);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_lock(const char *path, struct fuse_file_info *fi, int cmd,
|
||||
struct flock *lock)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_lock(d->next, newpath, fi, cmd, lock);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_flock(const char *path, struct fuse_file_info *fi, int op)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_flock(d->next, newpath, fi, op);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int subdir_bmap(const char *path, size_t blocksize, uint64_t *idx)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
char *newpath;
|
||||
int err = subdir_addpath(d, path, &newpath);
|
||||
if (!err) {
|
||||
err = fuse_fs_bmap(d->next, newpath, blocksize, idx);
|
||||
free(newpath);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static void *subdir_init(struct fuse_conn_info *conn)
|
||||
{
|
||||
struct subdir *d = subdir_get();
|
||||
fuse_fs_init(d->next, conn);
|
||||
return d;
|
||||
}
|
||||
|
||||
static void subdir_destroy(void *data)
|
||||
{
|
||||
struct subdir *d = data;
|
||||
fuse_fs_destroy(d->next);
|
||||
free(d->base);
|
||||
free(d);
|
||||
}
|
||||
|
||||
static const struct fuse_operations subdir_oper = {
|
||||
.destroy = subdir_destroy,
|
||||
.init = subdir_init,
|
||||
.getattr = subdir_getattr,
|
||||
.fgetattr = subdir_fgetattr,
|
||||
.access = subdir_access,
|
||||
.readlink = subdir_readlink,
|
||||
.opendir = subdir_opendir,
|
||||
.readdir = subdir_readdir,
|
||||
.releasedir = subdir_releasedir,
|
||||
.mknod = subdir_mknod,
|
||||
.mkdir = subdir_mkdir,
|
||||
.symlink = subdir_symlink,
|
||||
.unlink = subdir_unlink,
|
||||
.rmdir = subdir_rmdir,
|
||||
.rename = subdir_rename,
|
||||
.link = subdir_link,
|
||||
.chmod = subdir_chmod,
|
||||
.chown = subdir_chown,
|
||||
.truncate = subdir_truncate,
|
||||
.ftruncate = subdir_ftruncate,
|
||||
.utimens = subdir_utimens,
|
||||
.create = subdir_create,
|
||||
.open = subdir_open,
|
||||
.read_buf = subdir_read_buf,
|
||||
.write_buf = subdir_write_buf,
|
||||
.statfs = subdir_statfs,
|
||||
.flush = subdir_flush,
|
||||
.release = subdir_release,
|
||||
.fsync = subdir_fsync,
|
||||
.fsyncdir = subdir_fsyncdir,
|
||||
.setxattr = subdir_setxattr,
|
||||
.getxattr = subdir_getxattr,
|
||||
.listxattr = subdir_listxattr,
|
||||
.removexattr = subdir_removexattr,
|
||||
.lock = subdir_lock,
|
||||
.flock = subdir_flock,
|
||||
.bmap = subdir_bmap,
|
||||
|
||||
.flag_nullpath_ok = 1,
|
||||
.flag_nopath = 1,
|
||||
};
|
||||
|
||||
static const struct fuse_opt subdir_opts[] = {
|
||||
FUSE_OPT_KEY("-h", 0),
|
||||
FUSE_OPT_KEY("--help", 0),
|
||||
{ "subdir=%s", offsetof(struct subdir, base), 0 },
|
||||
{ "rellinks", offsetof(struct subdir, rellinks), 1 },
|
||||
{ "norellinks", offsetof(struct subdir, rellinks), 0 },
|
||||
FUSE_OPT_END
|
||||
};
|
||||
|
||||
static void subdir_help(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
" -o subdir=DIR prepend this directory to all paths (mandatory)\n"
|
||||
" -o [no]rellinks transform absolute symlinks to relative\n");
|
||||
}
|
||||
|
||||
static int subdir_opt_proc(void *data, const char *arg, int key,
|
||||
struct fuse_args *outargs)
|
||||
{
|
||||
(void) data; (void) arg; (void) outargs;
|
||||
|
||||
if (!key) {
|
||||
subdir_help();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct fuse_fs *subdir_new(struct fuse_args *args,
|
||||
struct fuse_fs *next[])
|
||||
{
|
||||
struct fuse_fs *fs;
|
||||
struct subdir *d;
|
||||
|
||||
d = calloc(1, sizeof(struct subdir));
|
||||
if (d == NULL) {
|
||||
fprintf(stderr, "fuse-subdir: memory allocation failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fuse_opt_parse(args, d, subdir_opts, subdir_opt_proc) == -1)
|
||||
goto out_free;
|
||||
|
||||
if (!next[0] || next[1]) {
|
||||
fprintf(stderr, "fuse-subdir: exactly one next filesystem required\n");
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
if (!d->base) {
|
||||
fprintf(stderr, "fuse-subdir: missing 'subdir' option\n");
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
if (d->base[0] && d->base[strlen(d->base)-1] != '/') {
|
||||
char *tmp = realloc(d->base, strlen(d->base) + 2);
|
||||
if (!tmp) {
|
||||
fprintf(stderr, "fuse-subdir: memory allocation failed\n");
|
||||
goto out_free;
|
||||
}
|
||||
d->base = tmp;
|
||||
strcat(d->base, "/");
|
||||
}
|
||||
d->baselen = strlen(d->base);
|
||||
d->next = next[0];
|
||||
fs = fuse_fs_new(&subdir_oper, sizeof(subdir_oper), d);
|
||||
if (!fs)
|
||||
goto out_free;
|
||||
return fs;
|
||||
|
||||
out_free:
|
||||
free(d->base);
|
||||
free(d);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FUSE_REGISTER_MODULE(subdir, subdir_new);
|
||||
20
fuse/mount.c
20
fuse/mount.c
@@ -36,13 +36,16 @@
|
||||
#define MS_SYNCHRONOUS MNT_SYNCHRONOUS
|
||||
#define MS_NOATIME MNT_NOATIME
|
||||
|
||||
|
||||
#define umount2(mnt, flags) unmount(mnt, (flags == 2) ? MNT_FORCE : 0)
|
||||
#endif
|
||||
|
||||
#define FUSERMOUNT_PROG "fusermount"
|
||||
#define FUSE_COMMFD_ENV "_FUSE_COMMFD"
|
||||
|
||||
#if defined(__ANDROID__) && !defined(FUSERMOUNT_DIR)
|
||||
# define FUSERMOUNT_DIR "/system/xbin"
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FORK
|
||||
#define fork() vfork()
|
||||
#endif
|
||||
@@ -138,7 +141,6 @@ static void mount_help(void)
|
||||
"\n");
|
||||
}
|
||||
|
||||
#define FUSERMOUNT_DIR "/usr/bin"
|
||||
static void exec_fusermount(const char *argv[])
|
||||
{
|
||||
execv(FUSERMOUNT_DIR "/" FUSERMOUNT_PROG, (char **) argv);
|
||||
@@ -302,14 +304,18 @@ void fuse_kern_unmount(const char *mountpoint, int fd)
|
||||
pfd.fd = fd;
|
||||
pfd.events = 0;
|
||||
res = poll(&pfd, 1, 0);
|
||||
|
||||
/* Need to close file descriptor, otherwise synchronous umount
|
||||
would recurse into filesystem, and deadlock.
|
||||
|
||||
Caller expects fuse_kern_unmount to close the fd, so close it
|
||||
anyway. */
|
||||
close(fd);
|
||||
|
||||
/* If file poll returns POLLERR on the device file descriptor,
|
||||
then the filesystem is already unmounted */
|
||||
if (res == 1 && (pfd.revents & POLLERR))
|
||||
return;
|
||||
|
||||
/* Need to close file descriptor, otherwise synchronous umount
|
||||
would recurse into filesystem, and deadlock */
|
||||
close(fd);
|
||||
}
|
||||
|
||||
if (geteuid() == 0) {
|
||||
@@ -465,7 +471,7 @@ static int fuse_mount_sys(const char *mnt, struct mount_opts *mo,
|
||||
return -1;
|
||||
}
|
||||
|
||||
snprintf(tmp, sizeof(tmp), "fd=%i,rootmode=%o,user_id=%i,group_id=%i",
|
||||
snprintf(tmp, sizeof(tmp), "fd=%i,rootmode=%o,user_id=%u,group_id=%u",
|
||||
fd, stbuf.st_mode & S_IFMT, getuid(), getgid());
|
||||
|
||||
res = fuse_opt_add_opt(&mo->kernel_opts, tmp);
|
||||
|
||||
@@ -228,18 +228,21 @@ void fuse_kern_unmount(const char *mountpoint, int fd)
|
||||
(void)mountpoint;
|
||||
|
||||
if (fstat(fd, &sbuf) == -1)
|
||||
return;
|
||||
goto out;
|
||||
|
||||
devname_r(sbuf.st_rdev, S_IFCHR, dev, 128);
|
||||
|
||||
if (strncmp(dev, "fuse", 4))
|
||||
return;
|
||||
goto out;
|
||||
|
||||
strtol(dev + 4, &ep, 10);
|
||||
if (*ep != '\0')
|
||||
return;
|
||||
goto out;
|
||||
|
||||
do_unmount(dev, fd);
|
||||
|
||||
out:
|
||||
close(fd);
|
||||
}
|
||||
|
||||
/* Check if kernel is doing init in background */
|
||||
|
||||
@@ -16,16 +16,23 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <mntent.h>
|
||||
#include <paths.h>
|
||||
#ifndef __NetBSD__
|
||||
#include <mntent.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/param.h>
|
||||
#if defined(__ANDROID__)
|
||||
#include <paths.h>
|
||||
#endif
|
||||
|
||||
#ifdef __NetBSD__
|
||||
#define umount2(mnt, flags) unmount(mnt, (flags == 2) ? MNT_FORCE : 0)
|
||||
#define mtab_needs_update(mnt) 0
|
||||
#elif defined(__ANDROID__)
|
||||
#define mtab_needs_update(mnt) 0
|
||||
#else
|
||||
static int mtab_needs_update(const char *mnt)
|
||||
{
|
||||
@@ -94,10 +101,12 @@ static int add_mount(const char *progname, const char *fsname,
|
||||
goto out_restore;
|
||||
}
|
||||
if (res == 0) {
|
||||
char *env = NULL;
|
||||
|
||||
sigprocmask(SIG_SETMASK, &oldmask, NULL);
|
||||
setuid(geteuid());
|
||||
execl("/bin/mount", "/bin/mount", "--no-canonicalize", "-i",
|
||||
"-f", "-t", type, "-o", opts, fsname, mnt, NULL);
|
||||
execle("/bin/mount", "/bin/mount", "--no-canonicalize", "-i",
|
||||
"-f", "-t", type, "-o", opts, fsname, mnt, NULL, &env);
|
||||
fprintf(stderr, "%s: failed to execute /bin/mount: %s\n",
|
||||
progname, strerror(errno));
|
||||
exit(1);
|
||||
@@ -145,10 +154,17 @@ static int exec_umount(const char *progname, const char *rel_mnt, int lazy)
|
||||
goto out_restore;
|
||||
}
|
||||
if (res == 0) {
|
||||
char *env = NULL;
|
||||
|
||||
sigprocmask(SIG_SETMASK, &oldmask, NULL);
|
||||
setuid(geteuid());
|
||||
execl("/bin/umount", "/bin/umount", "-i", rel_mnt,
|
||||
lazy ? "-l" : NULL, NULL);
|
||||
if (lazy) {
|
||||
execle("/bin/umount", "/bin/umount", "-i", rel_mnt,
|
||||
"-l", NULL, &env);
|
||||
} else {
|
||||
execle("/bin/umount", "/bin/umount", "-i", rel_mnt,
|
||||
NULL, &env);
|
||||
}
|
||||
fprintf(stderr, "%s: failed to execute /bin/umount: %s\n",
|
||||
progname, strerror(errno));
|
||||
exit(1);
|
||||
@@ -204,10 +220,12 @@ static int remove_mount(const char *progname, const char *mnt)
|
||||
goto out_restore;
|
||||
}
|
||||
if (res == 0) {
|
||||
char *env = NULL;
|
||||
|
||||
sigprocmask(SIG_SETMASK, &oldmask, NULL);
|
||||
setuid(geteuid());
|
||||
execl("/bin/umount", "/bin/umount", "--no-canonicalize", "-i",
|
||||
"--fake", mnt, NULL);
|
||||
execle("/bin/umount", "/bin/umount", "--no-canonicalize", "-i",
|
||||
"--fake", mnt, NULL, &env);
|
||||
fprintf(stderr, "%s: failed to execute /bin/umount: %s\n",
|
||||
progname, strerror(errno));
|
||||
exit(1);
|
||||
@@ -300,7 +318,7 @@ char *fuse_mnt_resolve_path(const char *progname, const char *orig)
|
||||
}
|
||||
|
||||
int fuse_mnt_check_empty(const char *progname, const char *mnt,
|
||||
mode_t rootmode, off64_t rootsize)
|
||||
mode_t rootmode, loff_t rootsize)
|
||||
{
|
||||
int isempty = 1;
|
||||
|
||||
|
||||
@@ -15,5 +15,5 @@ int fuse_mnt_umount(const char *progname, const char *abs_mnt,
|
||||
const char *rel_mnt, int lazy);
|
||||
char *fuse_mnt_resolve_path(const char *progname, const char *orig);
|
||||
int fuse_mnt_check_empty(const char *progname, const char *mnt,
|
||||
mode_t rootmode, off64_t rootsize);
|
||||
mode_t rootmode, loff_t rootsize);
|
||||
int fuse_mnt_check_fuseblk(void);
|
||||
|
||||
@@ -356,10 +356,10 @@ static uint32_t owner_hash(const unsigned char *id, size_t id_len)
|
||||
|
||||
static int ulockmgr_canonicalize(int fd, struct flock *lock)
|
||||
{
|
||||
off64_t offset;
|
||||
loff_t offset;
|
||||
if (lock->l_whence == SEEK_CUR) {
|
||||
offset = lseek(fd, 0, SEEK_CUR);
|
||||
if (offset == (off64_t) -1)
|
||||
if (offset == (loff_t) -1)
|
||||
return -errno;
|
||||
} else if (lock->l_whence == SEEK_END) {
|
||||
struct stat stbuf;
|
||||
|
||||
Reference in New Issue
Block a user