# error "FUSE mount not supported on Windows! Please configure --without-fuse"
#endif
-#include "wimlib/dentry.h"
-#include "wimlib/encoding.h"
-#include "wimlib/metadata.h"
-#include "wimlib/paths.h"
-#include "wimlib/progress.h"
-#include "wimlib/reparse.h"
-#include "wimlib/timestamp.h"
-#include "wimlib/unix_data.h"
-#include "wimlib/write.h"
-#include "wimlib/xml.h"
+#define FUSE_USE_VERSION 26
+#include <attr/xattr.h>
#include <dirent.h>
#include <errno.h>
+#include <fuse.h>
#include <limits.h>
#include <mqueue.h>
#include <pthread.h>
#include <unistd.h>
#include <utime.h>
-#define FUSE_USE_VERSION 26
-#include <fuse.h>
-#include <attr/xattr.h>
+#include "wimlib/dentry.h"
+#include "wimlib/encoding.h"
+#include "wimlib/lookup_table.h"
+#include "wimlib/metadata.h"
+#include "wimlib/paths.h"
+#include "wimlib/progress.h"
+#include "wimlib/reparse.h"
+#include "wimlib/timestamp.h"
+#include "wimlib/unix_data.h"
+#include "wimlib/write.h"
+#include "wimlib/xml.h"
#ifndef O_NOFOLLOW
# define O_NOFOLLOW 0 /* Security only... */
if (fd->f_idx < inode->i_next_fd)
inode->i_next_fd = fd->f_idx;
FREE(fd);
- if (--inode->i_num_opened_fds == 0) {
- /* The last file descriptor to this inode was closed. */
- FREE(inode->i_fds);
- inode->i_fds = NULL;
- inode->i_num_allocated_fds = 0;
- if (inode->i_nlink == 0)
- /* No links to this inode remain. Get rid of it. */
- free_inode(inode);
- }
+ inode_dec_num_opened_fds(inode);
return ret;
}
int lookup_flags,
struct wim_dentry **dentry_ret,
struct wim_lookup_table_entry **lte_ret,
- u16 *stream_idx_ret)
+ unsigned *stream_idx_ret)
{
WIMStruct *wim = ctx->wim;
struct wim_dentry *dentry;
struct wim_lookup_table_entry *lte;
- u16 stream_idx;
+ unsigned stream_idx;
const char *stream_name = NULL;
struct wim_inode *inode;
char *p = NULL;
*/
static int
extract_resource_to_staging_dir(struct wim_inode *inode,
- u16 stream_idx,
+ unsigned stream_idx,
struct wim_lookup_table_entry **lte_ptr,
off_t size,
const struct wimfs_context *ctx)
if (new_dentry(new_name, &new_alias))
return -ENOMEM;
- new_alias->d_inode = inode;
- inode_add_dentry(new_alias, inode);
+ inode_ref_streams(inode);
+ d_associate(new_alias, inode);
dentry_add_child(dir, new_alias);
touch_inode(dir->d_inode);
- inode->i_nlink++;
- inode_ref_streams(inode);
return 0;
}
struct wim_dentry *dentry;
struct wim_inode *inode;
struct wim_lookup_table_entry *lte;
- u16 stream_idx;
+ unsigned stream_idx;
struct wimfs_fd *fd;
int ret;
const struct wimfs_context *ctx = wimfs_get_context();
struct wim_dentry *dentry;
struct wim_lookup_table_entry *lte;
- u16 stream_idx;
+ unsigned stream_idx;
int ret;
int fd;
{
const struct wimfs_context *ctx = wimfs_get_context();
struct wim_dentry *dentry;
- u16 stream_idx;
+ unsigned stream_idx;
int ret;
ret = wim_pathname_to_stream(ctx, path, 0, &dentry, NULL, &stream_idx);